/**
  * Initializes the App object. (Parses the uri, loads controller, etc..)
  * 
  * @access public
  */
 public function init()
 {
     global $config, $Inflector;
     // Parse uri
     $this->parseUri();
     // load form component
     $this->Form = new FormComponent();
     $this->Form->params = array('action' => $this->ml(), 'method' => 'post');
     // get flash data
     $this->getFlash();
     // load controller
     $controller = ucfirst($this->path['controller']) . 'Controller';
     $this->Controller = new $controller();
     $this->Controller->init();
     call_user_func(array($this->Controller, $this->path['action']), $this->path['params']);
     // load view
     $this->Controller->loadView();
 }
Example #2
0
 /**
  * Override da função padrão de loadView para que outros dados pudessem ser enviados para a view
  * sem a necessidade de ficar chamando os mesmos em cada action do controller.
  * 
  * @param String $view
  * @param Array $data
  * @param Boolean $toVar
  * @return String 
  */
 public function loadView($view, array $data, $toVar = false)
 {
     $data['tplBreadcrumb'] = $this->buildBreadCrumb();
     $data['tplAreaTitle'] = $this->areaTitle;
     return parent::loadView($view, $data, $toVar);
 }
 public function index()
 {
     parent::loadView('generator');
 }