Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ProducerController.php 882B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace producer\controllers;
  3. class ProducerController extends CommonController {
  4. /**
  5. * @inheritdoc
  6. */
  7. public function behaviors() {
  8. return [];
  9. }
  10. public function actions() {
  11. return [
  12. 'error' => [
  13. 'class' => 'yii\web\ErrorAction',
  14. ],
  15. ];
  16. }
  17. public function actionIndex() {
  18. $etablissement = Etablissement::findOne(['slug' => Yii::$app->getRequest()->getQueryParam('slug_producer')]) ;
  19. $points_vente = [] ;
  20. if($etablissement) {
  21. $points_vente = PointVente::find()
  22. ->where([
  23. 'id_etablissement' => $etablissement->id,
  24. ])
  25. ->all() ;
  26. }
  27. return $this->render('index',[
  28. 'points_vente' => $points_vente
  29. ]) ;
  30. }
  31. }
  32. ?>