Reputation: 525
I recently setup a old Codeigniter framework on my xampp.But i don't know the version of this framework. I use the code
<?php echo CI_VERSION; ?>
but its give me error
Notice: Use of undefined constant CI_VERSION - assumed 'CI_VERSION' in /opt/lampp/htdocs/projectname/views/v_header.php on line 57
CI_VERSION
Please guide me, I am new in Codeigniter.
Upvotes: 31
Views: 96141
Reputation: 3
For CodeIgniter 4
You can also try following path to find CodeIgniter version.
D:\xampp\htdocs\PROJECT_NAME\vendor\codeigniter4\framework\system\CodeIgniter.php
In CodeIgniter.php file, find the following line;
public const CI_VERSION = '4.3.3';
Upvotes: 0
Reputation: 485
In the root folder:
cat system/core/CodeIgniter.php | grep CI_VERSION
Upvotes: 14
Reputation: 75
If you are running CodeIgniter 4, the CodeIgniter 3 style
<?php echo CI_VERSION; ?>
would not work out and you would get the error - Use of undefined constant CI_VERSION
As @user1283182 has pointed out, the exact version can be found in system/CodeIgniter.php (see const CI_VERSION)
or enter the below code in one of your views
<?= CodeIgniter\CodeIgniter::CI_VERSION ?>
Upvotes: 2
Reputation: 99
Just use this simple code to check for Codeigniter version
<?= CodeIgniter\CodeIgniter::CI_VERSION ?>
Upvotes: 1
Reputation: 131
For CodeIgniter 4, the CI_VERSION is defined in system\CodeIgniter.php
Upvotes: 1
Reputation: 961
Try This:<?php echo CI_VERSION; ?> // echoes something like 3.1.6
Upvotes: 3
Reputation: 2190
You can check it two ways. one is to
<?php echo CI_VERSION; ?>
Another way is go to your system/core/CodeIgniter.php path and then check define('CI_VERSION', '2.1.4');
Upvotes: 12
Reputation: 2168
Which means you are not properly configure your codeigniter project / system folder. System folder is not necessary to be placed in project root. you can place anywhere and configure the correct system path[something like $system_path = '../system';
] in the index.php(project root) properly. It should work...
Upvotes: 2
Reputation: 6305
Method 1:
Please access the file
System >> Core >> Codeigniter.php
/**
* CodeIgniter Version
*
* @var string
*
*/
define('CI_VERSION', '3.0.0');
Method 2: In index.php or any other view file write the following code of php as follows:
<?php
echo CI_VERSION;
?>
CI_VERSION is build in constant in codeigniter, which contains value of version.
Thank you!
Upvotes: 5
Reputation: 6994
See in system/core/CodeIgniter.php
and there is a constant like this..
define('CI_VERSION', '3.0.6');
Upvotes: 48