query() is a method of your Model, and not your Controller.
So, you've successfully set up that method and it seems to be working.
Just an incorrect call to query. Try something like:
function getConfig($name) {
$ret = $this->{$this->modelClass}->query("SELECT value FROM config WHERE
name='".$name."'");
$wynik = $ret[0]['value'];
return $wynik;
}
It is a little bit dodgy though. What I do for my config values is
whenever I need a config value in a particular controller i set the
$uses variable to include my ConfigOption model. Then I access the
value directly via the correct model using find or read.
Does this help?
cheers,
freedom
On 25/08/06, kacperix <[EMAIL PROTECTED]> wrote:
>
> Hello.
>
> I have in my app_controller.php file that function:
>
> function getConfig($name) {
> $ret = $this->query("SELECT value FROM config WHERE
> name='".$name."'");
> $wynik = $ret[0]['value'];
> return $wynik;
> }
>
>
> And when I want to access to this function I' got on screen:
>
> Fatal error: Call to undefined method UsersController::query() in
> /home/lovers/ftp/app/app_controller.php on line 53
>
> How i do to make this? Please help.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---