cake-php@googlegroups.com
[Top] [All Lists]

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

Subject: Re: How to define a global constant which is available through whole app?
From: Miles J
Date: Tue, 15 Feb 2011 16:52:28 -0800 PST
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 <agom...@xxxxxxxxx>
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 var in every module.
>
> Alejandro.
>
> El 15/02/2011 10:52, sanjibdhar...@xxxxxxxxx escribi :
>
> > 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 app.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (MingW32)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNWw3oAAoJEHQn9CmeN9DJjAkH/2wj9WUQsjAxsr/AacdUT2BP
> 0dwi9JE7otI/UBpPcEYzax6OfQBGn4MtT4vGv6DOoz6gzQtufg8ZGHPw5Gq0wLzx
> ICqszm8+PbQCZd3+ht/V5yjuLWYNXJ+zCCGSaBCtZxk0LfEKJ41+enxxxNBf+jL+
> 2Wr7x4kWf1wN0I1UaHicKKYhMLrID/mj/SIeMQK0WiQO2E2eCyq9XtU2iUQwUWEY
> OhLRz+GnUvQMn1vXtT3H8fkAkyj36Stx6+Pox7G2/gchM2slljC3UgDVNyeKPQu6
> RQ5ANsW4WLTA2Ey4Qz8+beoQW/2E7dJl8r/DBuDp8k4/QqntR634tRTP0VVPSbM=
> =XhXQ
> -----END PGP SIGNATURE-----

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php

<Prev in Thread] Current Thread [Next in Thread>