/** * setUp * * @return void */ public function setUp() { parent::setUp(); $this->_View = new BcAppView(); $this->_View->helpers = array('BcContents'); $this->_View->loadHelpers(); $this->BcContents = $this->_View->BcContents; }
/** * setUp */ public function setUp() { parent::setUp(); $this->_View = new BcAppView(); $this->_View->helpers = array('BcBaser'); $this->_View->loadHelpers(); $SiteConfig = ClassRegistry::init('SiteConfig'); $this->_View->BcBaser->siteConfig = $SiteConfig->findExpanded(); $this->BcBaser = new BcBaserHelper($this->_View); $this->BcBaser = $this->_View->BcBaser; }
/** * setUp * * @return void */ public function setUp() { parent::setUp(); $this->_View = new BcAppView(); $this->_View->helpers = array('BcBaser', 'BcPage'); $this->_View->loadHelpers(); $this->Page = ClassRegistry::init('Page'); $this->BcBaser = $this->_View->BcBaser; $this->BcPage = $this->_View->BcPage; $this->BcPage->BcBaser = $this->_View->BcBaser; }
/** * setUp * * @return void */ public function setUp() { parent::setUp(); $this->_View = new BcAppView(); $SiteConfig = ClassRegistry::init('SiteConfig'); $siteConfig = $SiteConfig->findExpanded(); $this->_View->set('widgetArea', $siteConfig['widget_area']); $this->_View->set('siteConfig', $siteConfig); $this->_View->helpers = array('BcBaser'); $this->_View->loadHelpers(); $this->BcBaser = $this->_View->BcBaser; }
/** * Skip loading helpers if this is a _serialize based view. * * @return void */ public function loadHelpers() { if (isset($this->viewVars['_serialize'])) { return; } parent::loadHelpers(); }
protected function _getView() { $MaintenanceMode = Configure::read('MaintenanceMode'); $helpers = array('Html'); if (!empty($MaintenanceMode['view']['helpers']) && is_array($helpers)) { $helpers = $MaintenanceMode['view']['helpers']; } $View = new View(null); $View->viewVars = $MaintenanceMode; $View->hasRendered = false; $View->helpers = $helpers; $View->loadHelpers(); return $View; }
public function loadHelpers() { parent::loadHelpers(); $helpers = HelperCollection::normalizeObjectArray($this->helpers); foreach ($helpers as $properties) { list(, $class) = pluginSplit($properties['class']); $helper = $this->{$class}; $class = Inflector::variable($class); if (!isset($this->viewVars[$class])) { $this->viewVars[$class] = $helper; } $this->Phptal->set($class, $helper); $this->_createHelperModifier($class); } unset($class, $helpers, $helper); }
/** * Test loadHelpers method * * @return void */ public function testLoadHelpers() { $View = new View($this->PostsController); $View->helpers = array('Html', 'Form'); $View->loadHelpers(); $this->assertInstanceOf('HtmlHelper', $View->Html, 'Object type is wrong.'); $this->assertInstanceOf('FormHelper', $View->Form, 'Object type is wrong.'); }