当前位置: 首页>>代码示例>>PHP>>正文


PHP REST_Controller类代码示例

本文整理汇总了PHP中REST_Controller的典型用法代码示例。如果您正苦于以下问题:PHP REST_Controller类的具体用法?PHP REST_Controller怎么用?PHP REST_Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了REST_Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     /*
     $token_value = $this->get('token');
     
     $token = new Token();
     $token->where('value',$token_value);
     $token->get();
     
     if (!$token->exists())
     {
     	$this->response(
     		array(
     			'error'=>'Invalid Token'
     		)
     	);
     }
     
     
     $this->user = $token->user;
     $this->application = $token->application;
     */
     $this->user_id = $this->session->userdata('user_id');
     if (!$this->user_id) {
         $this->response(array('error' => 'Not Logged In'));
     }
 }
开发者ID:petersonb,项目名称:ourvigor,代码行数:28,代码来源:users.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('prescription/prescription');
     $this->load->model('sms/sms');
     $simbanic_json = array();
 }
开发者ID:hardikpanseriya,项目名称:testing,代码行数:7,代码来源:prescription_controller.php

示例3:

 function __construct()
 {
     parent::__construct();
     $this->load->model("Property_model");
     $this->load->database();
     //$autoload['model'] = array('property_model');
 }
开发者ID:F5-Buddy,项目名称:restfullapi-in-codeigniter,代码行数:7,代码来源:Welcome.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     if (!$this->session->userdata('auth')) {
         redirect('login', 'refresh');
     }
 }
开发者ID:Connxt,项目名称:fixnmix,代码行数:7,代码来源:logout_controller.php

示例5:

 function __construct()
 {
     parent::__construct();
     $this->ci =& get_instance();
     $this->ci->load->database();
     $this->load->model('Village_data_model');
 }
开发者ID:vibhor-mungee,项目名称:planit-dms,代码行数:7,代码来源:Selection_api.php

示例6: array

 function __construct()
 {
     parent::__construct();
     $this->load->library('common');
     global $messages_lang;
     $messages_lang = $this->common->set_language_for_server_api('base_api', array('missing_fields', 'invalid_credential', 'authorized', 'not_authorized', 'logout_success', 'logout_failure', 'unexpected_errors'));
 }
开发者ID:cuongcody,项目名称:angularjs_elunchdemo,代码行数:7,代码来源:Base_api.php

示例7:

 function __construct()
 {
     parent::__construct();
     $this->load->library('form_validation');
     // $this->load->helper(array('form','url'));
     $this->load->model('meeting_model');
 }
开发者ID:pradeep-rajapaksha,项目名称:Scribylog-with-Angular,代码行数:7,代码来源:meeting.php

示例8:

 function __construct()
 {
     // Construct the parent class
     parent::__construct();
     $this->load->model('Evaluator_model', 'evaluator');
     $this->load->helper('url');
 }
开发者ID:devcharleneg,项目名称:cictpracticum,代码行数:7,代码来源:Evaluator.php

示例9: header

 function __construct()
 {
     parent::__construct();
     header("Content-type: text/html; charset=utf-8");
     //		header("Content-type: application/json; charset=utf-8");
     $this->kq = new Kqavos();
 }
开发者ID:iHamburg,项目名称:kqserver,代码行数:7,代码来源:kqapi.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model('Penduduk');
     $this->baseCols = array('nama', 'tempat_lahir', 'tanggal_lahir', 'jenis_kelamin', 'golongan_darah', 'tanggal_diterbitkan', 'nip_pencatat', 'kewarganegaraan');
     $this->baseUpdatableCols = array('nik', 'agama', 'foto', 'alamat', 'rt', 'rw', 'kecamatan', 'kelurahan', 'kabupaten', 'provinsi', 'status_perkawinan', 'pekerjaan', 'pendidikan_terakhir');
 }
开发者ID:bobseven,项目名称:hansip-penduduk,代码行数:7,代码来源:Hansip.php

示例11:

 function __construct()
 {
     parent::__construct();
     $this->validate_user();
     $this->load->helper('json');
     $this->load->model(array('Project', 'Screen', 'Comment', 'Hotspot', 'Project_Statistic', 'Drawing'));
 }
开发者ID:gitanton,项目名称:cono-rest,代码行数:7,代码来源:screens.php

示例12: __construct

 public function __construct()
 {
     header('Access-Control-Allow-Origin: *');
     header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
     header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, HEAD, DELETE");
     $method = $_SERVER['REQUEST_METHOD'];
     if ($method == "OPTIONS") {
         die;
     }
     parent::__construct();
     $this->file_cache_base = FCPATH . '/files/';
     $library_files = scandir('application/libraries');
     foreach ($library_files as $file) {
         $end = '_task.php';
         $pos = strpos($file, $end);
         if ($pos == strlen($file) - strlen($end)) {
             $lang = substr($file, 0, $pos);
             require_once "application/libraries/{$file}";
             $class = $lang . '_Task';
             $version = $class::getVersion();
             $this->languages[$lang] = $version;
         }
     }
     if ($this->config->item('rest_enable_limits')) {
         $this->load->config('per_method_limits');
         $limits = $this->config->item('per_method_limits');
         foreach ($limits as $method => $limit) {
             $this->methods[$method]['limit'] = $limit;
         }
     }
 }
开发者ID:javawolfpack,项目名称:Jobe-Docker,代码行数:31,代码来源:restapi.php

示例13:

 function __construct()
 {
     // Call the Model constructor
     parent::__construct();
     date_default_timezone_set('Asia/Seoul');
     $this->load->model('general_model');
     $this->load->model('order_model');
     $this->load->model('token_model');
     $this->load->model('customer_model');
     $this->load->model('email_model');
     $result = $this->token_model->checkToken($this->get('token'), 1, false);
     if ($result['status'] != true) {
         $this->response(array('error' => 'Your token is not valid'), 404);
     } else {
         if (!$this->get('id')) {
             $this->response(array('error' => 'You must give order info'), 404);
         } else {
             //본 주문에 관련있는 사람인지 혹인
             $order = $this->order_model->readOrder($this->get('id'));
             if ($order == false) {
                 $this->response(array('error' => 'order is not valid'), 404);
             } else {
                 $seller_number = $this->token_model->readSellerNumber($this->get('token'));
                 $userkey = $this->token_model->readUserkey($this->get('token'));
                 if ($order['customer_number'] != $userkey && $order['editor_number'] != $seller_number && $seller_number != 1) {
                     $this->response(array('error' => "This info is not accessible"), 404);
                 }
             }
         }
     }
 }
开发者ID:kimjbrandon,项目名称:restAPI,代码行数:31,代码来源:order+(1).php

示例14: getallheaders

 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 function __construct()
 {
     parent::__construct();
     $this->load->model('user', '', TRUE);
     $this->load->model('device', '', TRUE);
     if (!in_array($this->router->method, $this->config->item('allowed_calls_without_token'))) {
         $headers = getallheaders();
         if (isset($headers['Token'])) {
             if (isset($headers['Userid'])) {
                 if (!$this->device->validToken($headers['Userid'], $headers['Token'])) {
                     $data["header"]["error"] = "1";
                     $data["header"]["message"] = "Please provide valid token";
                     $this->response($data, 200);
                 }
             } else {
                 $data["header"]["error"] = "1";
                 $data["header"]["message"] = "Please provide user id (header)";
                 $this->response($data, 200);
             }
         } else {
             $data["header"]["error"] = "1";
             $data["header"]["message"] = "Please provide access token";
             $this->response($data, 200);
         }
     }
 }
开发者ID:farhanbashir,项目名称:woo,代码行数:41,代码来源:Api.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     $this->load->model("m_ebook", "", TRUE);
     $this->load->model("m_user", "", TRUE);
     $this->load->model("m_comment", "", TRUE);
 }
开发者ID:adhimonako,项目名称:coremona,代码行数:7,代码来源:comment.php


注:本文中的REST_Controller类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。