2013-09-27 47 views
-1

我搜索了Google但我沒有找到我的答案。創建表格而不使用Gii

我已經在yii中創建了一個小webapp。現在我正在手動製作相同的應用程序,以探索其(Yii)的更多未來。

我想知道如何創建窗體,型號&控制器沒有使用Gii工具。我知道這個使用Gii的東西。

請向我推薦任何解釋逐步過程的文檔或教程。

我有推薦this link,但目前還不清楚。

再次感謝您。

+0

只是手工編寫他們......或者......用GII :)) –

+0

我找的一些代碼樣本啓動生成它們... –

+1

就產生形式和調整您的需要或採取爲例並從頭創建 – 2013-09-27 06:54:23

回答

2

你可以參考this forum得到啓動對你的代碼...

,然後你可以通過this wiki更多的參考..

希望它可以幫助你......

從文檔實例形式:

class LoginForm extends CFormModel 
{ 
    public $username; 
    public $password; 
    public $rememberMe=false; 

    private $_identity; 

    public function rules() 
    { 
     return array(
      array('username, password', 'required'), 
      array('rememberMe', 'boolean'), 
      array('password', 'authenticate'), 
     ); 
    } 

    public function authenticate($attribute,$params) 
    { 
     $this->_identity=new UserIdentity($this->username,$this->password); 
     if(!$this->_identity->authenticate()) 
      $this->addError('password','Incorrect username or password.'); 
    } 
} 
+0

-1可以發表評論 – Kalpit

0

你可以試試這個:
爲了產生控制器:
生成MessageController.php
爲了產生的觀點:
第一化妝目錄
MKDIR/Webroot的/演示/保護/視圖/消息
生成helloworld.php
生成的index.php