yii-events

    -1熱度

    4回答

    iam試圖在yii web應用程序中寫入文件代碼在視圖文件中,我想在保護/配置文件夾中寫入一個文件可以建議我fopen ($file,'w'); 我以下如何是下面的錯誤被拋出我 的fopen(../../配置/ main.php),其我用 $my_file = '..\..\config\main2.php'; $file=fopen("..\..\config\main2.php","w");

    1熱度

    1回答

    我是新來的Yii,我創造降下來的工作。我面對錯誤,請給我建議。這裏他我下拉代碼 <?php /* @var $this CreateproductController */ /* @var $model Createproduct */ /* @var $form CActiveForm */ ?> <div class="form"> <?php $form=$this->beg

    -1熱度

    1回答

    控制器顯示, $model=Product::model()->display_products_statistics(); $this->render('admin',array( 'model'=>$model, )); 查看, $this->widget('zii.widgets.grid.CGridView', array( 'id' => 'product-grid',

    0熱度

    2回答

    創建CDBcriteria如何FO類似查詢創建cdbcriteria: select * from table_name where 'profile_type'='*'OR 'profile_type'=$usertype AND 'location'='*'OR 'location'=$country

    0熱度

    1回答

    問題是如果我想更新其他字段而不是圖像。它通過驗證並且不更新任何字段。 但是,如果我更新圖像和其他領域更新。或者,如果我更新它更新的圖像。 查看: <?php echo $form->labelEx($model,'pimg'); ?> <?php echo $form->fileField($model, 'pimg',array('id'=>'imgInput',)); ?> <?php

    0熱度

    1回答

    我不知道爲什麼我的yii afterFind方法沒有發射。以下是我用來測試yii afterfind方法的內容。對於每一個發現,first_name應該是「hahahahahaa」。這只是測試了一個afterFind工作 下面是我的模型類的用戶: class User extends CActiveRecord { public function getUserInfo($userid,$is

    0熱度

    1回答

    我是Yii的新手,我有兩張表。 master_customer,master_client。在客戶端模型中,在視圖中我有一個搜索框,如果我在搜索框中輸入幾個字母,它必須自動獲取數據並給出master_customers的結果(如谷歌建議)。我已經和master_customer在客戶端模型中建立了關係。 請幫助我的代碼。在此先感謝 控制器動作: public function actionInde

    0熱度

    1回答

    嗨,我通過使用yii framewrok製作了一個web應用程序。目前它的完美工作,但當我通過yii論壇去了解我的文件夾結構並非如所描述的那樣完美。我想使它成爲一個適當的yii框架支持的web應用程序文件夾結構。如果我把sitecontroller.php的一部分 if(isset($_POST['LoginForm'])) { $form->attributes=$_P

    0熱度

    2回答

    調用的事件處理程序是否有可能使其執行上的每個控制器操作調用的Yii調用事件處理程序。 基本上我有一個RESTful應用程序。在當前的每個請求中,它明確地調用認證功能。我想要的是當發出任何請求時的認證函數調用。 我所做的一切 class MyController extends RestController{ public function actionDosomething(){ $t

    4熱度

    1回答

    我想在新用戶註冊時發送電子郵件給管理員。我認爲我可以用兩種方法做到這一點。一種方法是使用事件,其他方法是使用afterSave。 通過使用活動 控制器代碼 public function actionCreate() { $model = new Registeration(); if ($model->load(Yii::$app->request->post