本文整理汇总了PHP中Request::param方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::param方法的具体用法?PHP Request::param怎么用?PHP Request::param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::param方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(\Request $request, \Response $response)
{
if ($request->param('id')) {
$this->image = new Model_Image($request->param('id'));
if (!$this->image->loaded()) {
throw new HTTP_Exception_404(__('This page seems to not exist.'));
}
}
parent::__construct($request, $response);
}
示例2: __construct
public function __construct(\Request $request, \Response $response)
{
if ($request->param('id')) {
$this->project = new Model_Project($request->param('id'));
if (!$this->project->loaded()) {
throw new HTTP_Exception_404(__('This page seems to not exists.'));
}
$this->test_user_authorized();
}
parent::__construct($request, $response);
}
示例3: __construct
public function __construct(\Request $request, \Response $response)
{
$this->project = Model::factory('Project')->where("share_hash", "=", $request->param('hash'))->find();
if (!$this->project->loaded() or $this->project->visibility->name == "privat") {
throw new HTTP_Exception_404(__('This page seems to not exists.'));
}
if ($this->project->visibility->name == "secure") {
if (!$this->visitor_authorized($request->param('hash')) and $request->action() != 'authenticate') {
$this->redirect('/share/' . $request->param('hash') . '/project/authenticate/');
}
}
parent::__construct($request, $response);
}
示例4: upload_notification
function upload_notification()
{
$files = Request::param('files');
$project = new Project($files[0]['project_id']);
$this->check_authorization($project);
File::upload_notification($project, $files);
}
示例5: testPostJson
public function testPostJson()
{
$r = new Request(['url' => 'api/tasks/12.json', 'filter' => 'all'], ['HTTP_ACCEPT' => 'application/json;q=0.8', 'REQUEST_URI' => '/api/tasks/12.json?filter=all', 'REQUEST_METHOD' => 'POST'], ['url' => 'api/tasks/12.json', 'filter' => 'all'], ['title' => 'New Title']);
$this->assertTrue($r instanceof Request);
$this->assertEquals(Request::POST, $r->method());
$this->assertEquals('api/tasks/12.json', $r->url());
$this->assertEquals('json', $r->type());
$this->assertEquals('all', $r->param('filter'));
$route = $r->route();
$this->assertTrue($route instanceof Route);
$result = $r->response();
$this->assertTrue($result instanceof Response);
$this->assertEquals("New Title", $r->param('title'));
$expected = ['filter' => 'all'];
$result = $r->query();
$this->assertEquals($expected, $result);
}
示例6: __construct
/**
* Constructor
*/
public function __construct()
{
$this->NumberOfTrainings = Request::param('number-of-trainings');
$this->EditorRequested = isset($_POST['multi-edit']);
if (!isset($_POST['training-import'])) {
$this->NumberOfTrainings = 0;
}
}
示例7: test_basic_get_post
public function test_basic_get_post()
{
$_GET["test"] = "hello";
$_POST["test2"] = "hello";
$this->assertEqual(Request::get("test"), "hello");
$this->assertEqual(Request::post("test2"), "hello");
$this->assertEqual(Request::param("test"), "hello");
$this->assertEqual(Request::param("test2"), "hello");
}
示例8: handleRequest
/**
* Handle request
*/
protected function handleRequest()
{
if (Request::param('use-calculated-value') == 'true') {
$oldObject = clone $this->Context->activity();
$this->Context->activity()->set(Model\Activity\Object::ELEVATION, $this->Context->route()->elevation());
$Updater = new Model\Activity\Updater(DB::getInstance(), $this->Context->activity(), $oldObject);
$Updater->setAccountID(SessionAccountHandler::getId());
$Updater->update();
}
}
示例9: initData
/**
* Init all data
*/
private function initData()
{
$this->IDs = array();
if (strlen(Request::param('ids')) > 0) {
$this->IDs = explode(',', Request::param('ids'));
} else {
$this->IDs = DB::getInstance()->query('SELECT id FROM `' . PREFIX . 'training`
ORDER BY `id` DESC
LIMIT ' . self::NUMBER_OF_TRAININGS_TO_DISPLAY)->fetchAll(PDO::FETCH_COLUMN, 0);
}
}
示例10: _detect_current_page
/**
* Auto detect the current page
*
* @return int Current page
*/
protected function _detect_current_page()
{
switch ($this->_config->source) {
case 'route':
$page = $this->_request->param($this->_config->key);
break;
default:
$page = $this->_request->query($this->_config->key);
break;
}
return (int) $page ?: 1;
}
示例11: __construct
public function __construct()
{
$this->server = "http://" . $_SERVER['HTTP_HOST'];
if (Request::param('warned') || Session::get('warned')) {
Session::set('warned', 1);
$this->warned = true;
}
if (substr_count($_SERVER['HTTP_USER_AGENT'], "MSIE") > 0) {
$this->ie = true;
}
$cat = new CmsCategory();
$this->all_categories = $cat->order('name ASC')->all();
}
示例12: search
public function search()
{
if ($query = Request::param("cmsq")) {
$model = new CmsContent("published");
$fields = array("title" => '1.3', 'content' => "0.6");
$search = $query;
$this->query = "+" . str_replace(" ", " +", $search);
$this->cms_content = $model->search($search, $fields)->page($this->this_page, $this->per_page);
$this->use_view = "cms_list";
} else {
$this->redirect_to("/");
}
}
示例13: content_lookup
public function content_lookup($obj)
{
//revert to normal
if (($preview_id = Request::param('preview')) && is_numeric($preview_id) && ($m = new $obj->cms_content_class($preview_id)) && $m && $m->primval) {
$obj->cms_content = $m;
} elseif ($content = $obj->content($obj->cms_stack, $obj->cms_mapping_class, $obj->cms_live_scope, $obj->cms_language_id)) {
$obj->cms_content = $content;
} elseif ($content = $obj->content($obj->cms_stack, $obj->cms_mapping_class, $obj->cms_live_scope, array_shift(array_keys(CMSApplication::$languages)))) {
$obj->cms_content = $content;
} elseif (WaxApplication::is_public_method($obj, "method_missing")) {
return $obj->method_missing();
} else {
$obj->cms_throw_missing_content = true;
}
}
示例14: generate_project
function generate_project()
{
$project = new Project();
//if we don't manually set this variable, the parameters from the $_POST array will be imported. We don't want
//those parameters because then we would also be importing the Template id, which would effectively set this
//new project model = this template model. We will manually set the parameters from the template that we want to
//copy
$project->params_imported = true;
$project->set('client_id', Request::param('client_id'));
$project->set('name', Request::param('name'));
$project->set('start_date', Request::param('start_date'));
$project->set('due_date', Request::param('due_date'));
$project->save();
$this->project = $project;
}
示例15: __construct
/**
* Constructor
*/
public function __construct()
{
$this->timerStart = 1;
if (Request::param('y') == self::LAST_6_MONTHS) {
$this->timerEnd = 26;
} else {
if (Request::param('y') == self::LAST_12_MONTHS) {
$yearEnd = date('Y') - 1;
} else {
$yearEnd = (int) Request::param('y');
}
$this->timerEnd = date("W", mktime(0, 0, 0, 12, 28, $yearEnd));
// http://de.php.net/manual/en/function.date.php#49457
}
parent::__construct();
}