本文整理汇总了PHP中SS_HTTPRequest::params方法的典型用法代码示例。如果您正苦于以下问题:PHP SS_HTTPRequest::params方法的具体用法?PHP SS_HTTPRequest::params怎么用?PHP SS_HTTPRequest::params使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SS_HTTPRequest
的用法示例。
在下文中一共展示了SS_HTTPRequest::params方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignteams
public function assignteams(SS_HTTPRequest $request)
{
$params = $request->params();
$game_id = $params['ID'];
$teams = Team::get();
$data = new ArrayData(array('Form' => $this->assignTeamsForm($game_id), 'ParentLink' => $this->Link()));
return $data->renderWith(array('AssignTeams', 'Page'));
}
示例2: view
public function view(SS_HTTPRequest $request)
{
$params = $request->params();
$player_id = $params['ID'];
$player = Player::get()->filter('ID', $player_id)->first();
$link = $this->Link();
$data = new ArrayData(array('Player' => $player, 'ParentLink' => $link));
return $data->renderWith(array('Player', 'Page'));
}
示例3: transferlog
/**
* Action - Get the latest deploy log
*
* @param SS_HTTPRequest $request
*
* @return string
* @throws SS_HTTPResponse_Exception
*/
public function transferlog(SS_HTTPRequest $request)
{
$this->setCurrentActionType(self::ACTION_SNAPSHOT);
$params = $request->params();
$transfer = DNDataTransfer::get()->byId($params['Identifier']);
if (!$transfer || !$transfer->ID) {
throw new SS_HTTPResponse_Exception('Transfer not found', 404);
}
if (!$transfer->canView()) {
return Security::permissionFailure();
}
$environment = $transfer->Environment();
$project = $environment->Project();
if ($project->Name != $params['Project']) {
throw new LogicException("Project in URL doesn't match this deploy");
}
$log = $transfer->log();
if ($log->exists()) {
$content = $log->content();
} else {
$content = 'Waiting for action to start';
}
return $this->sendResponse($transfer->ResqueStatus(), $content);
}
示例4: transferlog
/**
* Action - Get the latest deploy log
*
* @return string
*/
public function transferlog(SS_HTTPRequest $request)
{
$params = $request->params();
$transfer = DNDataTransfer::get()->byId($params['Identifier']);
if (!$transfer || !$transfer->ID) {
throw new SS_HTTPResponse_Exception('Transfer not found', 404);
}
if (!$transfer->canView()) {
return Security::permissionFailure();
}
$environment = $transfer->Environment();
$project = $environment->Project();
if ($project->Name != $params['Project']) {
throw new LogicException("Project in URL doesn't match this deploy");
}
$log = $transfer->log();
if ($log->exists()) {
$content = $log->content();
} else {
$content = 'Waiting for action to start';
}
$sendJSON = strpos($request->getHeader('Accept'), 'application/json') !== false || $request->getExtension() == 'json';
$content = preg_replace('/(?:(?:\\r\\n|\\r|\\n)\\s*){2}/s', "\n", $content);
if ($sendJSON) {
$this->response->addHeader("Content-type", "application/json");
return json_encode(array('status' => $transfer->ResqueStatus(), 'content' => $content));
} else {
$this->response->addHeader("Content-type", "text/plain");
return $content;
}
}