sloga
sloga

Reputation: 642

cakephp routing views within sub directory

How do I connect to a view in a subfolder in cakephp 1.3? If I organize folders in my Views like:

Views/my_folder/my_subfolder/mypage.ctp

How do I connect to the mypage.ctp view in routes? I've tried the following:

Router::connect('/my_folder/my_subfolder/mypage',
array('controller' => 'my_folder', 'action' => 'mypage'));

The above does not work. Is there a different way to write the connection in routes.php?

I want the url to be: www.mysite.com/my_folder/my_subfolder

Upvotes: 1

Views: 1233

Answers (2)

Md.Jewel Mia
Md.Jewel Mia

Reputation: 3451

Please check it

Router::connect( '/foldername', array('controller' => 'controllername', 'action' => 'functionname'));

Upvotes: 0

ptica
ptica

Reputation: 747

the Pages controller looks for views in Views/Pages so move your mypage.ctp there.

The structure of Views folder is guided by conventions, mapping from url to controller+action is the only thing that you change via routes.

Upvotes: 1

Related Questions