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


PHP Template::redirect方法代码示例

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


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

示例1: login

 public function login()
 {
     // if the user is not logged in continue to show the login page
     if ($this->auth->is_logged_in() === false) {
         if ($this->input->post('submit')) {
             $remember = $this->input->post('remember_me') == '1' ? true : false;
             // Try to login
             if ($this->auth->login($this->input->post('login'), $this->input->post('password'), $remember) === true) {
                 $this->activity_model->log_activity($this->auth->user_id(), lang('us_log_logged') . ': ' . $this->input->ip_address(), 'users');
                 /*
                 	In many cases, we will have set a destination for a 
                 	particular user-role to redirect to. This is helpful for
                 	cases where we are presenting different information to different
                 	roles that might cause the base destination to be not available.
                 */
                 if (config_item('auth.do_login_redirect')) {
                     Template::redirect($this->auth->login_destination);
                 } else {
                     if (!empty($this->requested_page)) {
                         Template::redirect($this->requested_page);
                     } else {
                         Template::redirect('/');
                     }
                 }
             }
         }
         Template::set_view('users/users/login');
         Template::set('page_title', 'Login');
         Template::render();
     } else {
         redirect(SITE_AREA . '/content');
     }
 }
开发者ID:nurulimamnotes,项目名称:Bonfire,代码行数:33,代码来源:users.php

示例2: create

	public function create() 
	{
		$this->auth->restrict('Bonfire.Users.Add');
	
		$this->load->helper('address');
	
		if ($this->input->post('submit'))
		{
			if ($this->save_user())
			{
				Template::set_message('User successfully created.', 'success');
				Template::redirect('admin/settings/users');
			}
			else 
			{
				Template::set_message('There was a problem creating the user: '. $this->user_model->error);
			}
		}
		
		Template::set('roles', $this->role_model->select('role_id, role_name, default')->find_all());
	
		Template::set('toolbar_title', 'Create New User');
		Template::set_view('settings/user_form');
		Template::render();
	}
开发者ID:ndcisiv,项目名称:Bonfire,代码行数:25,代码来源:settings.php

示例3: create

 public function create()
 {
     $this->auth->restrict('Jenis_Pembayaran.Keuangan.Create');
     Assets::add_js('format_uang');
     if ($this->input->post('save')) {
         if ($insert_id = $this->save_jenis_pembayaran()) {
             // Log the activity
             $this->activity_model->log_activity($this->current_user->id, lang('jenis_pembayaran_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'jenis_pembayaran');
             Template::set_message(lang('jenis_pembayaran_create_success'), 'success');
             Template::redirect(SITE_AREA . '/keuangan/jenis_pembayaran/create');
         } else {
             Template::set_message(lang('jenis_pembayaran_create_failure') . $this->jenis_pembayaran_model->error, 'error');
         }
     }
     $data = $this->jenis_pembayaran_model->get_nama_jurusan();
     if (!empty($data)) {
         $option[""] = "";
         foreach ($data as $row) {
             $option[$row->kode_nama_jurusan] = $row->nama_jurusan;
         }
         $option['99'] = 'Semua Jurusan';
         Template::set('nama_jurusan', $option);
     }
     $data_kode_jenis_pembayaran = $this->jenis_pembayaran_model->get_kode_jenis_pembayaran();
     if (!empty($data_kode_jenis_pembayaran)) {
         $option_kode_jenis[""] = "";
         foreach ($data_kode_jenis_pembayaran as $row) {
             $option_kode_jenis[$row->kode_jenis_pembayaran] = $row->jenis_pembayaran;
         }
         Template::set('kode_jenis_pembayaran', $option_kode_jenis);
     }
     Assets::add_module_js('jenis_pembayaran', 'jenis_pembayaran.js');
     Template::set('toolbar_title', lang('jenis_pembayaran_create') . ' Jenis Pembayaran');
     Template::render();
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:35,代码来源:keuangan.php

示例4: create

 public function create()
 {
     $this->auth->restrict('Navigation.Content.Create');
     $nav_items = $this->navigation_model->order_by('nav_group_id, position')->find_all();
     $data['parents'] = array();
     $data['parents'][] = '';
     if (is_array($nav_items) && count($nav_items)) {
         foreach ($nav_items as $key => $record) {
             $data['parents'][$record->nav_id] = $record->title;
         }
     }
     $groups = $this->navigation_group_model->find_all('nav_group_id');
     $data['groups'] = array();
     if (is_array($groups) && count($groups)) {
         foreach ($groups as $group_id => $record) {
             $data['groups'][$group_id] = $record->title;
         }
     }
     Template::set("data", $data);
     if ($this->input->post('submit')) {
         if ($this->save_navigation()) {
             Template::set_message(lang("navigation_create_success"), 'success');
             Template::redirect(SITE_AREA . '/content/navigation');
         } else {
             Template::set_message(lang("navigation_create_failure") . $this->navigation_model->error, 'error');
         }
     }
     Template::set_view('content/form');
     Template::set('toolbar_title', lang("navigation_create_new_button"));
     Template::render();
 }
开发者ID:ben12345,项目名称:bonfire_navigationmodule,代码行数:31,代码来源:content.php

示例5: logout

 /**
  * Log out, destroy the session, and cleanup, then redirect to the home page.
  *
  * @return void
  */
 public function logout()
 {
     if (isset($this->current_user->id)) {
         // TODO Log the logout Activity.
         //lang('us_log_logged_out') . ': ' . $this->input->ip_address(),
     }
     // Always clear browser data (don't silently ignore user requests).
     $this->auth->logout();
     Template::redirect('/');
 }
开发者ID:ci-blox,项目名称:Ignition-Go,代码行数:15,代码来源:Check.php

示例6: create

 public function create()
 {
     if ($this->input->post('submit')) {
         if ($this->save_role()) {
             Template::set_message('Role successfully created.', 'success');
             Template::redirect(SITE_AREA . '/settings/roles');
         } else {
             Template::set_message('There was a problem creating the role: ' . $this->role_model->error, 'error');
         }
     }
     Template::set('toolbar_title', 'Create New Role');
     Template::set_view('settings/role_form');
     Template::render();
 }
开发者ID:hnmurugan,项目名称:Bonfire,代码行数:14,代码来源:settings.php

示例7: create

 public function create()
 {
     if ($this->input->post('submit')) {
         if ($this->save_permissions()) {
             Template::set_message(lang("permissions_create_success"), 'success');
             Template::redirect(SITE_AREA . '/settings/permissions');
         } else {
             Template::set_message(lang("permissions_create_failure") . $this->permission_model->error, 'error');
         }
     }
     Template::set('toolbar_title', lang("permissions_create_new_button"));
     Template::set_view('settings/permission_form');
     Template::render();
 }
开发者ID:nurulimamnotes,项目名称:Bonfire,代码行数:14,代码来源:settings.php

示例8: create

 /**
  * Creates a new navigation group
  */
 public function create()
 {
     $this->auth->restrict('Navigation.Content.Create');
     if ($this->input->post('submit')) {
         if ($this->save_navigation()) {
             Template::set_message(lang("navigation_create_success"), 'success');
             Template::redirect(SITE_AREA . '/content/navigation/groups');
         } else {
             Template::set_message(lang("navigation_create_failure") . $this->navigation_group_model->error, 'error');
         }
     }
     Template::set('toolbar_title', lang("navigation_create_new_button"));
     Template::set_view('groups/create');
     Template::set("toolbar_title", "Manage Navigation Groups");
     Template::render();
 }
开发者ID:ben12345,项目名称:bonfire_navigationmodule,代码行数:19,代码来源:groups.php

示例9: save_kurikulum

 public function save_kurikulum()
 {
     if ($this->input->post('save')) {
         $kode_mk = $this->input->post('kode_matakuliah');
         $kode_kurikulum = $this->input->post('kode_nama_kurikulum');
         $matakuliah = count($kode_mk);
         for ($i = 0; $i < $matakuliah; $i++) {
             $data = array();
             $data['kode_nama_kurikulum'] = $kode_kurikulum;
             $data['kode_matakuliah'] = $kode_mk[$i];
             $this->kurikulum_model->insert($data);
         }
         Template::set_message($matakuliah . ' Mata Kuliah Berhasil Ditambahkan ke Kurikulum', 'success');
         Template::redirect(SITE_AREA . '/jurusan/kurikulum/index/' . $kode_kurikulum);
     }
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:16,代码来源:jurusan.php

示例10: create

 public function create()
 {
     $this->auth->restrict('Kode_Jenis_Pembayaran.Keuangan.Create');
     if ($this->input->post('save')) {
         if ($insert_id = $this->save_kode_jenis_pembayaran()) {
             // Log the activity
             $this->activity_model->log_activity($this->current_user->id, lang('kode_jenis_pembayaran_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'kode_jenis_pembayaran');
             Template::set_message(lang('kode_jenis_pembayaran_create_success'), 'success');
             Template::redirect(SITE_AREA . '/keuangan/kode_jenis_pembayaran');
         } else {
             Template::set_message(lang('kode_jenis_pembayaran_create_failure') . $this->kode_jenis_pembayaran_model->error, 'error');
         }
     }
     Assets::add_module_js('kode_jenis_pembayaran', 'kode_jenis_pembayaran.js');
     Template::set('toolbar_title', lang('kode_jenis_pembayaran_create') . ' Kode Jenis Pembayaran');
     Template::render();
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:17,代码来源:keuangan.php

示例11: create

 public function create()
 {
     $this->auth->restrict('Departemen.Manajemen.Create');
     if ($this->input->post('save')) {
         if ($insert_id = $this->save_departemen()) {
             // Log the activity
             $this->activity_model->log_activity($this->current_user->id, lang('departemen_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'departemen');
             Template::set_message(lang('departemen_create_success'), 'success');
             Template::redirect(SITE_AREA . '/manajemen/departemen');
         } else {
             Template::set_message(lang('departemen_create_failure') . $this->departemen_model->error, 'error');
         }
     }
     Assets::add_module_js('departemen', 'departemen.js');
     Template::set('toolbar_title', lang('departemen_create') . ' Departemen');
     Template::render();
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:17,代码来源:manajemen.php

示例12: register

 /**
  * Display registration form for new user.
  *
  * @return void
  */
 public function register()
 {
     // Are users allowed to register?
     if (!$this->settings_lib->item('auth.allow_register')) {
         Template::set_message(lang('us_register_disabled'), 'error');
         Template::redirect('/');
     }
     $register_url = $this->input->post('register_url') ?: REGISTER_URL;
     $login_url = $this->input->post('login_url') ?: LOGIN_URL;
     $this->load->model('roles/role_model');
     $this->load->helper('date');
     $this->load->config('address');
     $this->load->helper('address');
     $this->load->config('user_meta');
     $meta_fields = config_item('user_meta_fields');
     Template::set('meta_fields', $meta_fields);
 }
开发者ID:ci-blox,项目名称:Ignition-Go,代码行数:22,代码来源:Users.php

示例13: create

 public function create()
 {
     $this->auth->restrict('Jenjang.Jurusan.Create');
     if ($this->input->post('save')) {
         if ($insert_id = $this->save_jenjang()) {
             // Log the activity
             $this->activity_model->log_activity($this->current_user->id, lang('jenjang_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'jenjang');
             Template::set_message(lang('jenjang_create_success'), 'success');
             Template::redirect(SITE_AREA . '/jurusan/jenjang');
         } else {
             Template::set_message(lang('jenjang_create_failure') . $this->jenjang_model->error, 'error');
         }
     }
     Assets::add_module_js('jenjang', 'jenjang.js');
     Template::set('toolbar_title', lang('jenjang_create') . ' Jenjang');
     Template::render();
 }
开发者ID:triasfahrudin,项目名称:siska21,代码行数:17,代码来源:jurusan.php

示例14: create

 public function create()
 {
     $this->auth->restrict('Bonfire.Users.Add');
     $this->load->config('address');
     $this->load->helper('address');
     if ($this->input->post('submit')) {
         if ($id = $this->save_user()) {
             $user = $this->user_model->find($id);
             $this->activity_model->log_activity($this->auth->user_id(), lang('us_log_create') . ' ' . $user->role_name . ': ' . (config_item('auth.use_usernames') ? $user->username : $user->email), 'users');
             Template::set_message('User successfully created.', 'success');
             Template::redirect(SITE_AREA . '/settings/users');
         } else {
             Template::set_message('There was a problem creating the user: ' . $this->user_model->error);
         }
     }
     Template::set('roles', $this->role_model->select('role_id, role_name, default')->find_all());
     Template::set('toolbar_title', lang('us_create_user'));
     Template::set_view('settings/user_form');
     Template::render();
 }
开发者ID:hnmurugan,项目名称:Bonfire,代码行数:20,代码来源:settings.php

示例15: edit

 public function edit()
 {
     $id = (int) $this->uri->segment(5);
     if (empty($id)) {
         Template::set_message('Invalid Role ID.', 'error');
         redirect(SITE_AREA . '/settings/roles');
     }
     $this->auth->restrict('Bonfire.Roles.Manage');
     if ($this->input->post('submit')) {
         if ($this->save_role('update', $id)) {
             Template::set_message('Role successfully saved.', 'success');
             // redirect to update the sidebar which will show old name otherwise.
             Template::redirect(SITE_AREA . '/settings/roles');
         } else {
             Template::set_message('There was a problem saving the role: ' . $this->role_model->error);
         }
     }
     Template::set('role', $this->role_model->find($id));
     Template::set('toolbar_title', 'Edit Role');
     Template::set_view('settings/role_form');
     Template::render();
 }
开发者ID:nazrulworld,项目名称:Bonfire,代码行数:22,代码来源:settings.php


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