Welcome ,
  1. Home
  2. Widgets

PageCarton Documentation

Interested in coding widgets, classes, or methods? Check out the Code section!

Documentation Article

Widgets


By default, whenever PageCarton wants to output something to the browser, it does this through widgets. A widget serves as a bridge that links the PageCarton core to the browser.

2 yrs ago Posted By Ayoola Falola322 views in Code , Advanced Topics Share

Adding widgets require one to have a capability of writing PHP code. Widgets are PHP classes that extend the base PageCarton_Widget class. A Widget should have an "init" method that the PageCarton core would call to run the widget process. The easiest way to create a widget is to create the file from the PageCarton Admin Panel. To create a widget file, go to:

PageCarton Admin Panel > Plugins > My Plugins > "New Widget"

This will create the PHP File that would contain the widget class in the right directory. It will also create the "init" method outputting some demo code. You need to customize this file to suite the task you want the widget to accomplish. All Widget files should be saved in "/pagecarton/sites/*/application/modules".

Currently, you cannot edit the widget file from the browser; you need to edit the file using your favorite code text editor.