本文整理汇总了PHP中Zend_Controller_Action_HelperBroker::addHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_HelperBroker::addHelper方法的具体用法?PHP Zend_Controller_Action_HelperBroker::addHelper怎么用?PHP Zend_Controller_Action_HelperBroker::addHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action_HelperBroker
的用法示例。
在下文中一共展示了Zend_Controller_Action_HelperBroker::addHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @see Zend_Application_Resource_View::init
*/
public function init()
{
$view = $this->getView();
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view, $this->getOptions());
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $view;
}
示例2: setupView
/**
* Configures view class
*
*/
protected function setupView()
{
if (Zend_Registry::isRegistered('config')) {
$config = Zend_Registry::get('config');
$renderClass = $config->output->viewrenderer;
$viewRenderer = new $renderClass();
$viewClass = $config->output->view->name;
$viewRenderer->setView(new $viewClass($config->output->view->options->toArray()));
} else {
// Config file not detected, use defaults
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView(new Zoo_View_Php());
}
$viewRenderer->setViewSuffix('phtml');
//make it search for .phtml files
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
//add it to the action helper broker
// Set the encoding
$viewRenderer->view->setEncoding("UTF-8");
$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype('XHTML1_STRICT');
// Add core module's view helper path
$viewRenderer->view->addHelperPath(ZfApplication::$_base_path . "/app/Zoo/views/helpers");
// Add JQuery support
$viewRenderer->view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
$viewRenderer->view->jQuery()->setVersion('1.5')->setUIVersion('1.8')->addStylesheet('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css');
}
示例3: setUp
public function setUp()
{
// Make sure only our fake Helper is available
Zend_Controller_Action_HelperBroker::resetHelpers();
Zend_Controller_Action_HelperBroker::addHelper(new Waf_Zend_Controller_ActionTest_TestHelper());
$this->controller = new Waf_Zend_Controller_Action($this->getMock('Zend_Controller_Request_Abstract'), $this->getMock('Zend_Controller_Response_Abstract'));
}
示例4: _initView
protected function _initView()
{
$theme = 'default';
$templatePath = APPLICATION_PATH . '/../public/themes/' . $theme . '/templates';
Zend_Registry::set('user_date_format', 'm-d-Y');
Zend_Registry::set('calendar_date_format', 'mm-dd-yy');
Zend_Registry::set('db_date_format', 'Y-m-d');
Zend_Registry::set('perpage', 10);
Zend_Registry::set('menu', 'home');
Zend_Registry::set('eventid', '');
$dir_name = $_SERVER['DOCUMENT_ROOT'] . rtrim(str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']), '/');
Zend_Registry::set('acess_file_path', $dir_name . SEPARATOR . "application" . SEPARATOR . "modules" . SEPARATOR . "default" . SEPARATOR . "plugins" . SEPARATOR . "AccessControl.php");
Zend_Registry::set('siteconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "site_constants.php");
Zend_Registry::set('emailconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "email_constants.php");
Zend_Registry::set('emptab_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "emptabconfigure.php");
Zend_Registry::set('emailconfig_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "mail_settings_constants.php");
Zend_Registry::set('application_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "application_constants.php");
$date = new Zend_Date();
Zend_Registry::set('currentdate', $date->get('yyyy-MM-dd HH:mm:ss'));
Zend_Registry::set('currenttime', $date->get('HH:mm:ss'));
Zend_Registry::set('logo_url', '/public/images/landing_header.jpg');
$view = new Zend_View();
$view->setEscape('stripslashes');
$view->setBasePath($templatePath);
$view->setScriptPath(APPLICATION_PATH);
$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $this;
}
示例5: mailAction
/**
* Send email to all reviewers
*
* @return void
*/
public function mailAction()
{
$request = $this->getRequest();
$this->view->reminder = $reminder = $request->getParam('reminder');
if (false == ($reviewers = $this->_reviewModel->getReviewersForMail($reminder))) {
return;
}
$this->view->reviewers = count($reviewers);
$this->view->dummy = $request->getParam('dummy');
if (!$request->isPost()) {
$this->view->mailForm = $this->_reviewModel->getForm('reviewMail');
if ($reminder) {
$this->view->mailForm->setAction('/core/review/mail/reminder/1');
}
return $this->render();
}
$conference = Zend_Registry::get('conference');
Zend_Controller_Action_HelperBroker::addHelper(new TA_Controller_Action_Helper_SendEmail());
$emailHelper = $this->_helper->sendEmail;
$this->view->sent = array();
$template = $reminder ? 'review/massmail-reminder' : 'review/massmail';
foreach ($reviewers as $review) {
$emailHelper->sendEmail(array('dummy' => $request->getParam('dummy'), 'template' => $template, 'html' => true, 'subject' => $conference['abbreviation'] . ' Review', 'to_email' => $review['email'], 'to_name' => $review['fname'] . ' ' . $review['lname']), $review);
$this->view->sent[] = array('email' => $review['email']);
}
if ($this->view->dummy == 0) {
$eventlogModel = new Core_Model_Eventlog();
$eventlogModel->saveEventlog(array('event_type' => $reminder ? 'mail_reviewers-reminder' : 'mail_reviewers', 'timestamp' => 'now()'));
}
}
示例6: _initViewHelpers
protected function _initViewHelpers()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->addHelperPath('Base/View/Helper/', 'Base_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
ZendX_JQuery::enableView($view);
/*------ default blocks in the region right ---*/
/*$blockM=new Base_View_Block();
$path="/layouts/scripts/page/blocks/journal";
$blocks=array("name"=>"search-destination", "order"=>"10", "path"=>$path);
$blockM->addBlock($blocks, 'journal');
$blocks=array("name"=>"right-banner", "order"=>"9", "path"=>$path);
$blockM->addBlock($blocks, 'journal');
$blocks=array("name"=>"recent-blog", "order"=>"8", "path"=>$path);
$blockM->addBlock($blocks, 'journal');
$blocks=array("name"=>"journal-categories", "order"=>"7", "path"=>$path);
$blockM->addBlock($blocks, 'journal');
$blocks=array("name"=>"tag-cloud", "order"=>"6", "path"=>$path);
$blockM->addBlock($blocks, 'journal');*/
/*------ default blocks in the region right ---*/
}
示例7: _initActionHelpers
protected function _initActionHelpers()
{
Zend_Controller_Action_HelperBroker::addPrefix('Queroeventos_Controller_Action_Helper_');
$acl = new Queroeventos_Acl();
$aclHelper = new Queroeventos_Controller_Action_Helper_Acl(null, array('acl' => $acl));
Zend_Controller_Action_HelperBroker::addHelper($aclHelper);
}
示例8: _initView
protected function _initView()
{
// Start initail view
$this->bootstrap('layout');
$config = $this->getOption('views');
$resources = $this->getOption('resources');
$view = new Zend_View();
if (isset($resources['layout']['layoutPath'])) {
$view->assign('layoutRootPath', $resources['layout']['layoutPath']);
}
$this->bootstrap('db');
Zend_Loader::loadClass('Ht_Utils_SystemSetting');
$sysSetting = Ht_Utils_SystemSetting::getSettings();
$view->assign('sysSetting', $sysSetting);
$view->assign('profile', Zend_Auth::getInstance()->getIdentity());
Zend_Loader::loadClass("Ht_Model_SystemSetting");
$this->setSystemLogConfiguration($sysSetting);
// use the viewrenderer to keep the code DRY
// instantiate and add the helper in one go
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
$viewRenderer->setViewSuffix('phtml');
// add it to the action helper broker
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
/**
* Set inflector for Zend_Layout
*/
$inflector = new Zend_Filter_Inflector(':script.:suffix');
$inflector->addRules(array(':script' => array('Word_CamelCaseToDash', 'StringToLower'), 'suffix' => 'phtml'));
// Initialise Zend_Layout's MVC helpers
$this->getResource('layout')->setLayoutPath(realpath($resources['layout']['layoutPath']))->setView($view)->setContentKey('content')->setInflector($inflector);
return $this->getResource('layout')->getView();
}
示例9: _initView
protected function _initView()
{
$view = new Zend_View();
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
示例10: _initHelper
/**
* Initialize Init Helper and Layout Plugin
*/
protected function _initHelper()
{
$initHelper = new App_Controller_Plugin_Helper_Init();
Zend_Controller_Action_HelperBroker::addHelper($initHelper);
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers');
//$front = Zend_Controller_Front::getInstance();
//$front->registerPlugin(new App_Controller_Plugin_SelectLayout());
}
示例11: _initAclHelper
protected function _initAclHelper()
{
$configuration = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
$registry = Zend_Registry::getInstance();
$registry->configuration = $configuration;
$acl = new App_Acl();
$layout = Zend_Controller_Action_HelperBroker::addHelper(new App_Controller_Action_Helper_Acl(null, array('acl' => $acl)));
}
示例12: init
/**
* Initialize this resource
*
* @return Zend_View
*/
public function init()
{
$view = $this->getView();
$viewRenderer = new Firal_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $view;
}
示例13: init
public function init()
{
$view = $this->getView();
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $view;
}
示例14: _initView
protected function _initView()
{
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
示例15: init
/**
* Defined by Zend_Application_Resource_Resource
*
* @return AM_Controller_Action_Helper_Smarty
*/
public function init()
{
$this->getBootstrap()->bootstrap('frontcontroller');
if (is_null($this->_oActionHelper)) {
$this->_oActionHelper = new AM_Controller_Action_Helper_Smarty($this->getOptions());
Zend_Controller_Action_HelperBroker::addHelper($this->_oActionHelper);
}
return $this->_oActionHelper;
}