Personal tools

Difference between revisions of "Customization"

From PhotoVoltaic Logger new generation

Jump to: navigation, search
m (Coding)
m (Custom routes)
Line 28: Line 28:
 
=== Custom routes ===
 
=== Custom routes ===
  
For [[API]] (since <tt>r3</tt>) you can define your own routes in <tt>route.custom.php</tt>.
+
For [[API]] '''only''' (since <tt>r3</tt>) you can define your own routes in <tt>route.custom.php</tt>.
  
 
See <tt>route.custom.php.dist</tt> for reference and refer to the other route definitions in <tt>route.*.php</tt>
 
See <tt>route.custom.php.dist</tt> for reference and refer to the other route definitions in <tt>route.*.php</tt>

Revision as of 16:40, 3 March 2014

Templates

The web frontend templates resides at frontend/View

The internal search logic for the to be used template is this (assume this requested template: default.footer.tpl)

  • Search these directories
    • frontend/View/{module}/custom
    • frontend/View/{module}
    • frontend/View/custom
    • frontend/View
  • Found template here: frontend/View/default.footer.tpl

The custom sub directories are not delivered with Git repository, you have to create them if required.

These directories will be ignored on update, they are excluded via .gitignore

Coding

Prepend/append code

  • If an file prepend.php exists, it will be included before any other PHP instructions.
  • If an file append.php exists, it will be included after all other PHP instructions.

(This works for the web frontend and for API since r3, see prepend.php.dist and api/r3/prepend.php.dist.

I use this for defining the application name for NewRelic monitoring.

Custom routes

For API only (since r3) you can define your own routes in route.custom.php.

See route.custom.php.dist for reference and refer to the other route definitions in route.*.php