-2

I am a total rookie in CakePHP.

I have this code in the index file of my CakePHP project

$Dispatcher->dispatch(
    new CakeRequest(),
    new CakeResponse()
);

What does this code do? Is it calling the content of the index.php file?

I want to change the index page and I cannot find where the content is coming from.

user115014
  • 922
  • 14
  • 23
gegham
  • 462
  • 1
  • 10
  • 15
  • 3
    My advice to you is don't touch any of CakePHP's core files, especially if you are 'totally rookie'. If you want to change the index page for your website, find the controller and view that is rendering the default view and edit that. – scrowler May 29 '14 at 22:07
  • [This answer](http://cakephp.1045679.n5.nabble.com/Index-php-s-controller-tp1312888p1312893.html) might help you understand better what you are asking. – mathielo May 29 '14 at 22:09
  • Actually it's not a core file @scrowler , but part of the application code, the applications front controller. However if someone doesn't even know what the dispatcher does, and how to change page contents, then it's definitely advised not to mess with that file :) I'd suggest to start with the [**Cookbook**](http://book.cakephp.org/2.0/en/index.html) for some CakePHP basics. – ndm May 30 '14 at 09:59

1 Answers1

0

A simple Google search can answer this.

Basically this is a function that dispatches new requests and responses into controller actions. Anytime a user does an action, this function will work.

Your question: "Is it calling the content of the index.php" is a little shortsighted of it's overall purpose. It affects a lot more than that. That said, it's definitely suggested that you don't mess with it.

I think the question you should be looking for is "How do I change the content of index.php using CakePhP".

sparky
  • 106
  • 7