To declare a constants variable in CodeIgniter, you must open a config / constants.php you must define the constants in uppercase
config / constants.php
//Custom defines define('PAYTM_AMOUNT', 100); define('PAYPAL_AMOUNT', 30); //Custom defines end
If you want to echo the constant variable in view, let's take the following example.
<?php echo PAYTM_AMOUNT echo PAYPAL_AMOUNT ?>
You can access this constant variable anywhere, including the model and the controller too.
Loading, please wait...