当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Registry::get方法代码示例

本文整理汇总了PHP中Zend_Registry::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Registry::get方法的具体用法?PHP Zend_Registry::get怎么用?PHP Zend_Registry::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Registry的用法示例。


在下文中一共展示了Zend_Registry::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkSkinStyles

 /**
  *
  */
 public function checkSkinStyles($name, $values)
 {
     $config = Zend_Registry::get('config');
     $basePath = $config->design->pathToSkins;
     $xhtml = array();
     $this->view->name = $name;
     $this->view->selectedStyles = $values;
     //load the skin folders
     if (is_dir('./' . $basePath)) {
         $folders = Digitalus_Filesystem_Dir::getDirectories('./' . $basePath);
         if (count($folders) > 0) {
             foreach ($folders as $folder) {
                 $this->view->skin = $folder;
                 $styles = Digitalus_Filesystem_File::getFilesByType('./' . $basePath . '/' . $folder . '/styles', 'css');
                 if (is_array($styles)) {
                     foreach ($styles as $style) {
                         //add each style sheet to the hash
                         // key = path / value = filename
                         $hashStyles[$style] = $style;
                     }
                     $this->view->styles = $hashStyles;
                     $xhtml[] = $this->view->render($this->partialFile);
                     unset($hashStyles);
                 }
             }
         }
     } else {
         throw new Zend_Acl_Exception('Unable to locate skin folder');
     }
     return implode(null, $xhtml);
 }
开发者ID:ngukho,项目名称:ducbui-cms,代码行数:34,代码来源:CheckSkinStyles.php

示例2: init

 public function init()
 {
     $view = Zend_Registry::get('Zend_View');
     $this->setTitle('Delete Sub Library');
     $this->setAttrib('class', 'global_form_popup');
     $this->setDescription('Are you sure that you want to delete this library? It will not be recoverable after being deleted.');
     //get table
     $mappingTable = Engine_Api::_()->getDbTable('mappings', 'user');
     //get videos mapping of library
     $params = array();
     $params['owner_type'] = $this->_library->getType();
     $params['owner_id'] = $this->_library->getIdentity();
     $videoMappings = $mappingTable->getItemsMapping('video', $params);
     if (count($this->_subs) && count($videoMappings)) {
         //get main Library
         $viewer = Engine_Api::_()->user()->getViewer();
         $mainLibrary = $viewer->getMainLibrary();
         $arrValue = array();
         $arrValue[0] = $view->translate('None');
         $arrValue[$mainLibrary->getIdentity()] = $view->translate($mainLibrary->getTitle());
         foreach ($this->_subs as $sub) {
             if ($sub->isSelf($this->_library)) {
                 continue;
             }
             $arrValue[$sub->getIdentity()] = $view->translate($sub->getTitle());
         }
         $this->addElement('Select', 'move_to', array('label' => 'Move to Library?', 'description' => 'If you delete this library, all existing content will be moved to another one.', 'multiOptions' => $arrValue));
     }
     $this->addElement('Button', 'submit_button', array('value' => 'submit_button', 'label' => 'Delete', 'onclick' => 'removeSubmit()', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
     $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
     $this->addDisplayGroup(array('submit_button', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:32,代码来源:Delete.php

示例3: validateUri

 /**
  * Callback to check extra-parameters.
  *
  * @internal The availability will be ckecked just before import.
  *
  * @param string $value The value to check.
  * @return boolean
  */
 public static function validateUri($uri)
 {
     if (empty($uri)) {
         return false;
     }
     $scheme = parse_url($uri, PHP_URL_SCHEME);
     // The check is done via the server for external urls.
     if (in_array($scheme, array('http', 'https', 'ftp', 'sftp'))) {
         return Zend_Uri::check($uri);
     }
     // Unknown or unmanaged scheme.
     if ($scheme != 'file' && $uri[0] != '/') {
         return false;
     }
     // Check the security setting.
     $settings = Zend_Registry::get('archive_folder');
     if ($settings->local_folders->allow != '1') {
         return false;
     }
     // Check the base path.
     $basepath = $settings->local_folders->base_path;
     $realpath = realpath($basepath);
     if ($basepath !== $realpath || strlen($realpath) <= 2) {
         return false;
     }
     // Check the uri.
     if ($settings->local_folders->check_realpath == '1') {
         if (strpos(realpath($uri), $realpath) !== 0 || !in_array(substr($uri, strlen($realpath), 1), array('', '/'))) {
             return false;
         }
     }
     // The uri is allowed.
     return true;
 }
开发者ID:Daniel-KM,项目名称:ArchiveFolder,代码行数:42,代码来源:Validator.php

示例4: __construct

 public function __construct($messageId = null)
 {
     $container = \Zend_Registry::get('container');
     $repository = $container->getService('em')->getRepository('Newscoop\\Entity\\Comment');
     if (is_null($messageId)) {
         $this->m_dbObject = $repository->getPrototype();
     } else {
         $this->m_dbObject = $repository->find($messageId);
     }
     $this->m_properties = self::$m_baseProperties;
     $this->m_customProperties['level'] = 'getThreadDepth';
     $this->m_customProperties['identifier'] = 'getId';
     $this->m_customProperties['subject'] = 'getSubject';
     $this->m_customProperties['content'] = 'getMessage';
     $this->m_customProperties['content_real'] = 'getMessage';
     $this->m_customProperties['nickname'] = 'getCommenter';
     $this->m_customProperties['reader_email'] = 'getEmail';
     $this->m_customProperties['real_name'] = 'getRealName';
     $this->m_customProperties['anonymous_author'] = 'isAuthorAnonymous';
     $this->m_customProperties['submit_date'] = 'getSubmitDate';
     $this->m_customProperties['article'] = 'getArticle';
     $this->m_customProperties['defined'] = 'defined';
     $this->m_customProperties['user'] = 'getUser';
     $this->m_customProperties['source'] = 'getSource';
     $this->m_customProperties['parent'] = 'getParent';
     $this->m_customProperties['has_parent'] = 'hasParent';
     $this->m_customProperties['thread_level'] = 'threadLevel';
     $this->m_customProperties['status'] = 'getStatus';
     $this->m_skipFilter = array('content_real');
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:30,代码来源:MetaComment.php

示例5: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $auth = Zend_Auth::getInstance();
     $isAllowed = false;
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     // Generate the resource name
     $resourceName = $controller . '/' . $action;
     // Don't block errors
     if ($resourceName == 'error/error') {
         return;
     }
     $resources = $this->acl->getResources();
     if (!in_array($resourceName, $resources)) {
         $request->setControllerName('error')->setActionName('error')->setDispatched(true);
         throw new Zend_Controller_Action_Exception('This page does not exist', 404);
         return;
     }
     // Check if user can access this resource or not
     $isAllowed = $this->acl->isAllowed(Zend_Registry::get('role'), $resourceName);
     // Forward user to access denied or login page if this is guest
     if (!$isAllowed) {
         if (!Zend_Auth::getInstance()->hasIdentity()) {
             $forwardAction = 'login';
         } else {
             $forwardAction = 'deny';
         }
         $request->setControllerName('index')->setActionName($forwardAction)->setDispatched(true);
     }
 }
开发者ID:georgepaul,项目名称:socialstrap,代码行数:30,代码来源:AccessCheck.php

示例6: getLogger

 public function getLogger()
 {
     if (is_null($this->_logger)) {
         $this->_logger = Zend_Registry::get('Zend_Log');
     }
     return $this->_logger;
 }
开发者ID:alexukua,项目名称:opus4,代码行数:7,代码来源:DefaultAccess.php

示例7: init

 public function init($styles = array())
 {
     // Init messages
     $this->view->message = array();
     $this->view->infoMessage = array();
     $this->view->errorMessage = array();
     $this->messenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->messenger->setNamespace('messages');
     $this->_helper->addHelper($this->messenger);
     $this->errorMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->errorMessenger->setNamespace('errorMessages');
     $this->_helper->addHelper($this->errorMessenger);
     $this->infoMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
     $this->infoMessenger->setNamespace('infoMessages');
     $this->_helper->addHelper($this->infoMessenger);
     // Setup breadcrumbs
     $this->view->breadcrumbs = $this->buildBreadcrumbs($this->getRequest()->getRequestUri());
     $this->view->user = Zend_Auth::getInstance()->getIdentity();
     // Set the menu active element
     $uri = $this->getRequest()->getPathInfo();
     if (strrpos($uri, '/') === strlen($uri) - 1) {
         $uri = substr($uri, 0, -1);
     }
     if (!is_null($this->view->navigation()->findByUri($uri))) {
         $this->view->navigation()->findByUri($uri)->active = true;
     }
     $this->view->styleSheets = array_merge(array('css/styles.css'), $styles);
     $translate = Zend_Registry::get('tr');
     $this->view->tr = $translate;
     $this->view->setEscape(array('Lupin_Security', 'escape'));
 }
开发者ID:crlang44,项目名称:frapi,代码行数:31,代码来源:Base.php

示例8: init

 public function init()
 {
     $this->setMethod('post');
     // Set Decorators
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'dl', 'class' => 'form')), 'Form'));
     // Add Elements
     $this->addElement('text', 'name', array('label' => 'Your name', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(3)), array('Regex', false, array('/^\\pL[\\pL\\pN]*(?:[ .\\-_\']\\pL[\\pL\\pN]*)*$/uD'))), 'description' => 'Please enter your name - this will be displayed next to your comment'));
     $this->addElement('text', 'email', array('label' => 'Your Email', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('emailaddress')), 'description' => 'Your Email will not be shared with anyone or displayed to other users'));
     $this->addElement('textarea', 'comment', array('label' => 'Comment', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(10))), 'rows' => 12));
     $captchaConfig = Zend_Registry::get('config')->captcha;
     if ($captchaConfig) {
         $captchaOptions = $captchaConfig->options->toArray();
         if ($captchaConfig->type == 'recaptcha') {
             $reCaptcha = new Zend_Service_ReCaptcha($captchaConfig->service->publickey, $captchaConfig->service->privatekey);
             $captchaOptions['service'] = $reCaptcha;
         }
         $this->addElement('captcha', 'challenge', array('captcha' => $captchaConfig->type, 'captchaOptions' => $captchaOptions, 'label' => 'Are you human?', 'description' => 'Please verify that you are a real person by typing in the two words above'));
     }
     //        $book = new Zend_Form_Element('hidden', 'book');
     //        $book->clearDecorators();
     //        $this->addElement($book);
     //
     //        $page = new Zend_Form_Element('hidden', 'page');
     //        $page->clearDecorators();
     //        $this->addElement($page);
     $this->addElement('submit', 'submit', array('label' => 'Send Comment'));
 }
开发者ID:shevron,项目名称:HumanHelp,代码行数:27,代码来源:Comment.php

示例9: init

 public function init()
 {
     $languageFile = Zend_Registry::get('languageFile');
     $translate = new Zend_Translate('array', $languageFile, 'zh_CN');
     $this->setTranslator($translate);
     $this->setMethod('POST');
     $this->setName('contactForm');
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('怎么称呼您');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('email');
     $element->setLabel('您的Email');
     //$element->setRequired(true);
     $this->addElement($element);
     $element = new Elements();
     $element->addReCaptcha($this);
     $this->addDisplayGroup(array('name', 'email', 'captcha'), 'leftSection');
     $this->getDisplayGroup('leftSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Textarea('body');
     $element->setLabel('想要开通城市地区和找房贴士,关于您的简单介绍');
     $element->addPrefixPath('My_Validator', 'My/Validator/', 'validate');
     $element->addValidator('FormValueNotNull', true);
     //$element->setRequired(true);
     $element->setAttrib('rows', 13);
     $this->addElement($element);
     $this->addDisplayGroup(array('body'), 'rightSection');
     $this->getDisplayGroup('rightSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Submit('post');
     $element->removeDecorator('Label');
     $this->addElement($element);
 }
开发者ID:BGCX262,项目名称:zufangzi-svn-to-git,代码行数:31,代码来源:AddNewCity.php

示例10: init

 public function init()
 {
     $em = EntityManager::getInstance();
     $element = $this->createElement("text", "street");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Ulica")->setValue($this->getModel()->street);
     $this->addElement($element);
     $element = $this->createElement("text", "house_number");
     $element->setRequired()->addFilter(new Zend_Filter_StringTrim())->setLabel("Nr domu")->setValue($this->getModel()->houseNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "flat_number");
     $element->addFilter(new Zend_Filter_StringTrim())->setLabel("Nr mieszkania")->setValue($this->getModel()->flatNumber);
     $this->addElement($element);
     $element = $this->createElement("text", "city");
     $element->setRequired()->addValidator(new Zend_Validate_StringLength(array("max" => 255)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Miasto")->setValue($this->getModel()->city);
     $this->addElement($element);
     $element = $this->createElement("text", "postcode");
     $element->setRequired()->addValidator(new Zend_Validate_PostCode(Zend_Registry::get(\Application\Registry\Registry::LOCALE)))->addFilter(new Zend_Filter_StringTrim())->setLabel("Kod pocztowy")->setValue($this->getModel()->postcode);
     $this->addElement($element);
     $states = $em->findAll("State");
     $element = $this->createElement("select", "state");
     $element->setRequired()->addValidator(new Zend_Validate_Int())->addFilter(new Zend_Filter_Null())->setLabel("Województwo")->setValue($this->getModel()->state->getIdentifier())->setMultiOptions($this->getMultiOptions($states, "name"));
     $this->addElement($element);
     $element = $this->createElement("select", "address_type");
     $element->setRequired()->setMultiOptions(array(\Model\EmployeeAddress::BILLING_ADDRESS => "do płatności", \Model\EmployeeAddress::SHIPPING_ADDRESS => "do wysyłki"))->setLabel("Typ adresu")->setValue($this->getModel()->type);
     $this->addElement($element);
 }
开发者ID:sp1ke77,项目名称:MLM-1,代码行数:26,代码来源:Address.php

示例11: indexAction

 /**
  * List of subscriptions
  */
 public function indexAction()
 {
     $subscriptionPlansTable = new Subscriptions_Model_SubscriptionPlans_Table();
     $this->view->subscriptionPlan = $subscriptionPlansTable->fetchAll();
     //Get user
     $identity = Zend_Auth::getInstance()->getIdentity();
     if ($identity) {
         $userId = $identity->id;
         //Get current subscription
         $subscriptionManager = new Subscriptions_Model_Subscription_Manager();
         $currentSubscription = $subscriptionManager->getCurrentSubscription($userId);
         if ($currentSubscription) {
             $subscriptionPlansTable = new Subscriptions_Model_SubscriptionPlans_Table();
             $currentSubscriptionPlan = $subscriptionPlansTable->getById($currentSubscription->subscriptionPlanId);
             $paypalHost = false;
             if (Zend_Registry::isRegistered('payments')) {
                 $payments = Zend_Registry::get('payments');
                 if (isset($payments['gateways']) && $payments['gateways'] && isset($payments['gateways']['paypal']) && $payments['gateways']['paypal']) {
                     $paypalHost = $payments['gateways']['paypal']['paypalHost'];
                 }
             }
             if (!$paypalHost) {
                 if (Zend_Registry::isRegistered('Log')) {
                     $log = Zend_Registry::get('Log');
                     $log->log("PayPal is not configured.", Zend_Log::CRIT);
                 }
                 throw new Exception($this->__("Paypal is not configured."));
             }
             $this->view->paypalHost = $paypalHost;
             $this->view->currentSubscription = $currentSubscription;
             $this->view->currentSubscriptionPlan = $currentSubscriptionPlan;
         }
     }
 }
开发者ID:shahmaulik,项目名称:zfcore,代码行数:37,代码来源:IndexController.php

示例12: send

 public function send($encodedJob, array $metadata)
 {
     $job = Zend_Registry::get('job_factory')->from($encodedJob);
     $job->perform();
     // Return the job for test purposes.
     return $job;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:7,代码来源:Synchronous.php

示例13: init

 public function init()
 {
     $bootstrap = $this->getBootstrap();
     $bootstrap->bootstrap('FrontController');
     $bootstrap->bootstrap('View');
     $bootstrap->bootstrap('Layout');
     $front = $bootstrap->getResource('FronController');
     Zend_Controller_Action_HelperBroker::addPrefix('Bc_Controller_Action_Helper');
     $bootstrap->bootstrap('Doctrine');
     $manager = Zend_Registry::get('db_manager');
     $options = $this->getOptions();
     if (!isset($options[self::OPTION_PLUGINS_PATH])) {
         throw new Exception('Bad Config! pluginsPath shoud be setted');
     }
     $pluginManager = Bc_Application_Plugin_Manager::getInstance();
     $pluginManager->setPluginsPath($options[self::OPTION_PLUGINS_PATH]);
     $pluginManager->initializePlugins();
     if (!isset($options[self::OPTION_THEMES_PATH])) {
         throw new Exception('Bad Config! themesPath shoud be setted');
     }
     $themesManager = Bc_Application_Theme_Manager::getInstance();
     $themesManager->setThemesPath($options[self::OPTION_THEMES_PATH]);
     $themesManager->setView($bootstrap->getResource('View'));
     $themesManager->setActiveThemeName('minimal');
     $themesManager->setLayout($bootstrap->getResource('Layout'));
     $themesManager->initializeTheme();
 }
开发者ID:BGCX262,项目名称:zsoc-svn-to-git,代码行数:27,代码来源:Plugin.php

示例14: check

 function check($user, $passwd)
 {
     $db = Zend_Registry::get('connectDb');
     $select = $db->select()->from(array('ue' => 'user'), array('id', 'user_name'))->where('ue.user_name = ?', $user)->where('ue.password  = ?', $passwd)->where('ue.activi = ?', 1);
     $result = $db->fetchAll($select);
     return $result;
 }
开发者ID:BGCX261,项目名称:zkiwi-svn-to-git,代码行数:7,代码来源:checkuser.php

示例15: init

 /** Set up the ACL and contexts
  * @access public
  * @return void
  */
 public function init()
 {
     $this->_helper->_acl->allow('public', array('forgotten', 'register', 'activate', 'index', 'logout', 'edit', 'forgotusername', 'success', 'resetpassword'));
     $this->_helper->_acl->allow('member', null);
     $this->_auth = Zend_Registry::get('auth');
     $this->_users = new Users();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:11,代码来源:AccountController.php


注:本文中的Zend_Registry::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。