~cakephp some related questions, high score!

Source: Internet
Author: User
~~~cakephp Some of the problems, high scores to help!!
I was just starting to see cakephp and now I'm having some problems.
1, I want to know if Access http://www.yuming.com/when the default controller is what, searched for a long time, did not find.
2, now I wrote a home (model), HomeController, Home (view), successfully run, but show my content is only in an HTML inside the div id= "content" inside the display. I didn't write any of the above HTML headers. Cake is automatically called. Can you block it out?

------Solution--------------------
Cake website home page By default is APP/VIEWS/PAGES/HOME.CTP control display, in addition you say the so-called header information can be the default layout file APP/views/layouts/default.ctp control.


------Solution--------------------
Set $layout in your controller to block out the default DEFAULT.CTP
You can set it to empty, or set it to your own template



------Solution--------------------
There is a routes.php in the Config directory, that is, the routing settings
Router::connect ('/', Array (' controller ' = ' + ' pages ', ' action ' = ' display ', ' home ');

The default is home,
Here you can change to your own controller and action
------Solution--------------------
Now the cakephp1.3 version of the manual description is more detailed, it is recommended that LZ can look at from the beginning seriously.
------Solution--------------------
The default controller for cakephp is Pagescontroller. The corresponding model is page, and the database table name is pages. The view file is placed in the VIEWS\PAGES\HOME.CTP. This is the default invocation of CakePHP's controller.
The master page you are talking about is under the cake lib by default, but this is best not to change it. You should redefine it in the VIEWS\LAYOUTS\DEFUALT.CTP.
This is probably the case, I wish the landlord early success ~ Get points!!
------Solution--------------------
The default files in cakephp are in CAKE/LIBS/VIEW/LAYOUTS/DEFAULT.CTP
You can just write it down. It's not that hard ~
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.