Witajcie!
Męczę się już 2h i rozkłądam ręce...

Chcę zrobić osobną(inną) stronę logowania bez wykorzystania template'u i tu pojawia się problem.

początek kontrolera:
  1. class Controller_Dziennik extends Controller_Base
  2. {
  3. public $template= 'dziennik/template';
  4. ...

Strona główna, rejestracja, i inne dynamczne podstrony wykorzstują coś takiego:
  1. public function action_index()
  2. {
  3. $this->template->title = 'Dashboard';
  4. $this->template->content = View::forge('dziennik/dashboard');
  5. }

Logowanie jest ciut bardziej skomplikowane:
  1. public function action_logowanie()
  2. {
  3. // Already logged in
  4. Auth::check() and Response::redirect('dziennik');
  5.  
  6. $val = Validation::forge();
  7.  
  8. if (Input::method() == 'POST')
  9. {
  10. $val->add('email', 'Email or Username')
  11. ->add_rule('required');
  12. $val->add('password', 'Password')
  13. ->add_rule('required');
  14.  
  15. if ($val->run())
  16. {
  17. $auth = Auth::instance();
  18.  
  19. // check the credentials. This assumes that you have the previous table created
  20. if (Auth::check() or $auth->login(Input::post('email'), Input::post('password')))
  21. {
  22. // credentials ok, go right in
  23. if (Config::get('auth.driver', 'Simpleauth') == 'Ormauth')
  24. {
  25. $current_user = Model\Auth_User::find_by_username(Auth::get_screen_name());
  26. }
  27. else
  28. {
  29. $current_user = Model_User::find_by_username(Auth::get_screen_name());
  30. }
  31. Session::set_flash('success', e('Welcome, '.$current_user->username));
  32. Response::redirect('dziennik');
  33. }
  34. else
  35. {
  36. $this->logowanie->set_global('login_error', 'Błędny login lub hasło!');
  37. }
  38. }
  39. }
  40.  
  41. $this->logowanie->title = 'Logowanie';
  42. $this->logowanie->content = View::forge('dziennik/logowanie', array('val' => $val), false);
  43. #Return View::forge('dziennik/logowanie');
  44. }


I tu pojawia się problem - nie chcę w logowaniu szablonu pozostałych podstron, natomiast chcę zachować możliwość przekazwyania statusu logowania do szablonu.
Chamskie obejście: public $logowanie= 'dziennik/logowanie'; nie działa(Attempt to assign property of non-object)

Mam nadzieję, że zrozumieliście ten chaos, z góry wielkie dzięki za pomoc!
PS: Dopiero zaczynam przygodę z obiektówką więc jeśli jest to błachy problem to przepraszam za niewiedzę smile.gif