简体   繁体   中英

how to define Global variable in codeigniter?

I have a condition for price filtering products in codeigniter...

When user clicks on filter button, lower & higher value as well as that category id of that page is sent to controller...

Now, when user is on that page and clicks on another next page (In pagination).. those all values are gone... how can i set them globally so that even when user goes for next page those lower,higher value and category ids i can use again...

I am using codeigniter's pagination library...

file location - Application -> Config -> constants.php here you can define global variable

define('BASE_PATH',"/home/example/public_html/");
define('UPLOAD_PATH',BASE_PATH . 'uploads/');


//this is your global variable, can use anywhere in application
   echo $UPLOAD_PATH;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM