Recent Posts
- (02/24) Calling an Element from a Helper TAGS:CakephpWeb ProgrammingUsageTutorialExample
- (10/14) Forcing A Single Join in CakePHP PaginationTAGS:CakephpCakephp 13DatabaseErrorsHabtmMysqlMssqlWeb ProgrammingUsage
- (08/11) Inserting NOW() into MySQL Using CakePHPTAGS:CakephpDatabaseMysqlMssqlWeb ProgrammingUsage
- (08/07) Best PaginateCount for CakePHP - with Group By SupportTAGS:CakephpBehaviorsWeb ProgrammingUsageDatabaseExampleMysqlHabtmHack
- (04/03) CakePHP Error Messages Not Showing on FormTAGS:CakephpCakephp 13Web ProgrammingErrorsUsage
- (02/06) Sorting Paginated Results Using a Related Model Field in CakePHPTAGS:CakephpWeb ProgrammingUsageExample
- (11/02) Changing CakePHP's Model useTable on the FlyTAGS:CakephpWeb ProgrammingMysqlDatabaseExampleTutorial
- (10/18) The Funniest Error Message Ever - Thank You EclipseTAGS:EclipseWeb ProgrammingErrorsHumorWindowsUsageSoftwarePhpCakephp
Subscribe to my feed
MainelyDesign.com Blog
Adding Anchors to Your CakePHP Generated Urls (#link)
Posted on 07/02/2009 at 09:02 am by Kevin Wentworth
Viewed 11,415 times | 6 comments
This may seem simple and trivial, but it took me a little while to figure out. If it saves someone a little trial-and-error then great (I know I won't forget how to do it).
I needed to create a redirect in CakePHP that redirected to an inline, on-page anchor- <a name="destination">Scroll to Here</a>. Typing the link directly into the address bar of the browser, it would need to look like this: http://www.mainelydesign.com/blog/view/1219/#destination. The #destination is what I needed to figure out how to append to the redirected url. Turns out it was easy...
Use the Pound Sign (#) as a Key in Your Link Options
- echo $html->link('Click Me, Please', array('controller'=>'blog', 'action'=>'view', 1219, '#' => 'destination'));
or, Use the Pound Sign (#) as a Key in Your Redirect Call
That was easy wasn't it? Note the '#'=>'destination'. Sometimes it's the easy things that can stop and make you think, though.
Cheers,
-Kevin Wentworth
Tags for Adding Anchors to Your CakePHP Generated Urls (#link)
Cakephp | Web Programming | Usage | Usability
Comments for this Posting
Posted by bancer
on 29/4/10
The same result you can achieve with
echo $html->link('Click Me, Please', array('controller'=>'blog', 'action'=>'view', 1219, '#destination'));
Posted by ingenuppy
on 24/1/11
It is my great pleasure to visit your website and to enjoy your awesome posts, I appriciate that very much. I know that you put much attention in those topics, as all of them make sense and are very useful.
Naked Girls
Posted by MoorieProri
on 24/1/11
What's Happening everybody, charming board I find It absolutely accommodating & it has helped me alot
I hope to be able to contribute & help others like this website has helped me
_________________
jailbreak iphone 4.2.1
Posted by acculouro
on 23/2/11
Unlock iPhone 4
Unlock iPhone 3GS
Unlock iPhone 4.2
Unlock iPhone 4.3
iPhone Unlock
how to unlock iphone
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!

Posted by SooxnogYBix
on 5/3/10
Wassup, First time here, this site seems like a very informative board.
Will try to help in to the best I am able :)