Re: How to define a global constant which is available through whole app?

2011-02-15 Thread mark_story
Umm if you want a 'constant' why not use constant()? http://php.net/constant And if you need a constant on a class, why not use a class constant? Like AD7six said, CakePHP doesn't not stop you from using regular PHP. Also as an aside, Configure does not make constants.. -Mark On Feb 15, 7:52 p

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Miles J
Like AD7 said, you cant use functions on class properties. Do it in the constructor. On Feb 15, 3:36 pm, Alejandro Gómez Fernández wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Another way to do this is using session variables, in this case, a > constant. You can always access this

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Alejandro Gómez Fernández
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Another way to do this is using session variables, in this case, a constant. You can always access this var in every module. Alejandro. El 15/02/2011 10:52, sanjibdhar...@gmail.com escribió: > I tried Configure::write('company', 'xxx); in boots

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread AD7six
On Feb 15, 4:32 pm, sanjib dhar wrote: > config/bootstrap.php : > Configure::write('company', 'xxx'); > > appcontroller: > * > class AppController extends Controller { > var $helpers = array('Html', 'Form', 'Javascript', > 'Session','fpdf','PhpSpeedy'); > var $company = Configure::read('company'

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Stephen
You should be able to call "Configure::read('company');" in your app where ever you need it. I've never tried it with var in the app controller. On 15 February 2011 15:32, sanjib dhar wrote: > config/bootstrap.php : > Configure::write('company', 'xxx'); > > appcontroller: > * > class AppControl

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread sanjib dhar
config/bootstrap.php : Configure::write('company', 'xxx'); appcontroller: * class AppController extends Controller { var $helpers = array('Html', 'Form', 'Javascript', 'Session','fpdf','PhpSpeedy'); var $company = Configure::read('company'); } Error : * *Parse error*: parse error, expecting `',''

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread mikek
It looks like theres a missing single quote in your Configure::write('company', 'xxx) which will cause the error you are getting. > Some more info would help us help you. Can you show the actual error? > > Jeremy Burns > Class Outfit > > jeremybu...@classoutfit.com > http://www.classoutfit.com >

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Jeremy Burns | Class Outfit
Some more info would help us help you. Can you show the actual error? Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 15 Feb 2011, at 15:14, sanjib dhar wrote: > Hi! > I got unfinished class declaration error. > > On Tue, Feb 15, 2011 at 8:10 PM, Stephen

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread sanjib dhar
Hi! I got unfinished class declaration error. On Tue, Feb 15, 2011 at 8:10 PM, Stephen wrote: > What error message do you get? Configure is usually the way to go. > > On 15 February 2011 13:52, sanjibdhar...@gmail.com < > sanjibdhar...@gmail.com> wrote: > >> I tried Configure::write('company', '

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Stephen
What error message do you get? Configure is usually the way to go. On 15 February 2011 13:52, sanjibdhar...@gmail.com wrote: > I tried Configure::write('company', 'xxx); in bootstrap.php and to > access the constant I wrote > var $company = Configure::read('company'); in AppController but it > g

How to define a global constant which is available through whole app?

2011-02-15 Thread sanjibdhar...@gmail.com
I tried Configure::write('company', 'xxx); in bootstrap.php and to access the constant I wrote var $company = Configure::read('company'); in AppController but it gives syntax error.Can somebody tell me how to access the constant or there is another way of to define a global constant through whole