public function before() { parent::before(); $data = array(); $this->username = $this->param('username'); $this->template = View::forge('template'); // todo related $this->user = $data['user'] = Model_User::find_by_username($this->username); if (empty($data['user'])) { Response::redirect('welcome/404', 'location', 404); } $data['log'] = Model_Post::count(array('where' => array_merge(array(array('user_id', $this->user->id)), $this->status_where))); $this->log_count = $data['log']; Model_Post::summary_userdata($data, $this->user->id); $this->template->set_global('description', $this->user->profiles->description); $this->template->content = View::forge('user/profile', $data); // 共通tpl $this->template->title = ' | ' . $this->user->profiles->full_name . 'のログ'; }