Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
php error
  • hi ,
    i use condition in  models.

    protected static $_conditions = [
            'where' => [
                ['system_id', \Config::get('system_id')]
            ]
        ];

    error : ErrorException [ Compile Error ]:
    Constant expression contains invalid operations

    i know this is php error not fuel, but i need help

    how can i set this condition value?
  • HarroHarro
    Accepted Answer
    Use the _init method:

    public static function _init()
    {
        static::$_conditions['where'] =  ['system_id', \Config::get('system_id')];
    }

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion