Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Controller_Blog extends Controller_Template
- {
- /**
- * Page D'index du blog
- *
- * @access public
- * @return Response
- */
- public function action_index()
- {
- $posts = Model_Post::find('all');
- $data = array('posts' => $posts);
- $this->template->title = 'Créatux : Blog';
- $this->template->content = View::forge('blog/index', $data, false);
- }
- /**
- * Page de vue d'un article
- *
- * @access public
- * @return Response
- */
- public function action_view($id)
- {
- $post = Model_Post::find('first', array(
- 'where' => array(
- 'id' => $id
- )
- ));
- $data = array('post' => $post);
- $this->template->title = $post->title;
- $this->template->content = View::forge('blog/view', $data, false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement