当前位置: 首页>>代码示例>>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;未经允许,请勿转载。