If you want multiple controllers to be able to share a view, do this:
Put the shared views in the views/common directory
Call a shared view like this: $this->render(‘../common/view_name’);
Share this post:
Like this:
LikeLoading...
2 comments
Thanks, AD, this looks like it will work great when you want all the views for a controller to come from a certain folder. The other way might be more efficient if you want some views to come from the default view folder and some to come from the common folder.
… Or
$this->viewPath = ‘name of view folder’;
$this->render(‘name of file only’);
Thanks, AD, this looks like it will work great when you want all the views for a controller to come from a certain folder. The other way might be more efficient if you want some views to come from the default view folder and some to come from the common folder.
… Or
$this->viewPath = ‘name of view folder’;
$this->render(‘name of file only’);
Cheers,
AD