當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::param方法代碼示例

本文整理匯總了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);
 }
開發者ID:Workhaven,項目名稱:workhaven,代碼行數:10,代碼來源:Images.php

示例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);
 }
開發者ID:Workhaven,項目名稱:workhaven,代碼行數:11,代碼來源:Projects.php

示例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);
 }
開發者ID:Workhaven,項目名稱:workhaven,代碼行數:13,代碼來源:Share.php

示例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);
 }
開發者ID:neevan1e,項目名稱:Done,代碼行數:7,代碼來源:files.controller.php

示例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);
 }
開發者ID:alkemann,項目名稱:h2l,代碼行數:17,代碼來源:RequestTest.php

示例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;
     }
 }
開發者ID:Strubbl,項目名稱:Runalyze,代碼行數:11,代碼來源:class.MultiImporter.php

示例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");
 }
開發者ID:phpwax,項目名稱:phpwax,代碼行數:9,代碼來源:TestRequest.php

示例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();
     }
 }
開發者ID:n0rthface,項目名稱:Runalyze,代碼行數:13,代碼來源:class.ElevationInfo.php

示例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);
        }
    }
開發者ID:guancio,項目名稱:Runalyze,代碼行數:14,代碼來源:class.RunalyzePluginTool_MultiEditor.php

示例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;
 }
開發者ID:nexeck,項目名稱:kohana-pagination,代碼行數:17,代碼來源:pagination.php

示例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();
 }
開發者ID:sheldon,項目名稱:charlesmarshall,代碼行數:13,代碼來源:ApplicationController.php

示例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("/");
     }
 }
開發者ID:sheldon,項目名稱:charlesmarshall,代碼行數:13,代碼來源:PageController.php

示例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;
     }
 }
開發者ID:phpwax,項目名稱:wildfire.dealer,代碼行數:15,代碼來源:LocalDealerController.php

示例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;
 }
開發者ID:neevan1e,項目名稱:Done,代碼行數:15,代碼來源:template.php

示例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();
 }
開發者ID:n0rthface,項目名稱:Runalyze,代碼行數:19,代碼來源:class.PlotWeekSumData.php


注:本文中的Request::param方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。