R3m/framework Features View class

The View class has these methods.



View::response(App $object, $url);

View::response() creates a response of the given url which can be located with the View::locate method.
It uses the parser to parse the response. you can use custom plugins in the view file to reach the model or do other cool stuff.
This keeps the controller clean.


View::Locate(App $object, $template=null);

View::locate() locates the view file.
Be aware: you need to set the controller DIR constant.
The Dir constant is: const DIR = __DIR__ . DIRECTORY_SEPARATOR;.
You can also use template as an object with a dir & name property.
If $template is null and $object->data('template') is set, that one is used.


View::configure(App $object);

View::configure() gets called from App::run() throught the Controller if the Controller extends the View.
It sets the Cache dir, Compile dir and some configuration options like the controller.dir.

Last modified: 2021-06-07

© 2021 universeorange.com