0
votes

In CakePHP blog tutorial, http://book.cakephp.org/view/1536/Creating-Post-Views

there is a code for index.ctp

Html->link($post['Post']['title'], array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?>

Why is it array('controller'=>'posts") ? aren't control names capitalized and it's called PostsController?

1

1 Answers

1
votes

This would be the name of the controller as it would appear in the url. Since this is an HTML link you would want the element to point to the correct url, in this case pages/view/$id. If you said PagesController/view/$id it could very well be interpreted as needing the class PagesControllerController, this is probably unwanted behavior.