I have a small application. I have written some of the code in index.ctp file and this file is working fine. Now I have added another function called add to my Controller file and also created a seperate file called add.ctp in Views folder.
My doubt is how to navigate to add.ctp file if I click a link. I want to create a menu in my main file and write a link so that when I click on that link the page must navigate to add() function.
My problem is:
- How to write href in cake php?
- What link do I provide? Controller or Views?
The manual would be a good place to start your CakePHP journey. Then you’d quickly notice it’s very easy to link to a controller action from your views with: