Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Call to undefined method in SimpleGroup
  • Hello,
    I have a problem with SimpleGroup. After loggin in I want check useradmin group via call method:
    if ( ! Auth::member(100))
    {
        echo 'access denied';
    }
    
    This code couse an error:
    ErrorException [ Error ]: Call to undefined method Auth\Auth_Group_SimpleGroup::group()
    PKGPATH/auth/classes/auth/login/driver.php @ line 132
    127
    128 if ($driver === null)
    129 {
    130 foreach (\Auth::group(true) as $group)
    131 {
    132 if ($group->group($group, $user))
    133 {
    134 return true;
    135 }
    136 }
    137
    Is there a bug or sth ? Why I can't access to method $group->group() in foreach() loop ?
  • Because an the Auth\Auth_Group_SimpleGroup class doesn't have a group() method and thus calling that method upon instances of that class won't work, exactly as the error message says.
  • thanks for reply. I setup new installation and it works (previously I used an example with validation from jsidhu via Github)
    problem solved
  • Ah, sorry I didn't notice the error was from the Auth package. You were probably using an older version of Fuel that had this bug..?
  • Yep, I used this: https://github.com/jsidhu/FuelPHP-Auth-AJAX . It is probably v 1.0

Howdy, Stranger!

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

In this Discussion