as AD said
$this->Helper prevents conflicts that happened quite often with
<=cake1.2
you can always put your custom method in your AppHelper or enhance the
HtmlHelper like so:
function imageLink($img, $url, $options) {}
$img should be the final img tag from $this->Html->image()
array('escape' => false) would be the only thing that you save.
defaults to true automatically then.
so you have to decide for yourself if it is worth it...
thinking about it - maybe you could invent sth like
function imageLink($imgUrl, $linkUrl, $imgOptions = array(),
$linkOptions = array()) {}
then you would only need the url of the img passed (internally calls
$this->Html->image() then)
either way there is a reason why this is not part of the core
you gain almost nothing...
On 18 Okt., 15:04, AD7six <[email protected]> wrote:
> On Oct 18, 2:48 pm, Glauco Custódio <[email protected]> wrote:
>
> > Hi there, I was reading CakePHP 2.0 docs and I would like to solve some
> > doubts.
>
> > - DboMysqli was removed, we will support DboMysql only. Why? Mysqli is not
> > better than Mysql??
>
> pdo automatically uses mysqli if it's available.
>
>
>
> > - $this->Form->input() instead $form->input(). The second way is not faster
> > and shorter to type?
>
> You can't lazy load $randomname; you can lazyload $this->randomname.
> It is faster to execute, and prevents variable name conflicts.
>
>
>
> > - isAjax() was deprecated?
>
> replaced with is('ajax')
>
>
>
> > Suggestions
>
> > I think that it would be good whether Cake had a method to create images
> > inside links easier than to use $this->Html->link($this->Html->image(), '#',
> > array('escape' => false));
>
> Use the docs
> Glaucohttp://api.cakephp.org/class/html-helper#method-HtmlHelperimage
>
> > I worked with a php framework called SpaghettiPHP (very similar with CakePHP
> > 1.x)
>
> It's similar because it copied CakePHP as a start point.
>
> > that implemented a method called imagelink, where we just needed to
> > pass the image path as first arg and the link as second arg, besides came 2
> > arrays of options to both tags.
>
> It was removed from cake because it wasn't simpler than using ->image
> or ->link(->image)
>
>
>
> > Thank you and congratulations for CakePHP project, it's really a good work.
>
> Enjoy :)
>
> AD
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php