Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace web2bb;
- class baseController
- {
- @@ //protected $breadcrumbs, $view, $content=null;
- @@ protected $breadcrumbs, $view, $content=null, $disableLayout=false;
- public function __construct()
- {
- $this->view = new \web2bb\view;
- /*** create the bread crumbs ***/
- $bc = new \web2bb\breadcrumbs;
- // $bc->setPointer('->');
- $bc->crumbs();
- $this->view->breadcrumbs = $bc->breadcrumbs;
- // a new menu instance
- $menu = new \web2bb\menuReader( __APP_PATH . '/modules' );
- $this->view->menu = $menu;
- }
- public function __destruct()
- {
- if( !is_null( $this->content ) )
- {
- @@ if ($this->disableLayout) {
- @@ $result = $this->content;
- @@ } else {
- @@ $this->view->content = $this->content;
- @@ $result = $this->view->fetch( __APP_PATH.'/layouts/index.phtml' );
- @@ }
- $fc = FrontController::getInstance();
- $fc->setBody($result);
- }
- }
- }
- @@//THEN IN YOUR MODULE CONTROLLER ACTION:
- @@$this->content = $JSONString;
- @@$this->disableLayout = true;
- @@//Or if you don't want to make these changes for whole application, just copy paste __destruct() into your module controller which will make it local to your module.
- @@//I can't guarantee you that it works, just typed it off my head,
- @@//Maiku Mori
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement