• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sfContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setGaufretteService

 public function setGaufretteService(sfContext $context)
 {
     $gaufrette = new sfGaufretteFactory($this->configuration->getConfigCache());
     // to finish, add it to the current context
     $context->set('gaufrette', $gaufrette);
     return $gaufrette;
 }
开发者ID:hbsresearch,项目名称:sfGaufrettePlugin,代码行数:7,代码来源:sfGaufrettePluginConfiguration.class.php


示例2: decomposeURL

 public static function decomposeURL(sfContext $context, sfRequest $request)
 {
     $module = $context->getModuleName();
     $action = $context->getActionName();
     $parameters = $request->getParameterHolder()->getAll();
     return array("module" => $module, "action" => $action, "parameters" => $parameters);
 }
开发者ID:rafd,项目名称:SkuleCourses,代码行数:7,代码来源:skuleadminConst.class.php


示例3: __construct

 public function __construct(sfContext $context, sfEventDispatcher $dispatcher)
 {
     $this->mailer = $context->getMailer();
     $this->dispatcher = $dispatcher;
     $this->serviceContainer = $context->getServiceContainer();
     $this->initialize();
 }
开发者ID:runopencode,项目名称:diem-extended,代码行数:7,代码来源:dmMail.php


示例4: initialize

 /**
  * Initializes this view.
  *
  * @param  sfContext $context     The current application context
  * @param  string    $moduleName  The module name for this view
  * @param  string    $actionName  The action name for this view
  * @param  string    $viewName    The view name
  *
  * @return bool  true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     $this->moduleName = $moduleName;
     $this->actionName = $actionName;
     $this->viewName = $viewName;
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     sfOutputEscaper::markClassesAsSafe(array('sfForm', 'sfModelGeneratorHelper'));
     $this->attributeHolder = $this->initializeAttributeHolder();
     $this->parameterHolder = new sfParameterHolder();
     $this->parameterHolder->add(sfConfig::get('mod_' . strtolower($moduleName) . '_view_param', array()));
     $request = $context->getRequest();
     $format = $request->getRequestFormat();
     if (null !== $format) {
         if ('html' != $format) {
             $this->setExtension('.' . $format . $this->getExtension());
         }
         if ($mimeType = $request->getMimeType($format)) {
             $this->context->getResponse()->setContentType($mimeType);
             if ('html' != $format) {
                 $this->setDecorator(false);
             }
         }
     }
     $this->dispatcher->notify(new sfEvent($this, 'view.configure_format', array('format' => $format, 'response' => $context->getResponse(), 'request' => $context->getRequest())));
     // include view configuration
     $this->configure();
     return true;
 }
开发者ID:bigcalm,项目名称:urlcatcher,代码行数:39,代码来源:sfView.class.php


示例5: initialize

 /**
  * Initializes this view.
  *
  * @param  sfContext $context     The current application context
  * @param  string    $moduleName  The module name for this view
  * @param  string    $actionName  The action name for this view
  * @param  string    $viewName    The view name
  *
  * @return bool  true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $moduleName, $actionName, $viewName)
 {
     $this->moduleName = $moduleName;
     $this->actionName = $actionName;
     $this->viewName = $viewName;
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     if (sfConfig::get('sf_logging_enabled')) {
         $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Initialize view for "%s/%s"', $moduleName, $actionName))));
     }
     sfOutputEscaper::markClassAsSafe('sfForm');
     $this->attributeHolder = $this->initializeAttributeHolder();
     $this->parameterHolder = new sfParameterHolder();
     $this->parameterHolder->add(sfConfig::get('mod_' . strtolower($moduleName) . '_view_param', array()));
     $request = $context->getRequest();
     if (!is_null($format = $request->getRequestFormat())) {
         if ('html' != $format) {
             $this->setExtension('.' . $format . $this->getExtension());
         }
         if ($mimeType = $request->getMimeType($format)) {
             $this->context->getResponse()->setContentType($mimeType);
             $this->setDecorator(false);
         }
         $this->dispatcher->notify(new sfEvent($this, 'view.configure_format', array('format' => $format, 'response' => $context->getResponse(), 'request' => $context->getRequest())));
     }
     // include view configuration
     $this->configure();
     return true;
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:39,代码来源:sfView.class.php


示例6: initialize

 /**
  * Initializes this Filter.
  *
  * @param sfContext $context    The current application context
  * @param array     $parameters An associative array of initialization parameters
  *
  * @return boolean true
  */
 public function initialize($context, $parameters = array())
 {
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
     $this->user = $context->getUser();
     return parent::initialize($context, $parameters);
 }
开发者ID:theolymp,项目名称:diem,代码行数:15,代码来源:dmFilter.php


示例7: initialize

 /**
  * Initializes this controller.
  *
  * @param sfContext $context A sfContext implementation instance
  */
 public function initialize($context)
 {
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     // set max forwards
     $this->maxForwards = sfConfig::get('sf_max_forwards');
 }
开发者ID:googlecode-mirror,项目名称:orso,代码行数:12,代码来源:sfController.class.php


示例8: buildUserColumns

    /**
     * Function builds the data for the Extjs Grid, to change the order
     * of circulation overview Columns.
     *
     * @param array $data
     * @param sfContext, Context symfony object
     * @return array $data, resultset
     */
    public function buildUserColumns(array $data, sfContext $context) {
        for($a = 0;$a<count($data);$a++) {
            $data[$a]['column'] = $data[$a]['columntext'];
            $data[$a]['columntext'] = $context->getI18N()->__($data[$a]['columntext'],null,'systemsetting');

        }
        return $data;
    }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:16,代码来源:Usermanagement.class.php


示例9: initialize

 /**
  * Initializes this component.
  *
  * @param sfContext $context The current application context
  *
  * @return boolean true, if initialization completes successfully, otherwise false
  */
 public function initialize($context)
 {
     $this->context = $context;
     $this->varHolder = new sfParameterHolder();
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
     $this->requestParameterHolder = $this->request->getParameterHolder();
     return true;
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:16,代码来源:sfComponent.class.php


示例10: initialize

 /**
  * Initializes this controller.
  *
  * @param sfContext $context A sfContext implementation instance
  */
 public function initialize($context)
 {
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     if (sfConfig::get('sf_logging_enabled')) {
         $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Initialization')));
     }
     // set max forwards
     $this->maxForwards = sfConfig::get('sf_max_forwards');
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:15,代码来源:sfController.class.php


示例11: initialize

 /**
  * Initializes this component.
  *
  * @param sfContext $context    The current application context.
  * @param string    $moduleName The module name.
  * @param string    $actionName The action name.
  *
  * @return boolean true, if initialization completes successfully, otherwise false
  */
 public function initialize($context, $moduleName, $actionName)
 {
     $this->moduleName = $moduleName;
     $this->actionName = $actionName;
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     $this->varHolder = new sfParameterHolder();
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
     $this->requestParameterHolder = $this->request->getParameterHolder();
 }
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:20,代码来源:sfComponent.class.php


示例12: initialize

 /**
  * Initializes the cache manager.
  *
  * @param sfContext $context  Current application context
  * @param sfCache   $cache    An sfCache instance
  */
 public function initialize($context, sfCache $cache)
 {
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     $this->controller = $context->getController();
     // empty configuration
     $this->cacheConfig = array();
     // cache instance
     $this->cache = $cache;
     // routing instance
     $this->routing = $context->getRouting();
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:18,代码来源:sfViewCacheManager.class.php


示例13: __construct

 /**
  *
  * @param int $versionId, id of the current workflow
  * @param String $text, the text to replace
  * @param String $culture, the language
  * @param sfContext $context , context object
  */
 public function __construct($versionId, $text, $culture, $context = false) {
     if($context == false) {
         sfLoader::loadHelpers('Date');
     }
     else {
         $context->getConfiguration()->loadHelpers('Date');
     }
     $this->setWorkflow($versionId);
     $this->setWorkflowVersion($versionId);
     $this->culture = $culture;
     $this->theSender = new UserMailSettings($this->workflow['sender_id']);
     $this->newText = $this->replacePlaceholder($text);
 }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:20,代码来源:ReplaceTags.php


示例14: buildField

 /**
  * Prepare data for displaxing in grid
  *
  * @param Doctrine_Collection $data, data from database
  * @param sfContext $context
  * @return array $result
  */
 public function buildField(Doctrine_Collection $data, sfContext $context) {
     $result = array();
     $a = 0;
     foreach($data as $item) {
         $result[$a]['#'] = $a+1;
         $result[$a]['id'] = $item->getId();
         $result[$a]['title'] = $item->getTitle();
         $result[$a]['type'] = $context->getI18N()->__($item->getType(),null,'field');
         $write = $item->getWriteprotected() == 1 ? 'yes' : 'no';
         $result[$a++]['writeprotected'] = $context->getI18N()->__($write,null,'field');
     }
     return $result;
 }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:20,代码来源:Field.class.php


示例15: buildAllText

 /**
  * Function creates data for displaying all additional textes in datagrid
  * 
  * @param Doctrine_Collection $data, all records for grid
  * @param sfContext $context, context object
  * @return array $resultset, resultset.
  */
 public function buildAllText(Doctrine_Collection $data, sfContext $context) {
     $a = 0;
     $result = array();
     foreach($data as $item) {
         $result[$a]['#'] = $a+1;
         $result[$a]['title'] = $item->getTitle();
         $result[$a]['contenttype'] = $context->getI18N()->__($item->getContenttype(),null,'additionaltext');
         $result[$a]['rawcontenttype'] = $item->getContenttype();
         $result[$a]['content'] = $item->getContent();
         $result[$a]['isactive'] = $item->getIsactive();
         $result[$a++]['id'] = $item->getId();
     }
     return $result;
 }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:21,代码来源:AddText.class.php


示例16: initialize

 /**
  * Initializes the cache manager.
  *
  * @param sfContext $context  Current application context
  * @param sfCache   $cache    An sfCache instance
  */
 public function initialize($context, sfCache $cache)
 {
     $this->context = $context;
     $this->dispatcher = $context->getEventDispatcher();
     $this->controller = $context->getController();
     if (sfConfig::get('sf_web_debug')) {
         $this->dispatcher->connect('view.cache.filter_content', array($this, 'decorateContentWithDebug'));
     }
     // empty configuration
     $this->cacheConfig = array();
     // cache instance
     $this->cache = $cache;
     // routing instance
     $this->routing = $context->getRouting();
 }
开发者ID:mediasadc,项目名称:alba,代码行数:21,代码来源:sfViewCacheManager.class.php


示例17: configure

 public function configure()
 {
     $widgets = array();
     $validators = array();
     if ($this->getOption('is_use_id')) {
         $widgets += array('id' => new sfWidgetFormInputText());
         $validators += array('id' => new sfValidatorPass());
     }
     $widgets += array('name' => new sfWidgetFormInputText());
     $validators += array('name' => new opValidatorSearchQueryString(array('required' => false)));
     $culture = sfContext::getInstance()->getUser()->getCulture();
     foreach ($this->getProfiles() as $profile) {
         $profileI18n = $profile->Translation[$culture]->toArray();
         if ($profile->isPreset()) {
             $config = $profile->getPresetConfig();
             $profileI18n['caption'] = sfContext::getInstance()->getI18n()->__($config['Caption']);
         }
         $profileWithI18n = $profile->toArray() + $profileI18n;
         $widget = opFormItemGenerator::generateSearchWidget($profileWithI18n, array('' => '') + $profile->getOptionsArray());
         if ($widget) {
             $widgets[self::$profileFieldPrefix . $profile->getName()] = $widget;
             $validators[self::$profileFieldPrefix . $profile->getName()] = new sfValidatorPass();
         }
     }
     $this->setWidgets($widgets);
     $this->setValidators($validators);
     $this->widgetSchema->setLabel('name', '%nickname%');
     $this->widgetSchema->setNameFormat('member[%s]');
 }
开发者ID:phenom,项目名称:OpenPNE3,代码行数:29,代码来源:opMemberProfileSearchForm.class.php


示例18: end

 public function end()
 {
     $this->addCombo();
     @($this->afExtjs->public['init'] .= "\n\t    Ext.QuickTips.init();\n\t    Ext.apply(Ext.QuickTips.getQuickTip(), {\n\t\t    trackMouse: true\n\t\t});\n\t\tExt.form.Field.prototype.msgTarget = 'side';\n\t\tExt.History.init();\n\t\t");
     @($this->afExtjs->public['init'] .= "\n\t\tsetTimeout(function(){\n\t\t\tExt.get('loading').remove();\n\t        Ext.get('loading-mask').fadeOut({remove:true});\n\t    }, 250);\n\t    afApp.urlPrefix = '" . sfContext::getInstance()->getRequest()->getRelativeUrlRoot() . "';\n\t    ");
     $this->afExtjs->init();
 }
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:7,代码来源:afExtjsHomepageLayout.class.php


示例19: sendSlotReachedMail

    public function sendSlotReachedMail() {
        $sf_i18n = sfContext::getInstance()->getI18N();
        $sf_i18n->setCulture($this->userSettings->userSettings['language']);
        $content['workflow'] = sfContext::getInstance()->getI18N()->__('Workflow' ,null,'slotreachedemail') . ' ' . $this->workflowTemplateSettings['name'];
        $content['currentslot'][0] = sfContext::getInstance()->getI18N()->__('The Slot' ,null,'slotreachedemail');
        $content['currentslot'][1] = $this->currentSlot['name'];
        $content['currentslot'][2] = sfContext::getInstance()->getI18N()->__('has been completed' ,null,'slotreachedemail');

        $content['nextSlot'][0] = sfContext::getInstance()->getI18N()->__('The new Slot' ,null,'slotreachedemail');
        $content['nextSlot'][1] = $this->nextSlot['name'];
        $content['nextSlot'][2] = sfContext::getInstance()->getI18N()->__('has been reached' ,null,'slotreachedemail');
        $subject = sfContext::getInstance()->getI18N()->__('CuteFlow: slot' ,null,'slotreachedemail') . ' ' . $this->nextSlot['name'] . ' ' . sfContext::getInstance()->getI18N()->__('reached' ,null,'slotreachedemail');
        $linkTo = sfContext::getInstance()->getI18N()->__('Direct link to workflow' ,null,'slotreachedemail');
        $this->setSender($this->userSettings->userSettings['systemreplyaddress']);
        $this->setReceiver(array ($this->userSettings->userData['email'] => $this->userSettings->userData['firstname'] . ' ' . $this->userSettings->userData['lastname']));
        $this->setSubject($subject);
        $this->setContentType('text/' . $this->userSettings->userSettings['emailformat']);
        $bodyData = array('text' => $content,
                          'userid' => $this->userSettings->userData['user_id'],
                          'workflowverion' => $this->workflowVersionId,
                          'workflow' => $this->workflowTemplateSettings['id'],
                          'linkto'  => $linkTo
                  );
        $this->setBody(get_partial('workflowdetail/' . $this->userSettings->userSettings['emailformat'] . 'SendSlotReached', $bodyData));
        $this->sendEmail();
    }
开发者ID:rlauenroth,项目名称:cuteflow_v3,代码行数:26,代码来源:SendSlotReachedEmail.class.php


示例20: getDayString

 public function getDayString()
 {
     $context = sfContext::getInstance();
     $i18n = new sfI18N();
     $i18n->initialize($context);
     $i18n->setCulture($context->getUser()->getCulture());
     switch ($this->getDay()) {
         case '1':
             return $i18n->globalMessageFormat->format('_DAY_MONDAY_');
             break;
         case '2':
             return $i18n->globalMessageFormat->format('_DAY_TUESDAY_');
             break;
         case '3':
             return $i18n->globalMessageFormat->format('_DAY_WEDNESDAY_');
             break;
         case '4':
             return $i18n->globalMessageFormat->format('_DAY_THURSDAY_');
             break;
         case '5':
             return $i18n->globalMessageFormat->format('_DAY_FRIDAY_');
             break;
         case '6':
             return $i18n->globalMessageFormat->format('_DAY_SATURDAY_');
             break;
         case '7':
             return $i18n->globalMessageFormat->format('_DAY_SUNDAY_');
             break;
         default:
             return '-';
             break;
     }
 }
开发者ID:taryono,项目名称:school,代码行数:33,代码来源:CourseSchedule.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sfCoreAutoload类代码示例发布时间:2022-05-23
下一篇:
PHP sfConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap