0

I am moving my website to use cake php and before i would just have to include an image like this in my project print("<img class='custom' alt='' src='$dish_image' />"); as you can see I included the css class to be used. But now with cake php I am not sure how to achieve as my image tag looks like this

 echo $this->Html->image($dishes['Dish'][0]['dish_image'], array("alt" => ""));

So i am not sure where to apply that custom css to it... The css is in a separate css file.

Any help would be appreciated/

1 Answer 1

3

This should do it:

<?php echo $this->Html->image($dishes['Dish'][0]['dish_image'], array(
    "class" => "custom",
    "alt"   => ""
    )); ?>

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.