class Controller_Base extends Controller_Template
{
protected $images_path = '';
protected $images_store = '';
public function before()
{
parent::before();
$this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
$this->images_path = Auth::check() ? Uri::base(false).'upload'.DS.$this->current_user->username.DS : null;
$this->images_store = Auth::check() ? DOCROOT.'upload'.DS.$this->current_user->username.DS : null;
View::set_global('current_user', $this->current_user);
View::set_global('images_path', $this->images_path);
}
}
class Controller_Welcome extends Controller_Base
{
public function action_profile()
{
$user = Model_User::find($this->current_user->id);
$this->template->set_global('user', $user, false);
$this->template->content = View::forge('welcome/profile');
}
}
$this->template->set_global('user', $user, false);
View::set_global('current_user', $this->current_user, false);
View::set_global('images_path', $this->images_path, false);
It looks like you're new here. If you want to get involved, click one of these buttons!