codeigniter

How to get CI pagination to work with a array();

核能气质少年 提交于 2020-02-06 08:30:31
问题 How can I get the codeigniter pagination to work with my $data['controller_files'][] = array() I cannot figure out best place to put the uri->segment(4) and per page limit. The pagination links work but not per page. Still shows full list of files on my table. Routes // Extensions $route['admin/extension/permissions'] = "admin/extension/extension_permissions/index"; $route['admin/extension/permissions/(:any)'] = "admin/extension/extension_permissions/index/$1"; Controller <?php class

How to get CI pagination to work with a array();

喜夏-厌秋 提交于 2020-02-06 08:29:46
问题 How can I get the codeigniter pagination to work with my $data['controller_files'][] = array() I cannot figure out best place to put the uri->segment(4) and per page limit. The pagination links work but not per page. Still shows full list of files on my table. Routes // Extensions $route['admin/extension/permissions'] = "admin/extension/extension_permissions/index"; $route['admin/extension/permissions/(:any)'] = "admin/extension/extension_permissions/index/$1"; Controller <?php class

sending cache-control headers not working in Codeigniter

最后都变了- 提交于 2020-02-06 04:28:23
问题 I'm probably missing something obvious, but my Codeigniter app is not sending headers when I ask it to. So in any controller or the extended MY_Controller: $this->output->set_header("Last-Modified: " . gmdate( "D, j M Y H:i:s" ) . " GMT"); $this->output->set_header("Expires: " . gmdate( "D, j M Y H:i:s", time() ) . " GMT"); $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); $this->output->set_header("Cache-Control: post-check=0, pre-check=0"); $this->output->set

How to send POST request using html button

六月ゝ 毕业季﹏ 提交于 2020-02-04 07:02:29
问题 I want to send post request using html button. I know it is easily done by jQuery ajax, but i do not want to use jquery and ajax. How can i do it? This my function public function editProduct() { if($_SERVER['REQUEST_METHOD'] === 'POST') { echo 'You are authorized'; } else { echo 'You are not authorized to access this page.'; } } This is my HTML button <button type="submit" onclick="location.href = '<?=base_url().'company/admin/add_product/editProduct?>';">Send Post Request</button> 回答1: In

How should we use radio group in codeigniter

余生长醉 提交于 2020-02-02 15:56:47
问题 I am using codeigniter framework for one of my PHP project. In form I want to use radio button for gender. Gender * Male * Female With the value 1 or for male and 2 for female. after selection radio button value should be assign to gender. Can any tell me how to acheive this in codigniter. Thanks in advance. 回答1: Try Something like this <tr><td><?php echo form_radio('gender', '1', TRUE); ?></td><td><?php echo form_label('Male', 'gender');?></td></tr> <tr><td><?php echo form_radio('gender', '2

Unable to load libraries when using CI 3 with HMVC

微笑、不失礼 提交于 2020-02-02 06:26:04
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

Unable to load libraries when using CI 3 with HMVC

烂漫一生 提交于 2020-02-02 06:25:46
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

Unable to load libraries when using CI 3 with HMVC

╄→гoц情女王★ 提交于 2020-02-02 06:25:25
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

Codeigniter login system with session to redirect user to page if password correct

我只是一个虾纸丫 提交于 2020-02-02 03:40:55
问题 I created a login system but every time I setup an if statement it loops back to the login page when I enter correct password. I need the index function in the controller, the list_employee function and View_employee function to redirect user to login page if they access it directly but if they enter correct password allow them to go to it. user_authentication controller <?php session_start(); //we need to start session in order to access it through CI Class User_Authentication extends CI

Codeigniter controller not found

≡放荡痞女 提交于 2020-02-02 03:03:32
问题 I have create a controller in codeigniter. The problem is that when I hit the controller name and function name in url then Its give me error that 404 not found. I am new to codeigniter and I did not understand where I am going wrong Here is my controller <?php if(!defined('BASEPATH')) exit('No direct script access allowed'); class Home extends CI_Controller{ function __construct(){ parent::__construct(); } function you(){ $this->load->view('home_view'); } } ?> and my view is like this <