You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 line
1.1KB

  1. <?php
  2. namespace producer\components ;
  3. class ProducerView extends \yii\web\View {
  4. var $producer ;
  5. var $page_title ;
  6. var $subtitle ;
  7. public function getProducer() {
  8. $etablissement = Etablissement::findOne(['slug' => Yii::$app->getRequest()->getQueryParam('slug_producer')]) ;
  9. if($etablissement)
  10. return $etablissement;
  11. else
  12. throw new \yii\web\HttpException(404, 'Etablissement introuvable');
  13. }
  14. public function setTitle($title, $icon = '') {
  15. $this->title = $title ;
  16. $this->page_title = $title ;
  17. }
  18. public function getTitle() {
  19. return $this->title ;
  20. }
  21. public function setPageTitle($page_title) {
  22. $this->page_title = $page_title ;
  23. }
  24. public function getPageTitle() {
  25. return $this->page_title ;
  26. }
  27. public function setSubtitle($subtitle) {
  28. $this->subtitle = $subtitle ;
  29. }
  30. public function getSubtitle() {
  31. return $this->subtitle ;
  32. }
  33. public function getTitleIcon() {
  34. return $this->icon ;
  35. }
  36. }