We can use config.php in cakephp to define constant which need to be used in our whole project example we have different role id for different users.We can define those user corresponding to their role id and can easily access them through out the project.
We need to do following steps:
1) Create config.php in config folder.
2) In bootstrap.php add following line Configure::load('config');
3) Write following code in config.php :
?php
class ConstUserTypes {
const Client = 1;
const Barber = 2;
const BarberShop = 3;
const Healthician = 4;
const Restaurant = 5;
const Admin = 6;
}
4) Use can them by writing "ConstUserTypes::Restaurant"
0 Comment(s)