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


PHP User_Model::__construct方法代碼示例

本文整理匯總了PHP中User_Model::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP User_Model::__construct方法的具體用法?PHP User_Model::__construct怎麽用?PHP User_Model::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在User_Model的用法示例。


在下文中一共展示了User_Model::__construct方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($action, $title, $id = FALSE)
 {
     // Load the user
     parent::__construct($id);
     // Create the form
     $this->form = new Forge($action, $title);
     $this->form->input('username')->label(TRUE)->rules('required|length[5,32]')->value($this->object->username);
     $this->form->input('email')->label(TRUE)->rules('required|length[5,127]|valid_email')->value($this->object->email);
     $this->form->password('password')->label(TRUE)->rules('length[5,64]');
     $this->form->password('confirm')->label(TRUE)->matches($this->form->password);
     // Make sure that the username does not already exist
     $this->form->username->callback(array($this, 'is_existing_user'));
     if ($this->object->id == 0) {
         // Password fields are required for new users
         $this->form->password->rules('+required');
     }
     // // Find all roles
     // $roles = new Role_Model;
     // $roles = $roles->find(ALL);
     //
     // $options = array();
     // foreach ($roles as $role)
     // {
     // 	// Add each role to the options
     // 	$options[$role->name] = isset($this->roles[$role->id]);
     // }
     //
     // // Create a checklist of roles
     // $this->form->checklist('roles')->options($options)->label(TRUE);
     // Add the save button
     $this->form->submit('Save');
 }
開發者ID:TODDMAN,項目名稱:gallery3-vendor,代碼行數:32,代碼來源:user_edit.php

示例2:

 function __construct($data = null)
 {
     parent::__construct($data);
     $this->table_name = 'guides';
     $this->primary_key = 'guides.guideId';
     if ($data != null) {
         $this->id = $data->guideId;
         $this->userId = $data->userId;
     }
 }
開發者ID:SerberthoWeb,項目名稱:TouriExpert,代碼行數:10,代碼來源:Guide_Model.php

示例3:

 function __construct()
 {
     // Call the Model constructor
     parent::__construct();
     $this->load->model($this->models, '', TRUE);
 }
開發者ID:pkdism,項目名稱:ISM-MIS,代碼行數:6,代碼來源:employee_model.php

示例4: __construct

 public function __construct()
 {
     // load database library into $this->db (can be omitted if not required)
     parent::__construct();
 }
開發者ID:scottasoutherland,項目名稱:todo-list,代碼行數:5,代碼來源:uservalidation.php


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