$this->pageTitle = 'My Custom Page Title';
<title><?=$this->pageTitle?></title>
$this->sidebar = 'standard';
// load a view in your controller $view = \View::forge('this/that'); // load a viewmodel instead $view = \Viewmodel::forge('this/that');This requires a viewmodel class called View_This_That, in a file called that.php, in the classes/view/this folder. By default it loads the same view as in the first example, views/this/that.php. By default, the method called view() is called in your viewmodel, that should contain the logic to prepare the variables for your view. Difference with Cake is that in the view, they're just variables, not accessed via $this. So $this->title in the Viewmodel method becomes $title in your view. You pass data from your controller to a Viewmodel the same way as with a standard view:
$view = \Viewmodel::forge('this/that'); $view->set('var', 'value');
It looks like you're new here. If you want to get involved, click one of these buttons!