views:

24

answers:

1

Ok, sorry for this upcoming rookie question..

I was looking for a good user management plugin for cake, and i was recommended Authsome (if someone knows anything better>> plz recommend).

Anyway, i'm trying to set it up using the git's readme (very simple) but im running into a problem: t_string error. Code:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /Applications/XAMPP/xamppfiles/htdocs/trainer/app/controllers/users_controller.php on line 7

Code users_controller:

<?php
class UsersController extends AppController {

 var $name = 'Users';
 var $scaffold;

 $guest = Authsome::get();
 debug($guest);


}
?>

So, its basic-the-la-basic.. but its driving me nuts! Could anyone plz help me? thx in advance...

+3  A: 

You will want to put your executing code inside a function. It's illegal at this point in the class.

class UsersController extends AppController {

  var $name = 'Users';
  var $scaffold;

  function myMethod() {
    $guest = Authsome::get();
    debug($guest);
  }

}
deceze
aaaah thanks!!! thank u very very much! haha, this WAS a rookie mistake.. haha :) thx!
Maurice Kroon