Ejemplo n.º 1
0
 /**
  * Renders view for given action and layout. If $file is given, that is used
  * for a view filename (e.g. customFunkyView.ctp).
  * Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
  *
  * @param string $action Name of action to render for
  * @param string $layout Layout to use
  * @param string $file Custom filename for view
  * @return string Rendered Element
  */
 function render($action = null, $layout = null, $file = null)
 {
     DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View', true));
     $out = parent::render($action, $layout, $file);
     DebugKitDebugger::stopTimer('viewRender');
     DebugKitDebugger::stopTimer('controllerRender');
     DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'View render complete', true));
     if (empty($this->params['requested']) && isset($this->loaded['toolbar'])) {
         $backend = $this->loaded['toolbar']->getName();
         $this->loaded['toolbar']->{$backend}->send();
     }
     if (empty($this->output)) {
         return $out;
     }
     return $this->output;
 }
Ejemplo n.º 2
0
 /**
  * Renders view for given action and layout.
  * Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
  *
  * @param string $action Name of action to render for
  * @param string $layout Layout to use
  * @return string Rendered Element
  */
 public function render($action = null, $layout = null)
 {
     DebugTimer::start('viewRender', __d('debug_kit', 'Rendering View'));
     $out = parent::render($action, $layout);
     DebugTimer::stop('viewRender');
     DebugTimer::stop('controllerRender');
     DebugMemory::record(__d('debug_kit', 'View render complete'));
     if (empty($this->request->params['requested']) && $this->Helpers && $this->Helpers->attached('Toolbar')) {
         $backend = $this->Helpers->Toolbar->getName();
         $this->Helpers->Toolbar->{$backend}->send();
     }
     if (empty($this->output)) {
         return $out;
     }
     return $this->output;
 }
Ejemplo n.º 3
0
 /**
  * Renders view for given action and layout. If $file is given, that is used
  * for a view filename (e.g. customFunkyView.ctp).
  * Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
  *
  * @param string $action Name of action to render for
  * @param string $layout Layout to use
  * @param string $file Custom filename for view
  * @return string Rendered Element
  */
 function render($action = null, $layout = null, $file = null)
 {
     DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View', true));
     $out = parent::render($action, $layout, $file);
     DebugKitDebugger::stopTimer('viewRender');
     DebugKitDebugger::stopTimer('controllerRender');
     DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'View render complete', true));
     if (isset($this->loaded['toolbar'])) {
         $backend = $this->loaded['toolbar']->getName();
         $this->loaded['toolbar']->{$backend}->send();
     }
     if (empty($this->output)) {
         return $out;
     }
     //Temporary work around to hide the SQL dump at page bottom
     Configure::write('debug', 0);
     return $this->output;
 }
Ejemplo n.º 4
0
 /**
  * Workaround _render() limitation in core. Which forces View::_render() for .ctp and .thtml templates
  * Creates temporary extension to trick View::render() & View::renderLayout()
  *
  * @param string $name Layout Name
  * @return string
  **/
 function _getLayoutFileName($name = null)
 {
     $filename = parent::_getLayoutFileName($name);
     return $this->_replaceExtension($filename);
 }