| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Added ability to add attributes like `id` , `class`, `alt` to html() method
Uses
Image::open('open.jpg')->html($title = 'some title', $type = 'jpg' , array('class'=>'test pull-right','id'=>'test','alt' => 'name')));
`NULL` can also be provided if don't want any attributes just want to change the image quality
There was a problem hiding this comment.
Why do you do this test?
Sorry, something went wrong.
There was a problem hiding this comment.
If you don't want to set any attribute, only want to change the quality of image you can pass null and empty array or no array at all. That will just change the quality of image and no attribute are added to the output.
Eg: html('title','jpeg','',20)) or html('title','jpeg',NULL,20)) or html('title','jpeg',array(),20))
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, but since the foreach loop will not have any effect in this case the test is not useful
Sorry, something went wrong.
There was a problem hiding this comment.
foreach is not execute only when you pass the NULL , if you pass an empty array or and empty string it will executed at least one time
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Added ability to add attributes like id , class, alt to html() method
Uses
Image::open('open.jpg') ->html($title = 'some title', $type = 'jpg' , array('class'=>'test pull-right','id'=>'test','alt' => 'name')));NULL can also be provided if don't want any attributes just want to change the image quality