2014-11-21 71 views
0

我開始學習cakephp了,我做了一些事情但我怎麼能運行它?在哪裏我可以看到我做了什麼,看看它的作品?我想運行我的cakephp代碼

我試着在URL欄中輸入/app/View/Posts/index.ctp。

謝謝!

回答

2

我想你必須讀這個:http://book.cakephp.org/2.0/en/getting-started.html

您的網址取決於很多參數,路由器,控制器。

缺省情況下使用:

當網址爲:site.com/presentation/user/a/b/c

它稱之爲 「presentationController」,而這個控制器的 「用戶」 的方法。並添加參數a,b,c。

你的控制器看起來

PresentationController extends AppController{ 

    //$param 1 = a , $param2 = b , $param c=3 (in the example above) 
    //it will call the view (by default again) View/presentation/user.ctp 
    public function user($param1,$param2,$param3){ 
     //do what you want with params or call models or others... 
    } 
} 
+0

好,謝謝! :) – Erki 2014-11-21 11:07:00