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


PHP sfContext类代码示例

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


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


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