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)
- {
- if ($id and ctype_digit($id) and $post = Model_Post::find($id))
- {
- $data = array('post' => $post);
- $this->template->title = $post->title;
- $this->template->content = View::forge('blog/view', $data, false);
- }
- else
- {
- // handle your not-found
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement