This file contains hidden or 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 authenticate() | |
{ | |
// $users=array( | |
// // username => password | |
// 'demo'=>'demo', | |
// 'admin'=>'admin', | |
// ); | |
// if(!isset($users[$this->username])) | |
// $this->errorCode=self::ERROR_USERNAME_INVALID; | |
// elseif($users[$this->username]!==$this->password) |
This file contains hidden or 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 beforeSave() { | |
$this->password = $this->hashPassword($this->new_password); | |
return parent::beforeSave(); | |
} | |
/** | |
* Checks if the given password is correct. | |
* @param string the password to be validated | |
* @return boolean whether the password is valid | |
*/ |
This file contains hidden or 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 init(){ | |
parent::init(); | |
Yii::app()->theme = "theme-name"; | |
} |
This file contains hidden or 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 | |
/********************************************************************************************* | |
* Example usage (In view) | |
* <div class="welcome"> | |
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?> | |
<?php echo Form::textField('first_name')?> | |
<?php echo Form::textField('last_name')?> | |
<?php echo Form::emailField('email')?> | |
<?php echo Form::passwordField('password')?> | |
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?> |
This file contains hidden or 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 echo Yii::app()->request->baseUrl; ?>/ |
This file contains hidden or 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 Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl . "/css/admin/bootstrap.min.css") ?> |
This file contains hidden or 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 echo Yii::app()->params['title'];?> |
This file contains hidden or 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
//* Remove the site description | |
remove_action ( 'genesis_site_description', 'genesis_seo_site_description' ); |
This file contains hidden or 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 | |
Yii::app()->clientScript->registerCoreScript('jquery'); | |
?> |
This file contains hidden or 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('zii.widgets.jui.CJuiDatePicker', | |
array( | |
'name' => 'publication_date', | |
'attribute' => 'publication_date', | |
'model'=>$model, | |
'options'=> array( | |
'dateFormat' =>'yy-mm-dd', | |
'altFormat' =>'yy-mm-dd', | |
'changeMonth' => true, | |
'changeYear' => true, |