Extensions mechanisms

Create a file in local

Any view, configuration or lang file can be changed via the local folder.

This is possible thanks to the cascading file system existing in FuelPHP and adapted for Novius OS. It’s very easy to do, because you only need to copy an existing file and change it how you like!

For an application, the file should be copied into local/config/apps/{application}/ or local/views/apps/{application}/.

To extend a file from the core of Novius OS, we’ll use local/config/apps/novius-os/ and local/views/novius-os/.

The ‘generic’ pattern is local/{section}/{application}/ with:

  • {section}` equals to config or views ;
  • {application}` matching apps + an application name or novius-os for the core.


The noviusos_page application has a controller/admin/appdesk.config.php configuration file (so it’s located at noviusos_page::config/controller/admin/appdesk.config.php).

If we copy it into local/config/apps/noviusos_page/controller/admin/appdesk.config.php, then it will be merged automatically with the one asked by the application.


When we create a local/views/apps/noviusos_help/admin/help.view.php file, it will be used as a replacement of noviusos_help::admin/help.view.php!

To extend a file from the core, we’ll use novius-os as application name. For example, local/views/novius-os/admin/login.view.php.

Use events to alter a configuration

Any configuration file can be altered thanks to the config|<path>. event.

Replace a view with another one

It’s possible to call the View::redirect() method to replace any view file by another one.


// Replace the 'admin/help' view of the 'noviusos_help' application by the 'help' view of the 'local' directory
View::redirect('noviusos_help::admin/help', 'local::help');

Create a dedicated extension application

To extend an application, a dedicated application can be created, which will alter how the first one works.

The second application defines its extending my_application through its metadata.config.php file:


 return array(
     'name' => 'Application 2',
     // It's an extension application
     'extends' => array(

Once application_2 is installed, it will be loaded at the same time than my_application is.

When an application extends another one, some automatic behaviours falls into place.


application_2 extends my_application.


Configuration files of Controller and Model inside my_application can automatically be extended by application_2.

For instance, my_application has the following configuration file for Controller_Test: applications/mon_application/config/controller/test.config.php.

In application_2, if the matching file applications/application_2/config/apps/mon_application/controller/test.config.php exists, then it will be merged.

i.e. in My\Application\Controller_Test, the $config variable will contain the merge of the 2 files (the one of the extended my_application application, and also the one from application_2 which extends the first one).


Views of my_application can be replaced by application_2.

For instance, my_application have a view views/admin/help.view.php

If in application_2, if the matching file applications/application_2/views/apps/mon_application/admin/help.view.php exists, it will be used in place of that of my_application.

Read the Docs v: elche
On Read the Docs
Project Home

Free document hosting provided by Read the Docs.