The simple PHP engine is for using standard PHP as the template engine. This layer is for people who do not like to use template engines such as Smarty which is the default in Scorpio.
The layer works in a similar manner to that in Zend Framework. The view object can be accessed by using $this and the assigned template variables can be accessed by using $this->VARNAME.
To use the PHP template engine, you need to make a few modifications. First: the engine needs to be enabled via the site config:
Next your site templates will need to reference PHP vars:
Scorpio Framework - oMap->getDescription(); ?> Scorpio Framework - Using PHP Template Engine
Well done! If you can see this text, then the base system is functioning.
You should be able to make any request to oMap->getUriPath(); ?> and end up with this page.
Current request: oRequest->getRequestUri(); ?>
This template engine will NOT work with the Smarty templates (obviously). Each would have to be re-coded for the engine.
The template vars can only be accessed via $this.
Using PHP allows full, un-restricted access to all PHP functions and therefore allows the output wrapper to be circumvented very easily.
Posted by: Dave Redfern (Writer), in News on 12 Jul 2008 @ 20:53
This
work is licenced under a
Creative Commons Licence.