The reason you can't do this easily is because it goes against Cake's conventions. Try learning to do things the cake way and it will make your life way easier in the long run. Especially if you will be building multiple cake applications in the future!
What you should do is implement Acl to handle these different user types. It's super easy to do once you figure out a little of how it works. Mark Story one of the main cakephp developers has an excellent tutorial on his website. http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1 If you really want to define this variable system wide though I think you can do it in your main layout (default.ctp) for your views and app_controller.php (you may have to create it) for your controllers. On Jul 20, 4:45 am, xiaopang <[email protected]> wrote: > Hello: > > I am a newby to Cakephp, > > I have some simple data which I don't want to store in database but I > want them to be application wide accessible. for view, controller as > well as model. > > For example: I have a array $admin_type, which define 2 types of > system administer, > > $admin_type = array (1 => 'King', > 2 => 'Admin'); > > Then, where should I define this variable? I tried to define in > bootstrap file, but it doesn't work > > Thanks in advance Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
