Page List block - "Core::make('html/image', array($thumbnail))"

Permalink 1 user found helpful
In this php file:
concrete\blocks\page_list\view.php

In page block deafult (lines 99-104). This code add the thumbnail attribute to the page list view.

//  code 1.
<?php
100     $img = Core::make('html/image', array($thumbnail));
101     $tag = $img->getTag();
102          $tag->addClass(img-responsive');
103          print $tag;
?>


In the same file - comment guide say "HOW TO USE IMAGE ATTRIBUTES:"
//code 2  
72       * HOW TO USE IMAGE ATTRIBUTES:
73       * 1) Uncomment the "$ih = Loader::helper('image');" line up top.
74       * 2) Put in some code here like the following 2 lines:
                 ....the rest of the php file


What the difference between this codes ?
Two of them work for me - but i dont understand option 1 concept (its not use helper - so what is it? )

siton
View Replies: View Best Answer
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi siton,

The code in the first example creates a responsive picture element. The code in the second example is used to create an img element, with an image that can be resized or cropped to a specific size.

Each approach has its benefits and will depend on what you are trying to accomplish.
ramonleenders replied on at Permalink Reply
ramonleenders
Also, this code is deprecated:

Loader::helper('image')


Should be now:

Core::make('helper/image')
siton replied on at Permalink Reply
siton
Thanks