TopicController.php 436 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\controllers;
  3. use app\models\Topic;
  4. class TopicController extends \lithium\action\Controller {
  5. public function index()
  6. {
  7. //We'll write this eventually
  8. }
  9. public function view($topicname)
  10. {
  11. $topic = Topic::find('first', array('conditions' => compact('topicname')));
  12. }
  13. public function new()
  14. {
  15. if ($this->request->data)
  16. {
  17. $topic = Topic::create($this->request->data);
  18. $topic->save();
  19. }
  20. }
  21. }