Re: Nested Html Helpers
On Fri, Jan 11, 2013 at 9:38 AM, <asmith@protechmsp.com> wrote:
> This is my first post so bare with me.
>
> How do you nest html helpers in cakePHP 2.x?
You need to get your terminology straight first. A "helper" is class
for creating or manipulating your view output. What you seem to be
asking is how to get the HtmlHelper to create nested HTML tags.
> I'd like to have a logo as a link and apply an inline style to it.
echo $this->Html->link(
$this->Html->img(
'path/to/the/image',
array(
'width' => xxx,
'height' => yyy,
'alt' => 'blah blah blah',
'style' => 'for styling the img tag'
)
),
array(
// route or URL here
),
array(
'style' => 'for styling the a tag',
'escape' => false // important when wrapping an img
)
);
> I'd like to have a link and wrap it in a $this-Html-div() helper
Keep in mind that you don't have to use the helpers for everything.
You could just do:
<div><?php echo $this->Html->link(...); ?></div>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home