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


PHP SS_HTTPRequest::latestParam方法代码示例

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


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

示例1: index

 public function index(SS_HTTPRequest $request)
 {
     if (!Director::isDev() && !Permission::check('CMS_ACCESS_CMSMain')) {
         return Security::permissionFailure($this);
     }
     if ($request->latestParam('ID')) {
         $templates = $this->templateArray();
         if (isset($templates[$request->latestParam('ID')])) {
             $next = false;
             $previous = false;
             $useNext = false;
             foreach ($templates as $k => $v) {
                 if ($useNext) {
                     $next = new ArrayData(array('Name' => $v['Name'], 'Link' => 'patterns/index/' . $k));
                     break;
                 }
                 if ($k == $request->latestParam('ID')) {
                     // mat
                     $useNext = true;
                 } else {
                     $previous = new ArrayData(array('Name' => $v['Name'], 'Link' => 'patterns/index/' . $k));
                 }
             }
             return $this->customise(new ArrayData(array('IsPatternLab' => true, 'PreviousPattern' => $previous, 'NextPattern' => $next, 'PatternName' => $templates[$request->latestParam('ID')]['Name'], 'Patterns' => $this->renderWith(array($templates[$request->latestParam('ID')]['Name'])))))->renderWith('Page');
         }
     }
     return $this->renderWith(array(__CLASS__, 'Page'));
 }
开发者ID:helpfulrobot,项目名称:coreiho-silverstripe-patternlab,代码行数:28,代码来源:PatternLab.php

示例2: environment

 /**
  * Controller Action
  *
  * @param SS_HTTPRequest $request
  * @return APIEnvironment
  */
 public function environment(SS_HTTPRequest $request)
 {
     $project = $this->getProject();
     if (!$project) {
         return new SS_HTTPResponse('Project "' . Convert::raw2xml($request->latestParam('Project')) . '" not found.', 404);
     }
     $environment = $this->getEnvironment();
     if (!$environment) {
         return new SS_HTTPResponse('Environment "' . Convert::raw2xml($request->latestParam('Environment')) . '" not found.', 404);
     }
     return new APIEnvironment($this, $environment);
 }
开发者ID:hafriedlander,项目名称:deploynaut,代码行数:18,代码来源:DeploynautAPI.php

示例3: approvealert

 public function approvealert(SS_HTTPRequest $request)
 {
     $this->owner->setCurrentActionType(self::ACTION_ALERT);
     $project = $this->getCurrentProject();
     if (!$project) {
         return new SS_HTTPResponse("Project '" . Convert::raw2xml($request->latestParam('Project')) . "' not found.", 404);
     }
     return $this->owner->customise(['Title' => 'Alert approval', 'CurrentProject' => $project])->render();
 }
开发者ID:silverstripeltd,项目名称:deploynaut-alerts,代码行数:9,代码来源:DNRootAlertsExtension.php

示例4: getDeleteForm

 /**
  * @param  SS_HTTPRequest $request
  * @param  DNDataArchive $dataArchive Only set when method is called manually, otherwise the state is inferred from
  *	the request data.
  * @return Form
  */
 public function getDeleteForm($request, $dataArchive = null)
 {
     $dataArchive = $dataArchive ? $dataArchive : DNDataArchive::get()->byId($request->requestVar('DataArchiveID'));
     // Performs canView permission check by limiting visible projects
     $project = $this->getCurrentProject();
     if (!$project) {
         return new SS_HTTPResponse("Project '" . Convert::raw2xml($request->latestParam('Project')) . "' not found.", 404);
     }
     $form = new Form($this, 'DeleteForm', new FieldList(new HiddenField('DataArchiveID', false, $dataArchive->ID), new LiteralField('Warning', '<p class="text-warning">Are you sure you want to permanently delete this snapshot from this archive area?</p>')), new FieldList(FormAction::create('doDelete', 'Delete')->addExtraClass('btn')));
     $form->setFormAction($project->Link() . '/DeleteForm');
     return $form;
 }
开发者ID:adrexia,项目名称:deploynaut,代码行数:18,代码来源:DNRoot.php


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