0

How can I create html link that has text and image both using cakephp Html helper as below

<a href="#">
    <img src="images/icons/web-app/48/add-user.png" width="48" height="48"> Add User
</a>

I want final result as

enter image description here

I know that I can do that with css, but I just want to know how is it possible using cakephp

1 Answer 1

7
echo $this->Html->link($this->Html->image('design/unige_logo.png', array('width' => '48', 'height' => '48')) . ' ' . __('Add user'),
                       '#',
                       array('escape' => false));
Sign up to request clarification or add additional context in comments.

3 Comments

@nIco sir what if the text is first before the image?
@SOS then just swap the text and the image on the first line
@niCo I tried to swap it but it prompts a syntax error, can you elaborate swap?

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.