It's easy to integrate custom modifications and/or themes with PHP Pro Bid V9.
All custom code modifications can now be done by overriding or extending files – see the table below:
OVERRIDE | EXTEND | |
---|---|---|
Classes | Yes | |
View Files | Yes | |
Controllers | Yes | Yes |
PHP Lang Files * | Yes | |
Navigation XML Files | Yes | |
Module Config Files | Yes |
* Not yet available. To be implemented in V7.5.
Most modified files, excepting theme specific view files, will be added in a newly created /mods/ folder, and will be automatically parsed by the software. A file in the /mods/ folder will take precedence over its counterpart in one of the stock folders.
All classes can be overridden by copying the original class in the same folder as in stock, but in the /mods/
folder, for example, the parsing order will be:
/mods/library/Ppb/Model/Elements/Listing.php overrides
/library/Ppb/Model/Elements/Listing.php
The software will recognize the newly overridden class as the class to use, and its corresponding stock file won't be used unless the modified class is removed.
View files, including view partials, will work similarly to the rule for classes. However, theme-specific view files
will take precedence over files in the /mods/ folder or stock view files. For example:
/themes/your-theme/members/summary/index.phtml overrides
/mods/module/Members/view/members/summary/index.phtml which overrides
/module/Members/view/members/summary/index.phtml
Example for view partials (applies to navigation and form partials as well):
/themes/your-theme/partials/pagination.phtml overrides
/mods/module/App/view/partials/pagination.phtml which overrides
/module/App/view/partials/pagination.phtml
Controllers can be overridden just like any class, as explained in paragraph #1, but they can also be extended. Consequently, the extended controller class will have to be named as
/mods/module/App/src/App/Controller/PagesExtended.php will extend:
/module/App/src/App/Controller/Pages.php and the class will be defined as:
class PagesExtended extends Pages
* Not yet available. To be implemented in V7.5.
Navigating XML files can be extended by adding data to the original xml structure. You can also override data
from the original structure. To extend a navigation file, create the same file in the /mods/
folder, for example:
/mods/module/App/config/data/navigation/navigation.xml will extend:
/module/App/config/data/navigation/navigation.xml
In the new extended navigation file, add:
link/to/the/page
Module config files can be extended by replicating the array structure. It works similarly to how the navigation files are extended.
return array( 'routes' => array( 'app-custom-sample-route' => array( '/custom/sample/route', array( 'controller' => 'custom', 'action' => 'sample', ), ), ), );