| CakePHP Official Site · Rules and Regulations |
Help
Search
Members
Calendar
Shoutbox
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| autolycus |
Posted: Apr 24 2011, 12:53 AM
|
|
Newbie ![]() Group: Members Posts: 3 Member No.: 2803 Joined: 24-April 11 |
I am learning cakephp and my installation is as follow
localhost/wordpress/cakephpapplication now I created a basic page and in the elements I created the top navigation links. I wanted to create an About us page, so under pages folder, where I have my home.ctp page, I created a page called about.ctp. Then in elements top.ctp page I entered the link as <li><a href="wordpress/pages/about">About Us</a></li> and when I click it doesnt find the page. Then I tried this <li><a href="/pages/about">About Us</a></li> and that didnt work either |
| Oldskool |
Posted: Apr 25 2011, 09:40 AM
|
||
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 46 Member No.: 2748 Joined: 23-March 11 |
You don't want to be adding links manually. Use the HtmlHelper link function instead, like this:
That way Cake will figure out what the right URL to the page is, saving you a lot of headaches Also try reading the basics/tutorial on http://book.cakephp.org/ , it covers these kind of essential things. |
||
| winniwinter |
Posted: Nov 10 2011, 02:39 PM
|
||||||||
|
Newbie ![]() Group: Members Posts: 1 Member No.: 3206 Joined: 10-November 11 |
Hi, this post is a little bit older but I am also currently learning cakephp and stuck on a linking problem too. I'm using this Code
My Project is located under localhost/test what I expect is that:
what I got is:
even if I put out the whole URL I get:
Is the line of code wrong or do I have to customize something with routes?! |
||||||||
| Sir P |
Posted: Nov 13 2011, 03:15 PM
|
||||||
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 500 Member No.: 217 Joined: 13-February 08 |
Hello winniwinter, When you use the url attribute I don't think you can pass the controller value..try not something like this (untested) ...
As I said, that is untested. A sure fire way (not very cake though) would be:
Or even:
Have a play. Good luck. -------------------- |
||||||
| cindyhorneto |
Posted: Apr 13 2012, 08:59 AM
|
![]() Newbie ![]() Group: Members Posts: 1 Member No.: 3435 Joined: 13-April 12 |
I'm just geeting started with this one, where should I start guys?
-------------------- Some things must never be said
|
| Sir P |
Posted: Apr 13 2012, 10:25 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 500 Member No.: 217 Joined: 13-February 08 |
-------------------- |
| maskodook |
Posted: Apr 18 2012, 11:55 PM
|
||
|
Newbie ![]() Group: Members Posts: 2 Member No.: 3447 Joined: 18-April 12 |
hey mr you can use this way:
this code: Router::url('/',true); definiting about your base url: http://localhost/wordpress/blabla/ /pages/about : controller = pages | action = about okey, hopefully help sorry, if my bad english: D -------------------- ::: My Home: http://id-webmaster.com | Follow Me: @maskodook :::
|
||
| noahwilson |
Posted: May 8 2013, 10:27 AM
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 88 Member No.: 3816 Joined: 30-March 13 |
So nice thread, thanks to all of you for sharing your suggestion. its really so hlepful for me.
-------------------- |
![]() |
![]() ![]() ![]() |