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


PHP sfRequest::setParameter方法代码示例

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


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

示例1: execute

 /**
  * Executes this action
  *
  * @param sfRequest $request A request object
  */
 public function execute($request)
 {
     $request->setParameter('type', $request->getParameter('search_module'));
     $this->forward('communityTopic', 'search');
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:10,代码来源:searchFormAction.class.php

示例2: executeSettings

 public function executeSettings(sfRequest $request)
 {
     $request->setParameter('id', $this->getUser()->getProfile()->getId());
     $this->forward('profile', 'edit');
 }
开发者ID:limitium,项目名称:uberlov,代码行数:5,代码来源:actions.class.php

示例3: executeUploadImages

 public function executeUploadImages(sfRequest $request)
 {
     // Belongs at the beginning, not the end
     $this->forward404Unless(aMediaTools::userHasUploadPrivilege());
     $this->form = new aMediaUploadImagesForm();
     if ($request->isMethod('post')) {
         $this->form->bind($request->getParameter('a_media_items'), $request->getFiles('a_media_items'));
         if ($this->form->isValid()) {
             $request->setParameter('first_pass', true);
             $active = array();
             // Saving embedded forms is weird. We can get the form objects
             // via getEmbeddedForms(), but those objects were never really
             // bound, so getValue will fail on them. We have to look at the
             // values array of the parent form instead. The widgets and
             // validators of the embedded forms are rolled into it.
             // See:
             // http://thatsquality.com/articles/can-the-symfony-forms-framework-be-domesticated-a-simple-todo-list
             for ($i = 0; $i < aMediaTools::getOption('batch_max'); $i++) {
                 $values = $this->form->getValues();
                 if ($values["item-{$i}"]['file']) {
                     $active[] = $i;
                 } else {
                     // So the editImagesForm validator won't complain about these
                     $items = $request->getParameter("a_media_items");
                     unset($items["item-{$i}"]);
                     $request->setParameter("a_media_items", $items);
                 }
             }
             $request->setParameter('active', implode(",", $active));
             // We'd like to just do this...
             // $this->forward('aMedia', 'editImages');
             // But we need to break out of the iframe, and
             // modern browsers ignore Window-target: _top which
             // would otherwise be perfect for this.
             // Fortunately, the persistent file upload widget can tolerate
             // a GET-method redirect very nicely as long as we pass the
             // persistids. So we make the current parameters available
             // to a template that breaks out of the iframe via
             // JavaScript and passes the prameters on.
             $this->parameters = $request->getParameterHolder('a_media_items')->getAll();
             // If I don't do this I just get redirected back to myself
             unset($this->parameters['module']);
             unset($this->parameters['action']);
             return 'Redirect';
         }
     }
 }
开发者ID:verenate,项目名称:gri,代码行数:47,代码来源:BaseaMediaActions.class.php

示例4: execute

 /**
  * Executes action
  *
  * @param sfRequest $request A request object
  */
 public function execute($request)
 {
     // only respond to OAI requests if the feature has been enabled
     if (sfConfig::get('app_oai_oai_enabled') == 0) {
         // the following displays a GUI response, should we return a
         // '503 - Service unavailable' HTTP response (without specifying
         // a 'Retry-After' parameter instead?
         $this->forward('admin', 'oaiDisabled');
     }
     $request->setRequestFormat('xml');
     /*    print_r($this->oaiErrorArray);
         //Check for null and duplicate parameters
         if(QubitOai::hasDuplicateOrNullParameters())
         {
           $request->setParameter('errorCode', 'badArgument');
           $request->setParameter('errorMsg', $this->oaiErrorArray{'badArgument'});
           $this->forward('oai', 'error');
         }*/
     $this->date = QubitOai::getDate();
     $this->path = $this->request->getUriPrefix() . $this->request->getPathInfo();
     $this->attributes = $this->request->getGetParameters();
     $this->attributesKeys = array_keys($this->attributes);
     $this->requestAttributes = '';
     foreach ($this->attributesKeys as $key) {
         $this->requestAttributes .= ' ' . $key . '="' . $this->attributes[$key] . '"';
     }
     $this->sets = array();
     foreach (QubitInformationObject::getCollections() as $el) {
         $this->sets[] = new sfIsadPlugin($el);
     }
     /**
      * Validate that verb is valid
      */
     if (isset($this->request->verb)) {
         if (!in_array($this->request->verb, $this->oaiVerbArr)) {
             $request->setParameter('errorCode', 'badVerb');
             $request->setParameter('errorMsg', 'Value of the verb argument is not a legal OAI-PMH verb, the verb argument is missing, or the verb argument is repeated.');
             $this->forward('oai', 'error');
         }
         /**
          * Validate that attributes are valid
          */
         $allowedKeys = sfConfig::get('mod_oai_' . $this->request->verb . 'Allowed');
         $mandatoryKeys = sfConfig::get('mod_oai_' . $this->request->verb . 'Mandatory');
         if (!QubitOai::checkBadArgument($this->attributesKeys, $allowedKeys, $mandatoryKeys)) {
             $request->setParameter('errorCode', 'badArgument');
             $request->setParameter('errorMsg', 'The request includes illegal arguments, is missing required arguments, includes a repeated argument, or values for arguments have an illegal syntax.');
             $this->forward('oai', 'error');
         }
         // For now, if there is a metadataPrefix requested other than oai_dc, fail the request
         $metadataPrefix = $this->request->metadataPrefix;
         if ($metadataPrefix != '' and $metadataPrefix != 'oai_dc') {
             $request->setParameter('errorCode', 'badVerb');
             $request->setParameter('errorMsg', 'The metadata format identified by the value given for the metadataPrefix argument is not supported by the item or by the repository.');
             $this->forward('oai', 'error');
         }
         switch ($this->request->verb) {
             case 'Identify':
                 $this->verb = 'identify';
                 break;
             case 'ListMetadataFormats':
                 $this->verb = 'listMetadataFormats';
                 break;
             case 'ListSets':
                 $this->verb = 'listSets';
                 break;
             case 'ListRecords':
                 $this->verb = 'listRecords';
                 break;
             case 'ListIdentifiers':
                 $this->verb = 'listIdentifiers';
                 break;
             case 'GetRecord':
                 $this->verb = 'getRecord';
                 break;
             default:
                 $this->verb = 'badVerb';
         }
     } else {
         $this->verb = 'badVerb';
     }
 }
开发者ID:nurfiantara,项目名称:ehri-ica-atom,代码行数:87,代码来源:indexAction.class.php


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