joomla3.0 - How to add a bootstrap class to JHtml in Joomla -
I am using the following piece of code to display an image that I am receiving from gravatar.com So, to make it more attractive as a bootstrap CSS class, I add a style instead of showing the image, it shows me a link to the image, when I redirect to the link, I am able to see the image. Why am I getting this?
$ html [] = JHtml :: _ ('image', $ grav_url, 'class = "img-circle"', JText :: _ ('PLG_CONTENT_AVATAR'), empty, true ) Here is the URL I'm getting for the image: $ grav_url and the img-circle I want the bootstrap class to be used .
I believe the library you are using is here:
Then you can see in the parameter list that the $ attribs is the absolute value for the type array. The second thing is that you have an extra $ Alt is the paragraph which you may have that your jettext is just out of sequence. To do this, you have to do this: $ html [] = JHtml :: _ ('image', $ grav_url, JText :: _ ('PLG_CONTENT_AVATAR'), array ('Class ==> 'img-circle'), true) Or you can create an array outside the method as a variable:
$ Attribs = array (); $ Attribs ['class'] = 'IMG-Circle'; // I think this should work? Although not tested. $ Html [] = JHtml :: _ ('image', $ grav_url, JText :: _ ('PLG_CONTENT_AVATAR'), $ attribs, true)
Comments
Post a Comment