protected function _initView() { $this->bootstrap(array('request')); // Initialize view $view = new Zend_View(); $view->setEncoding('UTF-8'); $view->doctype('XHTML1_STRICT'); $view->headTitle()->setSeparator(' » '); // Save the base URL $view->baseUrl = $this->getResource('request')->getBaseUrl(); // Add it to the ViewRenderer $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view); // Add some stylesheet $view->headLink()->appendStylesheet($view->baseUrl . '/css/default.css'); // Set user info /* $session = $this->getResource('session'); $view->userLoggedIn = $session->logged_in; $view->userInfo = $session->user; */ $view->addHelperPath(APPLICATION_PATH . '/views/helpers', 'SimpleCal_View_Helper_'); Zend_Dojo::enableView($view); // Return it, so that it can be stored by the bootstrap return $view; }
/** * Setup the view */ protected function _initViewSettings() { $this->bootstrap('view'); $this->_view = $this->getResource('view'); // add global helpers $this->_view->addHelperPath(APPLICATION_PATH . '/views/helpers', 'Zend_View_Helper'); Zend_Dojo::enableView($this->_view); //$this->_view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); // set encoding and doctype $this->_view->setEncoding('koi8-r'); $this->_view->doctype('XHTML1_STRICT'); $config = $this->getResource('config'); $prefix = $config["urlprefix"]; // set css links and a special import for the accessibility styles // $this->_view->headStyle()->setStyle('@import "/css/access.css";'); // $this->_view->headLink()->appendStylesheet('/reg2/css/reset.css'); $this->_view->headLink()->appendStylesheet($prefix . '/css/form.css'); $this->_view->headLink()->appendStylesheet($prefix . '/css/reg2.css'); // setting the site in the title $this->_view->headTitle('ιώβ-10'); // setting a separator string for segments: $this->_view->headTitle()->setSeparator(' - '); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($this->_view); return $this->_view; }
protected function _initView() { $view = new Zend_View(); Zend_Dojo::enableView($view); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->setView($view); $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); return $view; }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { $registry = Zend_Registry::getInstance(); if (isset($registry['Zend_Dojo_View_Helper_Dojo'])) { unset($registry['Zend_Dojo_View_Helper_Dojo']); } $this->view = new Zend_View(); Zend_Dojo::enableView($this->view); }
/** * I think this is needed for something. can't remember * */ public function init() { Zend_Dojo::enableView($this->view); $this->view->url = Zend_Registry::get('config')->site->url; $this->view->action = $this->getRequest()->getActionName(); header('Content-Type: text/html; charset=ISO-8859-1'); $this->_db = Zend_Registry::get('db'); Bvb_Grid_Deploy_Ofc::$url = Zend_Registry::get('config')->site->url; }
/** * @see library/Bvb/Grid/Filters/Render/Bvb_Grid_Filters_Render_RenderInterface::render() */ public function render() { Zend_Dojo::enableView($this->getView()); $this->getView()->dojo()->enable()->setDjConfigOption('parseOnLoad', true)->requireModule('dijit.form.Select'); $this->setAttribute('dojoType', 'dijit.form.Select'); if (!$this->hasAttribute('style')) { $this->setAttribute('style', 'width:120px !important;'); } return $this->getView()->formSelect($this->getFieldName(), $this->getDefaultValue(), $this->getAttributes(), $this->getValues()); }
public function init() { parent::init(); $this->_flash = $this->_helper->getHelper('FlashMessenger'); $this->_redirector = $this->_helper->getHelper('Redirector'); $this->checkAuth(); $this->_identity = Zend_Auth::getInstance()->getIdentity(); Zend_Dojo::enableView($this->view); //TODO there's gotta be a better way to do this $this->_config = Zend_Registry::get('Config'); }
/** * Retrieve Dojo View Helper * * @return Zend_Dojo_View_Dojo_Container */ public function getDojo() { if (null === $this->_dojo) { $this->getBootstrap()->bootstrap('view'); $view = $this->getBootstrap()->view; Zend_Dojo::enableView($view); $view->dojo()->setOptions($this->getOptions()); $this->_dojo = $view->dojo(); } return $this->_dojo; }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { $registry = Zend_Registry::getInstance(); if (isset($registry['Zend_Dojo_View_Helper_Dojo'])) { unset($registry['Zend_Dojo_View_Helper_Dojo']); } Zend_Dojo_View_Helper_Dojo::setUseProgrammatic(true); $view = new Zend_View(); Zend_Dojo::enableView($view); $this->helper = new My_View_Helper_SimpleTextarea(); $this->helper->setView($view); }
protected function _initViewHelpers() { $view = new Zend_View(); $view->doctype('XHTML1_STRICT'); $view->headMeta()->appendHttpEquiv('content-type', 'text/html:charset=utf-8')->appendName('description', 'ISKCON Congregation Database-Mumbai Chowpatty'); $view->headTitle('Radha Gopinath Mandir'); // Create new view object if not already instantiated //$view = new Zend_View(); Zend_Dojo::enableView($view); $view->dojo()->addStyleSheetModule('dijit.themes.tundra')->setDjConfigOption('usePlainJson', true)->disable(); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view); }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { $registry = Zend_Registry::getInstance(); if (isset($registry['Zend_Dojo_View_Helper_Dojo'])) { unset($registry['Zend_Dojo_View_Helper_Dojo']); } Zend_Dojo_View_Helper_Dojo::setUseProgrammatic(true); $this->view = new Zend_View(); Zend_Dojo::enableView($this->view); $this->view->addHelperPath('My/View/Helper/', 'My_View_Helper'); $this->element = new My_Form_Element_SimpleTextarea('foo'); $this->element->setView($this->view); }
/** * @see library/Bvb/Grid/Filters/Render/Bvb_Grid_Filters_Render_RenderInterface::render() */ public function render() { $this->removeAttribute('id'); $this->setDefaultValue(preg_replace('/\\D/', '', $this->getDefaultValue('to')), 'to'); $this->setDefaultValue(preg_replace('/\\D/', '', $this->getDefaultValue('from')), 'from'); $this->setAttribute('dojoType', 'dijit.form.NumberTextBox'); Zend_Dojo::enableView($this->getView()); $this->getView()->dojo()->enable()->setDjConfigOption('parseOnLoad', true)->requireModule('dijit.form.NumberTextBox'); if (!$this->hasAttribute('style')) { $this->setAttribute('style', 'width:50px !important;'); } return '<span>' . $this->__('From:') . "</span>" . $this->getView()->formText($this->getFieldName() . '[from]', $this->getDefaultValue('from'), array_merge($this->getAttributes(), array('id' => 'filter_' . $this->getFieldName() . '_from'))) . "<br><span>" . $this->__('To:') . "</span>" . $this->getView()->formText($this->getFieldName() . '[to]', $this->getDefaultValue('to'), array_merge($this->getAttributes(), array('id' => 'filter_' . $this->getFieldName() . '_to'))); }
/** * Set Dojo * * @return void */ public function setDojo() { Zend_Dojo::enableView($this->_view); $options = array_change_key_case($this->getOptions(), CASE_LOWER); foreach ($options as $key => $value) { switch ($key) { case 'cdnbase': $this->_view->dojo()->setCdnBase($value); break; case 'cdndojopath': $this->_view->dojo()->setCdnDojoPath($value); break; case 'cdnversion': $this->_view->dojo()->setCdnVersion($value); break; case 'djconfig': $this->_view->dojo()->setDjConfig($value); break; case 'layers': foreach ($value as $path) { $this->_view->dojo()->addLayer($path); } break; case 'localpath': $this->_view->dojo()->setLocalPath($value); break; case 'modules': foreach ($value as $module) { $this->_view->dojo()->requireModule($module); } break; case 'stylesheets': foreach ($value as $path) { $this->_view->dojo()->addStylesheet($path); } break; case 'stylesheetmodules': foreach ($value as $module) { $this->_view->dojo()->addStylesheetModule($module); } break; default: break; } } if (array_key_exists('enable', $options) && $options['enable']) { $this->_view->dojo()->enable(); } else { $this->_view->dojo()->disable(); } }
protected function _initView() { // Initialize view $view = new Zend_View(); $view->doctype('XHTML1_STRICT'); $view->headTitle('My First Zend Framework Application'); // Add it to the ViewRenderer $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); $viewRenderer->setView($view); Zend_Dojo::enableView($view); // Return it, so that it can be stored by the bootstrap return $view; }
/** * @see library/Bvb/Grid/Filters/Render/Bvb_Grid_Filters_Render_RenderInterface::render() */ public function render() { $this->removeAttribute('id'); $this->setAttribute('dojoType', 'dijit.form.DateTextBox'); $this->setAttribute('constraints', "{datePattern:'dd-MM-yyyy'}"); if ($this->getDefaultValue('from')) { $this->setDefaultValue(date('Y-m-d', strtotime($this->getDefaultValue('from'))), 'from'); } if ($this->getDefaultValue('to')) { $this->setDefaultValue(date('Y-m-d', strtotime($this->getDefaultValue('to'))), 'to'); } Zend_Dojo::enableView($this->getView()); $this->getView()->dojo()->enable()->setDjConfigOption('parseOnLoad', true)->requireModule('dijit.form.DateTextBox'); if (!$this->hasAttribute('style')) { $this->setAttribute('style', 'width:80px !important;'); } return '<span>' . $this->__('From:') . "</span>" . $this->getView()->formText($this->getFieldName() . '[from]', $this->getDefaultValue('from'), array_merge($this->getAttributes(), array('id' => 'filter_' . $this->getFieldName() . '_from'))) . "<br><span>" . $this->__('To:') . "</span>" . $this->getView()->formText($this->getFieldName() . '[to]', $this->getDefaultValue('to'), array_merge($this->getAttributes(), array('id' => 'filter_' . $this->getFieldName() . '_to'))); }
/** * Inicialização de Auxiliares da Visualização * @return null */ protected function _initViewHelpers() { $this->bootstrap('layout'); $layout = $this->getResource('layout'); /* @var $view Zend_View */ $view = $layout->getView(); // Doctype $view->doctype(Zend_View_Helper_Doctype::XHTML1_STRICT); // Meta $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8'); // Link $view->headLink()->appendStylesheet('/js/dojo/resources/dojo.css'); // Title $view->headTitle('Sistema de Artigos')->setSeparator(' - '); // Dojo Toolkit Zend_Dojo::enableView($view); $view->dojo()->setLocalPath('/js/dojo/dojo.js')->addStylesheetModule('dijit.themes.claro'); }
protected function _initView() { // Initialize view $view = new Zend_View(); $view->doctype('XHTML1_STRICT'); $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8'); $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); $view->addHelperPath('App/View/Helper/', 'App_View_Helper'); $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper'); Zend_Dojo::enableView($view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); // Add it to the ViewRenderer $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view); //seulement si on utilise d'autres frameworks ajax ZendX_JQuery_View_Helper_JQuery::enableNoConflictMode(); // Return it, so that it can be stored by the bootstrap return $view; }
public function routeShutdown(Zend_Controller_Request_Abstract $request) { $config = Zend_Registry::get('config'); //this is the only place where i want to have another cache instance - for zend_db metadata we should use file cache Zend_Db_Table_Abstract::setDefaultMetadataCache(Zend_Registry::get('cache_files')); $db = Zend_Db::factory($config->setup->database->adapter, $config->setup->database->config->toArray()); #TODO did they implement that in 1.7 or still we have to wait :/ switch ($config->setup->database) { case 'PDO_PGSQL': $db->query("SET NAMES 'UNICODE'"); break; case 'PDO_MYSQL': $db->query("SET NAMES 'utf8'"); break; default: break; } #start up the profiler if needed if ($config->setup->database->profiler == true) { $db->getProfiler()->setEnabled($config->setup->database->profiler); } Zend_Db_Table::setDefaultAdapter($db); #TODO database driven sessions - maybe we want to change that in future ? for better scaling ? Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable(array('name' => 'session', 'primary' => 'id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime'))); //set up the view $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->init(); $view = $viewRenderer->view; $view->addHelperPath('Reactor/View/Helper', 'Reactor_View_Helper'); Zend_Dojo::enableView($view); $view->doctype('XHTML1_STRICT'); $view->setEncoding('UTF-8'); $view->request = $this->getRequest(); $view->baseUrl = $this->getRequest()->getBaseUrl(); $this->locale = new Zend_Locale($config->setup->defaultLocale); Zend_Registry::set('Zend_Locale', $this->locale); Zend_Translate::setCache(Zend_Registry::get('cache')); #TODO currently hardcoded Zend_Registry::set('Zend_Translate', new Zend_Translate('gettext', '../data/locales/en_GB/LC_MESSAGES/default.mo', 'en')); Zend_Registry::set('Users', new Users()); }
public function testEnableViewShouldSetAppropriateViewHelperPaths() { $view = new Zend_View(); Zend_Dojo::enableView($view); $helperLoader = $view->getPluginLoader('helper'); $paths = $helperLoader->getPaths('Zend_Dojo_View_Helper'); $this->assertTrue(is_array($paths)); }
public function getView() { require_once 'Zend/View.php'; $view = new Zend_View(); Zend_Dojo::enableView($view); return $view; }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @return void */ public function setUp() { $this->view = new Zend_View(); Zend_Dojo::enableView($this->view); }
protected function _initDoctype() { $this->bootstrap('view'); $view = $this->getResource('view'); $view->doctype('XHTML1_STRICT'); $view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); $view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper'); Zend_Dojo::enableView($view); $view->dojo()->setDjConfigOption('usePlainJson', true)->setDjConfigOption('parseOnLoad', true)->setDjConfigOption('parseWidgets', true)->addStylesheetModule('dijit.themes.tundra')->setLocalPath('/js/dojo/dojo.js')->disable(); include APPLICATION_PATH . "/../library/globals.php"; ini_set('display_errors', 'off'); ini_set('log_error', 'on'); }
public function _initView() { $view = new Zend_View(); Zend_Dojo::enableView($view); Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setView($view); }
public function getView() { $view = new Zend_View(); Zend_Dojo::enableView($view); return $view; }
/** * Initialize view * * @return void */ public function initView() { // Bootstrap layouts $layout = Zend_Layout::startMvc(array('layoutPath' => $this->_root . '/application/default/layouts', 'layout' => 'main')); $view = $layout->getView()->addHelperPath('ZForge/View/Helper/', 'ZForge_View_Helper')->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper'); Zend_Dojo::enableView($view); }
/** * Initialize view and layouts * * @param bool $doLayout * @return My_Plugin_Initialize */ public function initView($doLayout = true) { $view = new Zend_View(); $view->addHelperPath('My/View/Helper/', 'My_View_Helper'); $view->addHelperPath(APPLICATION_PATH . '/views/helpers', 'Zend_View_Helper'); $view->addHelperPath(APPLICATION_PATH . '/modules/spindle/views/helpers', 'Spindle_View_Helper'); Zend_Dojo::enableView($view); Zend_Dojo_View_Helper_Dojo::setUseDeclarative(true); $view->baseUrl = rtrim($this->getRequest()->getBaseUrl(), '/'); $view->doctype('XHTML1_STRICT'); $view->headTitle()->setSeparator(' - ')->append('Spindle'); $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8'); $view->dojo()->setDjConfigOption('isDebug', $this->config->view->dojo->isDebug)->setLocalPath('/js/dojo/dojo.js')->registerModulePath('../spindle', 'spindle')->addStylesheetModule('spindle.themes.spindle')->requireModule('spindle.main')->disable(); Zend_Registry::set('view', $view); if ($doLayout) { $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer'); $viewRenderer->setView($view); $layout = Zend_Layout::startMvc(array('layoutPath' => $this->config->appPath . '/layouts/scripts')); } return $this; }
<?php // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/../library'), get_include_path()))); // include model folder set_include_path(implode(PATH_SEPARATOR, array(realpath(APPLICATION_PATH . '/models'), realpath(APPLICATION_PATH . '/models/Bc'), get_include_path()))); ini_set('error_log', APPLICATION_PATH . '/../log/php.log'); error_reporting(E_ALL | E_STRICT); ini_set('log_errors', 1); /** Zend_Application */ require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); // load custom view, save it into registry $customView = new Zend_View(); // bootstrap layouts Zend_Layout::startMvc(array('layoutPath' => '../application/layouts', 'layout' => 'main'))->setView($customView); // prepare for Dojo, this actually only adds a helper path for Dojo related helpers to our view Zend_Dojo::enableView($customView); //register our custom view renderer $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer(); $viewRenderer->setView($customView)->setViewSuffix('phtml'); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); $application->bootstrap()->run();
/** * Initialize view and layouts * * @return My_Plugin_Initialize */ public function initView() { $layout = Zend_Layout::startMvc(array('layoutPath' => $this->config->appPath . '/layouts/scripts')); $view = $layout->getView(); $view->addHelperPath('My/View/Helper/', 'My_View_Helper'); Zend_Dojo::enableView($view); $view->doctype('XHTML1_STRICT'); $view->headTitle('Pastebin'); $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8'); $view->dojo()->setDjConfigOption('preventBackButtonFix', false)->setDjConfigOption('isDebug', $this->config->view->dojo->isDebug)->setLocalPath('/js/dojo/dojo.js')->addLayer('/js/paste/layer.js')->registerModulePath('../paste', 'paste')->addStylesheetModule('paste.styles')->disable(); return $this; }
protected function _setupViews() { $view = Zend_Layout::getMvcInstance()->getView(); Zend_Dojo::enableView($view); return $this; }
public function init() { Zend_Dojo::enableView($this->view); }