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



Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,898
» Latest member: seatransport85
» Forum threads: 70,256
» Forum posts: 361,553

Full Statistics

Latest Threads
Forum: Addins
1 hour ago
» Replies: 1   » Views: 40
Changing the name of a vi...
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 82
How to catch database ope...
Forum: Model-View-Controller
1 hour ago
» Replies: 7   » Views: 232
Saving data to MYSQL
Forum: Model-View-Controller
1 hour ago
» Replies: 1   » Views: 32
Relations Module
Forum: CodeIgniter 4 Addins
4 hours ago
» Replies: 1   » Views: 351
Call function in model be...
Forum: CodeIgniter 4 Support
8 hours ago
» Replies: 0   » Views: 56
The requested URL was not...
Forum: Issues
8 hours ago
» Replies: 0   » Views: 39
Looking for a developer
Forum: Jobs
9 hours ago
» Replies: 15   » Views: 1,571
validation if_exist
Forum: CodeIgniter 4 Support
Today, 06:59 AM
» Replies: 0   » Views: 78
Basic App - Free CMS on C...
Forum: CodeIgniter 4 Addins
Today, 05:07 AM
» Replies: 26   » Views: 6,657

  Class File - method getRandomName
Posted by: abatrans - 11-13-2019, 04:40 AM - Forum: CodeIgniter 4 Feature Requests - No Replies

A quick suggestion to add flexibility to the getRandomName function.

Add 2 parameters:

  1. useTime - Boolean to indicate if the time value should be included as part of the generated file name - default TRUE
  2. stringLength - Integer to set the length of the random bytes - default 10
The function, in its current form is generating a filename of 31 characters plus however long the extention is.  These extremely long filenames are resulting in display issues when having to display the file name.

By allowing the developer to set their own parameter as to how the random file name should be generated will imho make the function even better.

  Redirecting in BaseController?
Posted by: next2heaven - 11-12-2019, 10:36 AM - Forum: CodeIgniter 4 Discussion - Replies (2)

So in previous Codeigniter versions I usually had a base controller that all other controllers extended from.  In that controller I would check if the user was logged in and if not, redirect them to a login page.  I'm not able to do redirecting in the base controller in CI4.  

How should I handle checking if the user is logged in and if not sending them to the login page without having to write an if statement on all of my page controllers?

  Hi, i have issues with my website.
Posted by: confconnect_rediffmail.com - 11-12-2019, 08:09 AM - Forum: General Help - No Replies

Dear All.

While making my site live the developer was forgot to redirect index.php or #! or assets or some special characters. We made our site live without making these changes. Now we are not able to redirect. Due to which exisisting of both index.php and without index.php, the two sites are there in google. Google is not giving importance to any site. Moreover because of this my website not coming in google. Please help me out to resolve these issues.




  CI3 - How to get Firebird generator value.
Posted by: Andry - 11-12-2019, 07:36 AM - Forum: General Help - Replies (2)

Hi all,
In my Model, I need to get the next Firebird generator value. How to code this ?

  Why CodeIgniter doesn't come with pre packages
Posted by: Anees Khan - 11-12-2019, 04:22 AM - Forum: CodeIgniter 4 Discussion - Replies (2)


i'm new here first of all, I've using codeigniter for some years and i liked it Smile and i just wanted to ask why codeigniter doesn't with some its own packages like Laravel gives you auth, laravel-vue etc

i hope no one get offended in any manner Big Grin

Anees Khan

  help me write this mysql query in codeigniter
Posted by: acebay - 11-11-2019, 06:12 PM - Forum: General Help - Replies (9)

Hi All,

I need help on writing this MySQL query in CodeIgniter


SELECT *, ABS( post_code - 2015 ) AS distance FROM list_data WHERE business_name LIKE '%cash%' ESCAPE '!' ORDER BY distance LIMIT 6

2015 and '%cash%' is coming from input fields

so far I have written it like this but not working

PHP Code:
public function searchListing($data$location) {
    $this->db->select('(SELECT *, ABS(`post_code`-' $location' AS distance FROM `list_data` ORDER BY distance)'FALSE);
    $query $this->db->get();
    return $query->result();

I've attached images of the table, first image is showing all data in the table, the second image is the query that I want to achieve in codeigniter

Can anyone help me? Thanks

Attached Files Thumbnail(s)

  can't create instance of a model class in models from controller class
Posted by: captain-sensible - 11-11-2019, 12:13 PM - Forum: CodeIgniter 4 Discussion - Replies (5)

Abstract of problem is this :

in app/controllers dir,  i have  files such as Home.php , News.php with class names matching

From  index method of Home class i can do this :

class Home extends BaseController
    public function index()
    $handle= new News();

i.e I can create an instance of a class located in /app/Controllers from another class , the file  holding it also in controllers.

With a simple class in Models directory however i get : 

Class 'Andy\UserModel' not found

the Andy comes from me trying namespace global permutations.

the dir with codeigniter is called CI and is located at /var/www/htdocs apache on slackware

echo of APPPATH gives : /var/www/htdocs/CI/app/

i've checked permissions of files in /var/www/htdocs/CI/app/Models/ and they are at least read for all

set up on apache (i don't know if this has anything to do with it) is via virtual hosts eg

  <Directory /var/www/htdocs/CI/public>
 Options Indexes   FollowSymLinks
Require all granted
AllowOverride All
ServerAdmin webmaster@CI.org
  ServerName CI.org
    DocumentRoot /var/www/htdocs/CI/public/
    ServerAlias www.CI.org
    #ErrorLog "/var/log/httpd/dummy-host.example.com-error_log"
    #C<ustomLog "/var/log/httpd/dummy-host.example.com-access_log" common

using  home page works , a route a added works and from a controller i can access from a sqlite3 database. I was moving function of database data access from controller to model when found problem.

Any ideas?

Sad Get value from array without loop on parased template
Posted by: andru3dward - 11-10-2019, 04:26 AM - Forum: CodeIgniter 4 Support - No Replies

i need to get value from array in a parased template, so in my case:

  • I made a template system where all templates end in .tpl
  • second, i need to get an value from a array like that 

 without usinge metod like 

Like Smarty template Engine do

This is my code:

$data = [
      'member'      => $member->memberInfo(),  // Array from DB if the member is logged otherwise it is false
      'content'   => $this->body

print $parser->setData( $data, 'raw' )->render( $layout );

I was not able to find it in the documentation or in the code and I need this in templates

I hope you get it cuz in this moment i can't exprime myself   Dodgy

  Colon in MySql functions is breaking Query
Posted by: bender - 11-10-2019, 04:15 AM - Forum: CodeIgniter 4 Support - No Replies


I am using CodeIgniter 4 (rc3) and want to select DATETIME column in desired format (ex. 30.12.2019 12:56:00). But the problem is in colon : which is breaking my query. This is probably because of Named Bindings.
Is there any solution or a way around this?

SELECT id, title, DATE_FORMAT(date_time, '%d.%m.%Y %H:%i:%s') AS dt FROM table1...


  redirect() returns blank page in live server but works in localhost
Posted by: xlaws27 - 11-08-2019, 04:47 PM - Forum: General Help - Replies (1)

i think i have tried all the solution in stackoverflow&ci forum but still, i cant make it work. i have no problem storing sessions and if i manually type the url i dont encounter any problems at all but when using redirect() in live server it doesnt work at all . it returns blank page and i am still at the current page/url

 function __construct() {

        if($this->session->userdata('logged_in_admin')) { 

on autoload.php
$autoload['helper'] = array('url','pis');

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