controller - PHP: How to render the view at the end? -
i'm trying create own little php-framework fun , learn. stuck view.
class index extends controller { function __construct() { parent::__construct(); $this->view->msg = 'this message sended on view.'; $this->view->content = 'this index-content.'; $this->view->render('index/index'); } public function something() { // // , render $this->view->content = 'this content something.' }
so can misuse __destruct , render here output. guess against purpose of method.
when compare intention e.g. zend framework or laravel use e.g. after() method render view.
but not understand method can this. constructor first, destructor last , between has called work. there "magic" methods this?
you should handle http i/o
sniff through repo as can, kohana simple yet powerfull framework. (you can learn thing or two)
Comments
Post a Comment