Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /yii2images/images/image-by-item-and-alias?item=Product1&dirtyAlias=b6e73413ff-1_50x50.jpg
  2.  
  3. <?php $imageOne = $model->getImage(); ?>
  4.  
  5. <?= DetailView::widget([
  6. 'model' => $model,
  7. 'attributes' => [
  8. 'id',
  9. 'title',
  10. 'alias',
  11. 'price',
  12. [
  13. 'attribute' => 'imageOne',
  14. 'value' => '<img src="' . $imageOne->getUrl('50x50') . '">',
  15. 'format' => 'raw',
  16. ],
  17. 'status',
  18. 'frontpage',
  19. 'primary_category',
  20. 'sku',
  21. 'short_desc:ntext',
  22. 'full_desc:html',
  23. ],
  24. ]) ?>
  25.  
  26. 'urlManager' => [
  27. 'enablePrettyUrl' => true,
  28. 'showScriptName' => false,
  29. 'enableStrictParsing' => false,
  30. 'rules' => [
  31. 'category/<alias>/page-<page:d+>' => 'category/view',
  32. 'category/<alias>' => 'category/view',
  33. 'product/<id:d+>' => 'product/view',
  34. 'page/<alias>' => 'page/view',
  35. 'search' => 'category/search',
  36. ],
  37. ],
  38.  
  39. 'as access' => [
  40. ...
  41. 'yii2images/*',
  42. ],
  43.  
  44. 'image' => 'yii2images/images/image-by-item-and-alias',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement