本文整理汇总了PHP中REST_Controller::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP REST_Controller::__construct方法的具体用法?PHP REST_Controller::__construct怎么用?PHP REST_Controller::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类REST_Controller
的用法示例。
在下文中一共展示了REST_Controller::__construct方法的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'));
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->load->model('prescription/prescription');
$this->load->model('sms/sms');
$simbanic_json = array();
}
示例3:
function __construct()
{
parent::__construct();
$this->load->model("Property_model");
$this->load->database();
//$autoload['model'] = array('property_model');
}
示例4: __construct
public function __construct()
{
parent::__construct();
if (!$this->session->userdata('auth')) {
redirect('login', 'refresh');
}
}
示例5:
function __construct()
{
parent::__construct();
$this->ci =& get_instance();
$this->ci->load->database();
$this->load->model('Village_data_model');
}
示例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'));
}
示例7:
function __construct()
{
parent::__construct();
$this->load->library('form_validation');
// $this->load->helper(array('form','url'));
$this->load->model('meeting_model');
}
示例8:
function __construct()
{
// Construct the parent class
parent::__construct();
$this->load->model('Evaluator_model', 'evaluator');
$this->load->helper('url');
}
示例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();
}
示例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');
}
示例11:
function __construct()
{
parent::__construct();
$this->validate_user();
$this->load->helper('json');
$this->load->model(array('Project', 'Screen', 'Comment', 'Hotspot', 'Project_Statistic', 'Drawing'));
}
示例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;
}
}
}
示例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);
}
}
}
}
}
示例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);
}
}
}
示例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);
}