本文整理汇总了PHP中Zend_Controller_Action::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action::init方法的具体用法?PHP Zend_Controller_Action::init怎么用?PHP Zend_Controller_Action::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action
的用法示例。
在下文中一共展示了Zend_Controller_Action::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$data = $this->getRequestJson();
if (!$data) {
$data = $this->getRequest();
}
if (array_key_exists('session_uuid', $data)) {
if (!Zend_Session::isStarted()) {
Glo_Auth_Storage_Session::setId($data['session_uuid']);
$storage = new Glo_Auth_Storage_Session('Glo_Auth');
$sessoinData = $storage->read();
if (!is_object($sessoinData) || !isset($data['user_uuid']) || $sessoinData->user_uuid != $data['user_uuid']) {
throw new Glo_Exception_InvalidSession('Your session is invalid.');
}
}
}
/* $this->loggedInUser = App_Model_User::getLoggedIn(); */
return parent::init();
/*
// load the logged in user if there is one
$this->view->loggedInUser = User::getLoggedIn();
// set the translate adapter
$this->registerTranslator();
*/
}
示例2: init
public function init()
{
parent::init();
$this->_model = array('time' => new Application_Model_Time(), 'jogo' => new Application_Model_Jogo(), 'apostador' => new Application_Model_Aposta(), 'resultado' => new Application_Model_Resultado(), 'detalhe_aposta' => new Application_Model_DetalheAposta());
#$this->_helper->viewRenderer->setNoRender(true);
$this->_helper->layout->disableLayout();
}
示例3: init
/**
* (non-PHPdoc)
* @see Zend_Controller_Action::init()
*/
public function init()
{
parent::init();
$this->_bootstrap = $this->getInvokeArg('bootstrap');
$accessToken = $this->_request->getParam('access_token', $this->_request->getHeader('OAuth-AccessToken'));
$memcache = $this->_bootstrap->getResource('memcache');
Tudu_User::setMemcache($memcache);
$this->_user = Tudu_User::getInstance();
// 提供访问令牌
if (!empty($accessToken)) {
$storage = new TuduX_OAuth_Storage_Session();
$storage->setMemcache($memcache);
$oauth = new OpenApi_OAuth_OAuth(array(OpenApi_OAuth_OAuth::STORAGE => $storage));
$scope = $this->_request->getParam('client_id', $this->_request->getHeader('OAuth-Scope'));
try {
$token = $oauth->verifyAccessToken($accessToken, $scope);
$this->_user->init($token['auth']);
// 用户被禁用或已被退出登录
if (!$this->_user->isLogined()) {
$oauth->destroyAccessToken($accessToken);
throw new OpenApi_OAuth_Exception("Invalid access token provided", OpenApi_OAuth_OAuth::ERROR_INVALID_ACCESSTOKEN);
}
// ts服务器
$tsServer = 'ts' . $this->_user->tsId;
Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_TS => $this->_bootstrap->multidb->getDb($tsServer)));
$this->_clientId = $token[OpenApi_OAuth_OAuth::PARAM_CLIENT_ID];
$this->_accessToken = $accessToken;
$this->_token = $token;
// 验证失败
} catch (OpenApi_OAuth_Exception $e) {
throw $e;
}
}
}
示例4: init
public function init()
{
parent::init();
$config_options = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOptions();
$moduleName = $this->getRequest()->getModuleName();
$controllerName = $this->getRequest()->getControllerName();
$controllerType = $this->controllerType;
$themeName = $config_options['awe']['theme'][$this->controllerType];
$namespace = substr($controllerName, 0, strpos('_', $controllerName));
$templatesFolder = APPLICATION_PATH . '/templates';
$paths = array();
// first check admin theme
// then check admin default
// then frontend theme
// then frontend default
$paths[] = "/frontend/default/views/scripts/{$moduleName}";
if ($themeName != 'default') {
$paths[] = "/frontend/{$themeName}/views/scripts/{$moduleName}";
}
$skinPath = "/skin/frontend/{$themeName}";
if ($moduleName == 'admin') {
$paths[] = "/admin/default/views/scripts";
if ($themeName != 'default') {
$paths[] = "/admin/{$themeName}/views/scripts";
}
$skinPath = "/skin/admin/{$themeName}";
}
$this->pView = new Zend_View();
$this->pView->addScriptPath($templatesFolder . "/frontend/{$themeName}/layouts/widgets");
\Zend_Registry::set('awe_theme_skinPath', $skinPath);
foreach ($paths as $path) {
$fullPath = $templatesFolder . $path;
$this->view->addScriptPath($fullPath);
}
}
示例5: init
public function init()
{
parent::init();
$this->_flashMessenger = new Core_Controller_Action_Helper_FlashMessengerCustom();
$this->_config = $this->getConfig();
$this->_layout = Zend_Layout::getMvcInstance();
}
示例6: init
public function init()
{
parent::init();
$session = new Zend_Session_Namespace('userSession');
$this->view->hata = $session->hataMesaji;
$session->hataMesaji = NULL;
}
示例7: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
$this->_dtoManager = new Api_Manager_Dto();
$this->_annotationManager = new Api_Manager_Annotation(new Api_Annotation_Reader_Simple(), new Api_Annotation_Injector_Simple());
$this->_helper->viewRenderer->setNoRender(true);
}
示例8: init
public function init()
{
parent::init();
$helper = new vkNgine_View_Helper_PublicUrl();
$this->view->registerHelper($helper, 'publicUrl');
$helper = new vkNgine_View_Helper_Seo();
$this->view->registerHelper($helper, 'seo');
$helper = new vkNgine_View_Helper_AssetUrl();
$this->view->registerHelper($helper, 'assetUrl');
$helper = new vkNgine_View_Helper_Dateformat();
$this->view->registerHelper($helper, 'dateFormat');
$searchForm = new Public_Model_Form_Search();
$this->view->searchForm = $searchForm;
$view = Zend_Registry::get('view');
$appTitle = Zend_Registry::get('t')->_('GYM Tracker');
$view->headTitle($appTitle, Zend_View_Helper_Placeholder_Container_Abstract::SET);
if (!vkNgine_Auth::isAuthenticated()) {
header("location:/auth/login");
exit;
}
$modelExercises = new Model_Exercises();
$this->view->exercises = $modelExercises;
$user = vkNgine_Public_Auth::revalidate();
$this->view->params = $this->getAllParams();
Zend_Registry::set('user', $user);
$this->view->assign('user', $user);
$this->user = Zend_Registry::get('user');
$this->view->t = Zend_Registry::get('t');
$this->t = Zend_Registry::get('t');
}
示例9: init
public function init()
{
parent::init();
// just good habit (nothing there currently)
// maps to arg 'view' from: $frontController->setParam('view', $view);
$this->_view = $this->getInvokeArg('view');
}
示例10: init
public function init()
{
parent::init();
$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
$this->category = new Application_Model_Category();
$this->rubrique_image = new Application_Model_RubriqueImage();
}
示例11: init
public function init()
{
parent::init();
$this->registry = Zend_Registry::getInstance();
$this->initView();
//cms
$this->view->setScriptPath('./application/views/scripts/');
$this->view->setHelperPath('./application/views/helpers/', 'Helper');
$this->view->addHelperPath('./library/Zcms/View/helper/', 'Zcms_View_Helper');
$this->view->addBasePath('./html/', '');
//Zsurforce
$this->view->addHelperPath('./library/Zsurforce/View/Helper/', 'Zsurforce_View_Helper');
$this->view->baseUrl = $this->_request->getBaseUrl();
$this->view->basePath = $this->registry->get('base_path');
Zend_Loader::loadClass('Configuracion');
$this->view->user = Zend_Auth::getInstance()->getIdentity();
$this->info = $this->registry->get('personalizacion');
$this->view->title = $this->info->sitio->index->index->titulo;
$this->session = $this->registry->get('session');
$this->view->session = $this->session;
$this->debug = $this->registry->get('debug');
$this->view->debug = $this->debug;
/* información de sitios y subsitios */
$this->view->sitios = Sitios::getAll(null, null, "orden")->toArray();
if (isset($this->session->sitio->id)) {
$this->view->configuracion = Configuracion::getConfiguracion($this->session->sitio->id);
} else {
$this->view->configuracion = Configuracion::getConfiguracionDefault();
$this->session->sitio = Sitios::getSitioDefault();
}
$this->registrarSitio();
$this->cargarMenuHorizontal();
$this->_loadBreadcrumItems();
}
示例12: init
public function init()
{
set_time_limit(0);
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNeverRender();
parent::init();
}
示例13: init
public function init()
{
$this->noCache();
parent::init();
$this->_helper->layout->setLayout('layout-servicios');
$this->_flashMessage = new App_Controller_Action_Helper_FlashMessengerCustom();
}
示例14: init
public function init()
{
parent::init();
$this->getResponse()->setHeader("Cache-Control", "no-cache, must-revalidate");
$this->_helper->contextSwitch()->initContext();
$this->_helper->layout->disableLayout();
}
示例15: init
/**
* (non-PHPdoc)
* @see Zend_Controller_Action::init()
*/
public function init()
{
parent::init();
$this->_helper->viewRenderer->setNoRender(true);
$this->_helper->layout()->disableLayout();
$this->_config = Zend_Registry::get('config');
}