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


PHP Input::Post方法代码示例

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


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

示例1: action_profile

 public function action_profile()
 {
     $data = null;
     $data['user'] = Model_User::query()->related('user_providers')->where('id', static::$user_id)->get_one();
     $data['api_key'] = Auth::get('api_key');
     if (Input::Method() == 'POST') {
         $new_password = Input::Post('new_password');
         $current_password = Input::Post('current_password');
         if (empty($new_password) === false) {
             if (empty($current_password) === true) {
                 Session::set('error', 'You must enter your old password in first!');
                 $this->template->content = View::Forge('settings/profile', $data);
                 return;
             } else {
                 if (Auth::change_password($current_password, $new_password) === false) {
                     Session::set('error', 'Wrong Password');
                     $this->template->content = View::Forge('settings/profile', $data);
                     return;
                 } else {
                     Session::delete('current_password');
                 }
             }
         }
         // update the data for the current user
         try {
             Auth::update_user(array('email' => Input::Post('email'), 'fullname' => Input::Post('full_name')));
         } catch (Exception $e) {
             Session::set('error', $e->getMessage());
             $this->template->content = View::Forge('settings/profile', $data);
             return;
         }
         Session::set('success', 'Your profile has been updated');
     }
     $this->template->content = View::Forge('settings/profile', $data);
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:35,代码来源:users.php

示例2: save

	private function save()
	{
		$bind=array();
		$input=Input::Post();
		
		if ($this->controller->method=='POST')
		{
			if (!$input->has($this->model->primary_key))
				return;
				
			$this->model->{$this->model->primary_key}=$input->{$this->model->primary_key};
			$this->model->reload();
		}

		foreach($this->fields as $f)
			$bind[$f['id']]=$f['id'];
			
		$this->model->bind_input($input,$bind);
		
		$errors=$this->model->save();
		
		if (is_array($errors))
			$this->errors=$errors;
		else if($this->redirect)
			redirect(sprintf($this->redirect,$this->model->id));
	}
开发者ID:jawngee,项目名称:Thor,代码行数:26,代码来源:form.php

示例3: action_index

 public function action_index()
 {
     $data['settings'] = Settings::get_all();
     if (\Input::method() == 'POST') {
         Controller_Settings::update(Input::Post());
         $data['settings'] = Settings::get_all(true);
     }
     $data['blocked'] = $blacklist_item = Model_Blacklist::query()->get();
     $keys = \Settings::Get('character_set');
     if (empty($keys) === true) {
         $keys = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     }
     $random_length = \Settings::Get('random_url_length');
     if (empty($random_length) === true) {
         $random_length = 5;
     }
     $url_sample_space = DB::select(DB::expr('count(id) as count'))->from('urls')->where(DB::expr('char_length(short_url)'), $random_length)->limit(1)->execute()->as_array();
     $data['urls_left'] = Controller_Admin::mathFact(strlen($keys)) / (Controller_Admin::mathFact(strlen($keys) - $random_length) * Controller_Admin::mathFact($random_length)) - $url_sample_space[0]['count'];
     $this->template->content = View::Forge('admin/index', $data);
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:20,代码来源:admin.php

示例4: action_index

 public function action_index()
 {
     //システム設定レコードがなければ作成する。
     $sysRecords = Model_System::find('all');
     $found = false;
     foreach ($sysRecords as $sys) {
         if ($sys != null) {
             $found = true;
             break;
         }
     }
     if ($found == false) {
         $sys = Model_System::forge();
         $sys->mailAtLogin = 0;
         $sys->systemAd1 = '';
         $sys->systemAd2 = '';
         $sys->systemAd3 = '';
         $sys->systemAdMobile1 = '';
         $sys->systemAdMobile2 = '';
         $sys->systemAdMobile2 = '';
         $sys->save();
     }
     $sys = Model_System::getSystemRecord();
     $msg = '';
     if (Input::Post() != null) {
         $msg = "システム設定を保存しました。";
         $sys->mailAtLogin = Input::post('mailAtLogin');
         $sys->headTag = Input::post('headTag');
         $sys->systemAd1 = Input::post('systemAd1');
         $sys->systemAd2 = Input::post('systemAd2');
         $sys->systemAd3 = Input::post('systemAd3');
         $sys->systemAdMobile1 = Input::post('systemAdMobile1');
         $sys->systemAdMobile2 = Input::post('systemAdMobile2');
         $sys->systemAdMobile3 = Input::post('systemAdMobile3');
         $sys->save();
     }
     $content = View::forge('admin/index');
     $this->template->boardDescription = 'メインメニュー';
     $this->template->msg = $msg;
     $this->template->content = $content;
 }
开发者ID:katsuwo,项目名称:bbs,代码行数:41,代码来源:admin.php

示例5: action_create

 public function action_create()
 {
     $auth = Auth::instance();
     $groupList = Config::get("cmsauth.group_list");
     $data['grouplist'] = $groupList;
     if (Input::method() == 'POST') {
         $val = Model_User::validate('create');
         if ($val->run()) {
             $ignore = array('button', 'submit', 'password', 'confirm_password', 'email', 'group');
             foreach (Input::Post() as $feild => $value) {
                 if (!in_array($feild, $ignore)) {
                     $fields[$feild] = $value;
                 }
             }
             $username = Input::post('first_name') . " " . Input::post('last_name');
             $password = Input::post('password');
             $email = Input::post('email');
             $group = Input::post('group');
             $post_data = Input::post();
             try {
                 $auth = Auth::instance();
                 $user = $auth->create_user($username, $password, $email, $group, $fields, $post_data);
                 Response::redirect("admin");
             } catch (Exception $e) {
                 $error = $e->getMessage();
                 var_dump($error);
                 die;
             }
         } else {
             $data['status'] = "fail";
             $data['msg'] = $val->show_errors();
         }
     }
     $this->template->title = "Create Users";
     $this->template->content = View::forge('admin/users/create', $data, false);
 }
开发者ID:sajans,项目名称:cms,代码行数:36,代码来源:users.php

示例6: action_signup

 public function action_signup()
 {
     // already logged in?
     if (\Auth::check()) {
         // yes, so go back to the page the user came from, or the
         // application home if no previous page can be detected
         \Response::redirect_back('home');
     }
     // was the login form posted?
     if (\Input::method() == 'POST') {
         // Default Group
         // 3 Users
         // Moderators
         // 5 Admins
         // call Auth to create this user
         $created = \Auth::create_user(Input::Post('username'), Input::Post('password'), Input::Post('email'), \Config::get('application.user.default_group', 3), array('fullname' => Input::Post('name')));
         // if a user was created succesfully
         if ($created) {
             \Auth::instance()->login(\Input::param('email'), \Input::param('password'));
             // and go back to the previous page, or show the
             // application home if we don't have any
             \Response::redirect_back('home');
         } else {
             // oops, creating a new user failed?
         }
     }
     $this->template->content = View::forge('login/signup');
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:28,代码来源:login.php

示例7: __construct

	/**
	 * Constructor
	 * 
	 * @param string $root The root uri path
	 * @param array $segments The uri segments following the root path
	 */
 	public function __construct($root,$segments)
 	{
 		$this->session=Session::Get();
 		
 		$this->uri=new URI($root,$segments);
 		$this->query=new Query();
 		
 		// assign the get and post vars
 		$this->post=Input::Post();
 		$this->get=Input::Get();
 		$this->files=Input::Files();
 		
 		$this->setup();
 	}
开发者ID:jawngee,项目名称:Thor,代码行数:20,代码来源:controller.php

示例8: array

                                    <?php 
echo Form::Input('Dkana', Input::Post('Dkana'), array('class' => 'form-control'));
?>
                                </div>
                                <div class="col-md-2"></div>
                            </div>

                            <div><br><br><br></div>

                            <!--入力-->
                            <div class="form-group">
                                <div class="col-md-2 col-xs-12"></div>
                                <label class="col-md-1 control-label">Department (略称):</label>
                                <div class="col-md-7 col-xs-12">
                                    <?php 
echo Form::Input('Did', Input::Post('Did'), array('class' => 'form-control'));
?>
                                </div>
                                <div class="col-md-2"></div>
                            </div>

                            <div><br><br><br></div>

                            <!-- select -->
                            <div class="form-group">
                                <div class="col-md-2 col-xs-12"></div>
                                <label class="col-md-1 control-label">College:</label>
                                <div class="col-md-7 col-xs-12">
                                    <?php 
echo Form::select('college', null, $select, array('class' => 'form-control'));
?>
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:31,代码来源:DepAdd.php

示例9: action_Delete

 public function action_Delete()
 {
     //チェックされたユーザの取得
     $check = Input::Post('check');
     //チェックされたユーザーがいない場合
     if ($check == '') {
         //何もしないで元に戻る
     } else {
         //いた場合
         //チェックされた項目の数だけ回る
         foreach ($check as $ck) {
             //カラム
             $query = DB::update('users')->set(array('df' => '1'))->where('id', '=', $ck)->execute();
         }
     }
     return View::forge('usermanagement/UserManagement', $this->action_UserAcquisition());
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:17,代码来源:usermanagement.php

示例10: set_user

 public function set_user()
 {
     $user = NULL;
     if (Session::get('loginAs')) {
         $this->current_user = Model_User::find(Session::get('loginAs'));
         View::set_global('current_user', $this->current_user);
     } else {
         if (Input::method() == 'POST') {
             $id = Arr::get(Auth::get_user_id(), 1);
             $post = Input::Post();
             $notMe = isset($post['notMe']) ? $post['notMe'] : NULL;
             $group = isset($user->group) ? $user->group : null;
             if ($id) {
                 $user = Model_User::find($id);
             }
             if ($this->not_me_check($notMe, $group)) {
                 $user = Model_User::find((int) $post['editAs']);
             }
         }
         $id = Arr::get(Auth::get_user_id(), 1);
         if ($id) {
             $user = Model_User::find($id);
         }
         $this->current_user = Auth::check() ? $user : null;
         View::set_global('current_user', $this->current_user);
     }
 }
开发者ID:sajans,项目名称:cms,代码行数:27,代码来源:base.php


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