本文整理汇总了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'));
}
示例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);
}
示例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();
}
示例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;
}