Advertisement
eerrtt

Untitled

Aug 11th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. 'urlManager' => array(
  2. 'urlFormat' => 'path',
  3. 'urlSuffix' => '.htm',
  4. 'rules' => array(
  5. '' => '/site/index',
  6. 'aktualnosci' => '/site/news',
  7. 'kontakt' => '/site/contact',
  8. 'o-firmie' => '/site/about',
  9. 'portfolio/<slug>' => '/portfolio/category',
  10. 'portfolio/<slug1>/<slug2>' => '/portfolio/view',
  11. )
  12. ),
  13.  
  14. <?php
  15.  
  16. class PortfolioItemController extends Controller
  17. {
  18. /**
  19. * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
  20. * using two-column layout. See 'protected/views/layouts/column2.php'.
  21. */
  22. public $layout='//layouts/site';
  23.  
  24. /**
  25. * @return array action filters
  26. */
  27.  
  28. /**
  29. * Displays a particular model.
  30. * @param integer $id the ID of the model to be displayed
  31. */
  32. public function actionView($slug1, $slug2)
  33. {
  34. $model = PortfolioItem::model()->findByAttributes('slug' => $slug);
  35. if($model === null)
  36. throw new CHttpException(404, 'Nie znaleziono realizacji');
  37.  
  38. $
  39.  
  40. $this->render('view',array(
  41. 'model'=>$model,
  42. ));
  43. }
  44.  
  45. public function get
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement