This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function actionAction(){ | |
$criteria = new CDbCritera; | |
$criteria->compare("username", "john"); | |
$criteria->compare("password", "123"); | |
$users = User::model()->findAll($criteria); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionContactus() { | |
$this->layout = false; | |
$this->render("path/to/the/view"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionUpdatecalendar() { | |
echo "sample text"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// controller | |
public function actionAjaxU() { | |
echo "Hello"; | |
} | |
// view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->render("you-view-name", array("title"=>$model)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( Yii::app()->cache->get("Ali") ){ | |
echo Yii::app()->cache->get("Ali"); | |
}else { | |
Yii::app()->cache->set("Ali", "Ali Raza", 400); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'cache' => array( | |
'class'=>'system.caching.CFileCache', | |
'cachePath'=> 'path/to/cache/dir' | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->widget('ext.gcalendar.GCalendar',array( | |
'model' =>$model, // remove this line | |
'inputField'=>'date_of_birth', | |
'daFormat'=>'dd/mm/yyyy', | |
) | |
); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionUpdate($id) | |
{ | |
$model=$this->loadModel($id); | |
$roomInformationModel = $this->loadRoomInformationModel( $_GET['roomInfoId'] ); | |
if( isset($_POST['GuestReservations']) && isset($_POST['RoomInformation']) ) | |
{ | |
$roomInformationModel->attributes = $_POST['RoomInformation']; | |
$model->attributes = $_POST['GuestReservations']; | |
if( $roomInformationModel->save() && $model->save() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionError() | |
{ | |
if($error=Yii::app()->errorHandler->error) | |
{ | |
if(Yii::app()->request->isAjaxRequest) | |
echo $error['message']; | |
else | |
$this->render('error', $error); | |
} | |
} |
OlderNewer