Friday, February 25, 2011

Re: $this->Html->link with javascript back()

> can't find out how to resolve:
>
> <a href="javascript:history.back()">go back</a>
>
> with:
>
> $this->Html->link


you can do

echo $this->Html->link('go back',"javascript:history.back()");


i think its much better to add

$this->set('referer',$this->referer());

to your beforeRender();

and

$this->Html->link('back',$referer);

to your view.

one less reliance on js is a win in my book.


Mike Karthauser
Managing Director - Brightstorm Ltd

Email: mikek@brightstorm.co.uk
Web: http://www.brightstorm.co.uk
Tel: 07939 252144 (mobile)
Fax: 0870 1320560

Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: