Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NEWS INDEX
- ==========
- <h2>News Index</h2>
- <a href="<?php echo APP_ROOT;?>news/create">Add News</a>
- <?php
- foreach($this -> data as $news) {
- var_dump($news);
- echo '<div'.$news['title'].'</div';
- echo '<div'.$news['content'].'</div';
- }
- NEWS CONTROLLER
- ===============
- //Ausgabe im View
- public function view()
- {
- $this -> view -> data = $this -> view -> model -> showNews();
- $this -> view -> render('news/index');
- }
- NEWS MODEL
- =========
- public function showNews()
- {
- $res = $this -> db -> query("SELECT * FROM news");
- return $res -> fetch_all(MYSQL_ASSOC);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement