Skip to content

Conversation

abhimanyu003
Copy link
Contributor

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

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you do this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but since the foreach loop will not have any effect in this case the test is not useful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants