php - cakephp routing problem (or maybe just confusion) -


I have just started learning the cakepap and working in addition to routing, as an example example, I still have complete Not sure how many works on this routing (included in the official cookbook book), after reading several documents.

My problem is with '/' root routing, I want to go to the index () function PostControler so I use it:

  router :: connect ('/', Array ('controller' => gt; 'post', 'verb' => 'index'));  

But if I go to the url, then it does not work: localhost /

This is probably (most definitely) Because I do not know where to put the cake_1_3 folder / installation, currently on my local directory (in HTDOX) my directory tree looks as follows:

- htdocs> posts> KDODO_3

< P> This means that when I navigate: Localhost / I do not get anything When I navigate to: local host / post / I do not get anything, only folder "post" the directory entry that I Directory for "Kek_l_3".

This only happens when I go to URL: Localhost / post / cake_1_3 / post / routing works, as it appears in the second "post" and Therefore, the "index" function of "postcindler" runs.

Obviously this is not what I want, I want to go here: localhost / posts / and this post uses the controller's index function.

UPDATE: I actually tried to take all the cake items of "CKDO 1_3" and J. in "POST", but then I have to go to: Localhost / Post / Post / To use the postcindler's index () function

Is there any way I can navigate only to localhost / posts / and I get the index () function to run the post controller?

I know this is probably a very simple problem and I just lost something because I'm so tired (anyway my excuse anyway), but I'm searching for about 3 hours and Now one hand will not help.

Thank you for your time,

Infinity Fiz

PS I just realized that I dump all the cakepip installation files / folders into root (HTODOS) And then localhost / post / will work, but I have separate test websites in my own folders in Htdocs and therefore I can test this post in my own folder as well. Yes, all the cakepod folders are With folders of all websites have not been mixed.

Just to be clear what directory we are talking about, a cake installation Comes with these folders: To get feedback from the

  / app / webroot / cake cake, you have to hit the top  /  directory with your browser. All paths belong to that top  /  directory. 

Let's say you have installed the cake in your web server like this:

  / htdocs / someotherproject / mycakeapp / app / webroot / cake /  The directory 

htdocs is the root of your web server. If you go to http: // localhost / , then your web server / htdocs / will not react with the contents of this cake, so the cake can not go anywhere.

To open the cake, you have to open the http: // localhost / mycakeapp / . From there, the cake will be routing it by matching the cake path router :: connect ('/', ...) url http: // localhost / mycakeapp / All cake routes are relative to the App Setup Path . Cake Routing is an app-internal routing, it does not conform to the full URL.

If you want to be http: // localhost / to be your cake app, the cake will need to be the only app to live in / htdocs / You can not have many apps in your root and any of them can be "root app". † ‡.

For local development purposes, it should be absolutely correct. When you upload an app on a real server with the actual domain, you usually make it another app.


† You can , , with detailed rewriting - in the rule, virtual host configuration, or in the / app / webroot / folder of cake By placing files, however, generally it is more difficult to compare, keep your projects separate.
‡ You can not make your own cake and eat it, also Zing


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -