上次用 Gii 的CRUD Generator 幫我們建立了一些基本的框架, 我們來看一下Gii 建立的程式碼是如何運作的。
記得我們要連上 Courses 的網址是 http://localhost/MyWebSite/index.php?r=courses 其中 r=courses 會把我們導向 controllers/CoursesController.php 由於後面沒有參數了因此預設等同於 http://localhost/MyWebSite/index.php?r=courses/index 也就是會由 CoursesController.php 裡面的
public function actionIndex() 來處理我們的請求。