codeigniter

codeigniter pagination: create links

时光怂恿深爱的人放手 提交于 2021-01-29 04:17:38
问题 I have this piece of code, which uses Codeigniter's native Pagination Class. $this->load->library('pagination'); $config['base_url'] = base_url().'notification/display_notification_info/'.$notification_id; $config['total_rows'] = $totalRows; $config['per_page'] = $per_page; $this->pagination->initialize($config); echo $this->pagination->create_links(); It shows the last page by default. So, the links are displayed like so: < 1, 2, 3 It doesn't show the last page's URL. It should be: base_url

Showing the count of my user and display it on badge. (Codeigniter)

心不动则不痛 提交于 2021-01-29 04:00:01
问题 Newbie here. I did an ajax to count the users and display it on my badge, however, whenever I'm clicking on 1 button (Modal with table), it is displaying on all badges. For example. I have 4 users in my first row modal table. The #4 count is displayed to all of my badges. Which is something that is weird. My target is to display the count in my badge dynamically. I have provided a video and images below for better explanation. https://streamable.com/z6dqgi << This is the output of what I made

Handle trailing slash with Codeigniter 3

三世轮回 提交于 2021-01-29 03:44:51
问题 I have a database of articles with the urls as follow: person/albert-einstein/ (trailing slash) person/albert-einstein/1 (no trailing slash) And I was wondering what was the best way to handle url trailing slashes in Codeigniter 3? This is what I have done/test so far: echo site_url('person/albert-einstein/'); # http://localhost/person/albert-einstein echo base_url('person/albert-einstein/'); # http://localhost/person/albert-einstein echo site_url('person/albert-einstein/1'); # http:/

How to correct config Apache and Codeigniter?

旧城冷巷雨未停 提交于 2021-01-29 00:13:36
问题 I am using Apache + Codeigniter to setup an RESTful backend service. I placed codeigniter's project folder html/ under my Apache's web folder. Then I can access it by http://localhost/html/index.php. I want to remove the folder name in my url, access my web like that http://localhost/index.php. Could anyone can tell me how to config on Apache side or Codeigniter? Thanks in advance! 回答1: In Apache folder, just open filename httpd.conf and put this code at the bottom: Listen 80 <VirtualHost *

Codeigniter send mail with gmail smtp on localhost

∥☆過路亽.° 提交于 2021-01-28 23:55:15
问题 I know that question has a couple of duplicates but I think I've tried them all. My mail is never send calling it with the following settings: $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'smtp.gmail.com', //'smtp_host' => 'localhost', 'smtp_port' => 465, 'mailpath' => 'C:\xampp\sendmail', // tried without sendmail 'smtp_user' => 'correct email', 'smtp_pass' => 'correct pass', 'mailtype' => 'html', 'charset' => 'utf-8', 'starttls' => true, // changing makes no difference 'smtp_crypto

How to correct config Apache and Codeigniter?

喜你入骨 提交于 2021-01-28 23:37:32
问题 I am using Apache + Codeigniter to setup an RESTful backend service. I placed codeigniter's project folder html/ under my Apache's web folder. Then I can access it by http://localhost/html/index.php. I want to remove the folder name in my url, access my web like that http://localhost/index.php. Could anyone can tell me how to config on Apache side or Codeigniter? Thanks in advance! 回答1: In Apache folder, just open filename httpd.conf and put this code at the bottom: Listen 80 <VirtualHost *

How to correct config Apache and Codeigniter?

安稳与你 提交于 2021-01-28 23:25:56
问题 I am using Apache + Codeigniter to setup an RESTful backend service. I placed codeigniter's project folder html/ under my Apache's web folder. Then I can access it by http://localhost/html/index.php. I want to remove the folder name in my url, access my web like that http://localhost/index.php. Could anyone can tell me how to config on Apache side or Codeigniter? Thanks in advance! 回答1: In Apache folder, just open filename httpd.conf and put this code at the bottom: Listen 80 <VirtualHost *

how curdate function could return date in mm/dd/yyyy format php

故事扮演 提交于 2021-01-28 23:01:55
问题 I need to select current date from database in mm/dd/yyyy format..But php curdate() function returns date format in yyyy-mm-dd as default..How could I resolve this issue.? My model function is: public function get_cat($category) { $this->db->select('*'); if($category!='') { $this->db->like('Category',$category,'both'); $this->db->from('tbl_job'); $this->db->where('Expiry_date >=','DATE(CURDATE())',FALSE); $result = $this->db->get(); } return $result->result(); } 回答1: Use DATE_FORMAT to format

how curdate function could return date in mm/dd/yyyy format php

不想你离开。 提交于 2021-01-28 22:36:31
问题 I need to select current date from database in mm/dd/yyyy format..But php curdate() function returns date format in yyyy-mm-dd as default..How could I resolve this issue.? My model function is: public function get_cat($category) { $this->db->select('*'); if($category!='') { $this->db->like('Category',$category,'both'); $this->db->from('tbl_job'); $this->db->where('Expiry_date >=','DATE(CURDATE())',FALSE); $result = $this->db->get(); } return $result->result(); } 回答1: Use DATE_FORMAT to format

404 Page Not Found The page you requested was not found while new page created codeigniter

爱⌒轻易说出口 提交于 2021-01-28 19:47:23
问题 I have copied Model, View, Controller files to new Model/Controller/View with different filename in a codeigniter project. When I access the new page the below error is occurring: 404 Page Not Found The page you requested was not found. 回答1: if you copy (save as) a controller or model, there are several reasons why a 404, page not found error may occur: the file was not saved with a capital first letter the class name was not updated the class name was updated, but doesn't start with a