codeigniter

How to Change Pagination into Infinite Scroll in codeigniter

天涯浪子 提交于 2019-12-24 00:26:57
问题 I want to change this pagination page into infinite scroll. I'm using codeigniter. I had already search about jquery and ajax but i don't really understand how to implement it in my code. So please help me to edit my pagination code into infinite scroll. . . I had struggle for days. I will be so grateful if u can hep me. Thank you :) HomeController.php public function list_voucher($page=NULL, $orderBy=NULL) { if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata

Why is my config item not populating from my getenv() entry in codeigniter?

China☆狼群 提交于 2019-12-24 00:26:39
问题 I am using phpdotenv with Codeigniter. Codeigniter's environment setup doesn't quite work for this project. I'm trying to set this in my config.php file: $config['site_id'] = getenv('APP_ID'); phpdotenv is being loaded via the pre_system hook and getenv('APP_ID') is available throughout the app. I've also checked in the core and this fires well before loading config items. $hook['pre_system'] = function() { $dotenv = new Dotenv\Dotenv(APPPATH); $dotenv->load(); }; The value of $this-config-

How to link assets(images,stylesheet etc) in Views for CodeIgniter 2.1?

﹥>﹥吖頭↗ 提交于 2019-12-24 00:23:06
问题 I am using CodeIgniter Version 2.1 & trying to link assets like images,stylesheets, javascript files etc in my views by using, header.php : <link href="<?php base_url();?>css/style.css" rel="stylesheet" /> my controller code, calls the view: <?php class Main extends CI_Controller{ public function index() { $this->load->view('header'); } The view file from which I am trying to load the asset is located ../application/views/header.php . the css file is loaded: ../application/views/css/style.css

Codeigniter - How to upload original image with thumbnail image?

白昼怎懂夜的黑 提交于 2019-12-24 00:10:01
问题 I have this code to file upload in codeigniter: if(!empty($_FILES['userfile'])){ $name_array = array(); $count = count($_FILES['userfile']['size']); foreach($_FILES as $key => $value) for ($s=0; $s<=$count-1; $s++){ $_FILES['userfile']['name'] = $value['name'][$s]; $_FILES['userfile']['type'] = $value['type'][$s]; $_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s]; $_FILES['userfile']['error'] = $value['error'][$s]; $_FILES['userfile']['size'] = $value['size'][$s]; $config['upload_path'

How do I store database sessions in CodeIgniter with multiple databases?

二次信任 提交于 2019-12-23 23:34:47
问题 I am using codeigniter and till date I was using cookie based sessions.. but now size of sessions is increased so i need to store them in database.. I have multiple database(more than 3) connected to my application..How can i specifically use ci_sessions table to store sessions? when i say $config['sess_use_database'] = TRUE; my app goes blank. a plane white page is shown. That is because From multiple database connections codeigniter is not finding exact database to store sessions.. How can

how to style pagination links without config - codeigniter

爱⌒轻易说出口 提交于 2019-12-23 22:08:53
问题 I have the following pagination style <ul class="pagination"> <li><a href="#"><i class="fa fa-long-arrow-left"></i>Previous Page</a></li> <li class="active"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">Next Page<i class="fa fa-long-arrow-right"></i></a></li> </ul><!--/.pagination--> i want to make the above static code dynamic without using config <ul class="pagination"> <?php echo $this->pagination->create_links(); ?>

upload size limit in codeigniter

六月ゝ 毕业季﹏ 提交于 2019-12-23 22:04:19
问题 I have a page where user can register. He uploads a profile picture in the process. I want to limit the size but there is not much emphasis on codeigniter documentation except for $config['maxsize']. I tried the following but I don't get any messages. I set the size to 10 (KB) just for testing. Do I have to handle it somehow to get the message across to my view? public function add_user() { $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size

How to convert from native php to codeigniter

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 21:20:56
问题 I have the following db and php. I am trying to make a unordered list of category menu. The original php is working by itself. I am trying to convert this to MVC in codeigniter and the following is what I got so far and not working. If someone can point out what I am doing wrong, I will appreciate it. Database CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `shortdesc` varchar(255) NOT NULL, `longdesc` text NOT NULL, `status` enum(

Am I using api correctly?

匆匆过客 提交于 2019-12-23 21:14:06
问题 when I click on view button I just only see record of first customer how do I get particular id of particular customer please explain me in detail and I am using codegniter here is some of my code where I want to add .. AdminController.php <?php class AdminController extends MY_Controller { function __construct() { parent::__construct(); if(!$this->session->userdata("id")) { return redirect('logincontroller/index'); } } public function dashboard() { $this->load->view('admin/dashboard'); }

codeigniter image update

徘徊边缘 提交于 2019-12-23 21:12:24
问题 I'm stuck on a problem with image uploader. I've created the image uploader which works fine but I also need to edit them. When I add a need image the db column updates correctly but I if don't change the image and leave it as it is, I get an error "Column 'image' cannot be null" This is the code for the update section: else if ($type == 'update') { if($this->input->post('image')) { $fdata = $this->savenew(); $data['image'] = $fdata['upload_data']['file_name']; } else { $data['image'] = $this