Skip to content

Resolution rules ​

Each module has its own MVC layout. Templates follow a fixed convention; the usual entry point is the v() helper.

Default rule:

view_dir/controller/action.html

Basic example ​

Templates live under the module view directory: controller name as a folder, one .html file per action.

php
namespace home\controller;
class index{
    function docs(){
        v();
    }
}

For the docs action on index, the template is ./app/home/view/index/docs.html.

v($str) variants ​

Assume the current request is /home/index/docs.

  1. v('') — default: /home/view/index/docs.html (current module, controller, action).
  2. v('docs') — same controller, docs.html.
  3. v('index:docs') — explicit controller view: /home/view/index/docs.html (segment before : is the view subfolder/controller).
  4. v('admin@index:docs') — another module: /admin/view/index/docs.html (@ selects the module).

PhpTide documentation