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
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
-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
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'
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
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 `',''
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
>
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
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', '
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
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
11 matches
Mail list logo