Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,847
» Latest member: amankumar
» Forum threads: 67,473
» Forum posts: 422,104

Full Statistics

Latest Threads
CodeIgniter 4 Proposed Ro...
Forum: CodeIgniter 4 Development
3 hours ago
» Replies: 76   » Views: 113,372
problems with Uncaught Sy...
Forum: General Help
3 hours ago
» Replies: 0   » Views: 13
CodeIgniter 3.1.8 Release...
Forum: News & Discussion
6 hours ago
» Replies: 14   » Views: 2,124
Help in converting vanill...
Forum: General Help
11 hours ago
» Replies: 6   » Views: 101
application modules for c...
Forum: Lounge
11 hours ago
» Replies: 1   » Views: 58
I want to wildcat with ac...
Forum: General Help
Today, 08:14 AM
» Replies: 1   » Views: 60
Problem with valid_email ...
Forum: General Help
Today, 07:21 AM
» Replies: 5   » Views: 169
Getting day, month and ye...
Forum: General Help
Today, 07:19 AM
» Replies: 6   » Views: 195
Codeigniter Pagination Us...
Forum: General Help
Today, 04:48 AM
» Replies: 1   » Views: 76
Forum: Best Practices
Today, 04:46 AM
» Replies: 7   » Views: 293

  Using CI for AJAX (how about performance?)
Posted by: glorsh66 - 03-14-2018, 09:46 AM - Forum: General Help - Replies (1)

Just asking - i wanna implement some ajax on my front-end, so i wonder - is it wise to use CI's controller for answers?
Or it is a way better to write separate php that do only this stuff.

For instance - take a list of cities from a database when a user selected a particular country. 
It's way more convenient to implement it all in CI (because i can reuse models, and helpers and query builder is quite nice.)
But does it worth it? Will CI itself be a huge impedance  for frequent AJAX requests?

  Show results based on a specific date
Posted by: Marcolino92 - 03-14-2018, 08:58 AM - Forum: Model-View-Controller - Replies (3)

Hello, I would like to show the results from the database only inserted in a specific time frame. I would therefore like to show only the results that have been inserted by the date (example: 20 March 2018).

This is an example of proof, with other restrictions such as the most voted.

PHP Code:
public function test($limit=null$offset=null) {
       $this->db->where('status'1); // where status is 1 (active)
       $query $this->db->get();
       return $query->result_array();

  function old() not allow input name type array
Posted by: HTLove - 03-13-2018, 07:07 PM - Forum: CodeIgniter 4 Support - Replies (6)


PHP Code:
<input id="meta[full_name]" name="meta[full_name]" placeholder="Full name" value="<?= old('meta[full_name]'); ?>" type="text" class="form-control "

After post, it not store old input data from form, because it store in $_SESSION['_ci_old_input']['post'] type array.

How to get old data from input name type array.
Thanks all

  Add title for item as suffix in url, only for one controller
Posted by: kabeza - 03-13-2018, 05:24 PM - Forum: General Help - Replies (4)

I've an application in CI 3.x
I have a special controller which I'd like to make more SEF

The actual uri is

and I'd like to make it

And also I'll remove index.php with .htaccess etc.

The question would be:
Is there any way to override site_url() and add the item's title (stored in db) as url suffix ?

I may create a model's function which can get title and then modify the 19 view files where I call item/detail controller/method but it will be a pain in the a**

Maybe another idea? Thanks

  Form Validation - returns "(Anonymous function)"
Posted by: sintakonte - 03-13-2018, 07:57 AM - Forum: Issues - Replies (3)

Hey guys,

i migh've found some bug.

In the docs there is a section called Callable use anything as a rule

I've an object where i do the following

PHP Code:
$this->arrValidationRules[] = array(
'field' => 'personid',
'label' => 'Duplicatecheck',
'rules' => array('check_duplicates', array($this->ci()->Cppersonsave_model,'duplicatesCheck'))

After that i ran the Validation like

PHP Code:

if (!
    throw new 

an excerpt of the model function looks like

PHP Code:
if ($col->count() > 0)
$this->form_validation->set_message('check_duplicates''This person already exists!');

return (
$col->count() > 0   false      true

My model function get called correctly.

But if i do that an error message appears (Anonymous function)

i debugged the code and got the following information 

In line 687 in the Form_validation Library the variable callable is set to true.
On Line 741 the $rule variable gets the callable value which is a boolean and therefore true.

This leads to line 799 which exactly put my message out.

Am i'm missing something here or is this a bug ?

Thx in advance for your answers

  Webservice API
Posted by: deejay - 03-13-2018, 06:30 AM - Forum: General Help - Replies (2)


A couple of years ago i wrote a webservice using "SLIM"...worked pretty good. Very fast. But i had to do alot of coding.

So i am about to do a new webservice. And i love CodeIgniter. Have been using this framework for different projects (backend). So i though i would like to use CI to do a webservice.

So i found this:

And it looked great at first glance. But then is see it doesn´t support multiple resources in a URI.

For example:
A guy owns alot of cars. You want to see all the cars owned by this guy. The RESTful way would be a URI that looks like this:
GET users/12/cars (fetches userid=12 all cars)

I could solve this by:
GET users/12

And then with userdata also include all cars. But that´s "bloating"...if i only need user info...no cars should be included in the response.

however....codeigniter restserver seems to ONLY handle in this URI format:

In my opinion that is not really doing a very good RESTful job.

Are there any other CI based webserive frameworks?

  Class instantiation in codeigniter
Posted by: Santi - 03-13-2018, 04:42 AM - Forum: Model-View-Controller - Replies (3)

How inbuilt classes like libraries,views are instantiated in codeigniter ? 

eg:using new operator

  Cache not work with IOS
Posted by: HTLove - 03-12-2018, 09:01 PM - Forum: CodeIgniter 4 Support - No Replies

I use IOS 10.13.3 and MAMP server.
I problem with cache, it not store file.
It bug in file CodeIgniter\Config\BaseConfig line 140.

PHP Code:
$value getenv$property ); 

In App\Confg\Cache , attr $path is bug
It return path of IOS : /usr/bin:/bin:/usr/sbin:/sbin

I print_r $config in file: CodeIgniter\Cache\Handlers\FileHander.php

PHP Code:
    public function __construct($config)
$this->prefix $config->prefix ?: '';
$this->path = ! empty($config->path) ? $config->path WRITEPATH 'cache';
$this->path rtrim($this->path'/') . '/';
it return result:

PHP Code:
Config\Cache Object
handler] => file
[backupHandler] => dummy
[path] => /usr/bin:/bin:/usr/sbin:/sbin
[cacheQueryString] => 
prefix] => 
memcached] => Array
host] =>
[port] => 11211
[weight] => 1
[raw] => 

redis] => Array
host] =>
[password] => 
port] => 6379
[timeout] => 0

validHandlers] => Array
dummy] => CodeIgniter\Cache\Handlers\DummyHandler
[file] => CodeIgniter\Cache\Handlers\FileHandler
[memcached] => CodeIgniter\Cache\Handlers\MemcachedHandler
[predis] => CodeIgniter\Cache\Handlers\PredisHandler
[redis] => CodeIgniter\Cache\Handlers\RedisHandler
[wincache] => CodeIgniter\Cache\Handlers\WincacheHandler

registrars:protected] => 

Path of cache is changed.
How to fix it ?

  The future of CI
Posted by: spjonez - 03-12-2018, 04:12 PM - Forum: CodeIgniter 4 Discussion - Replies (9)

I've often wondered how the new developers imagine the future of CI. Version 4 is a massive step in the right direction and I'm impressed by what I've seen so far.

Has BCIT released an introspective on their design goals for the current and future versions of CI? I'd love to read it if they have.

  Scaffolding css
Posted by: barrypoore - 03-12-2018, 03:27 PM - Forum: Best Practices - Replies (3)

I have been searching documentation and can't find anything on how I should scaffold my project, i.e where do I put my css folder, should it go in views, should it go in the applications folder, should it sit in the website route.

I'm more used to drupal and wordpress where I place these things inside theme folders, I guess I could place the css directory wherever I like but CodeIgniter must have a best practice method for this?

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.