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 | |
| return array( | |
| 'components' => array( | |
| ... | |
| 'viewRenderer' => array( | |
| 'class' => 'ext.ETwigViewRenderer', | |
| 'globals' => array( | |
| 'Yii' => 'Yii', | |
| 'Captcha' => 'CCaptcha', | |
| ), |
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
| $smtpConfig = array( | |
| 'ssl' => 'ssl', | |
| 'port' => '465', | |
| 'auth' => 'login', | |
| 'username' => '[email protected]', | |
| 'password' => 'password' | |
| ); | |
| // default | |
| //$oTransport = new Zend_Mail_Transport_Smtp(); // @TODO enable for production |
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
| error_log("MSG", 1, "[email protected]","From: [email protected]"); |
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 | |
| // rule for date format | |
| array('birth_date', 'date', 'format'=>'yyyy-mm-dd', 'message'=>'Birth Date, wrong format. Must be YYYY-MM-DD', 'allowEmpty'=>false), | |
| // Check for UNIQUE | |
| // USAGE: array('email', 'unique'), | |
| public function unique( $attribute, $params ) | |
| { | |
| if( self::model()->count( 't.email=:email', array( ':email' => $this->attribute ) ) > 0 ) $this->addError('email', 'Email already exists'); |
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
| Example 5: Generating dropdownlist with option groups. | |
| from http://www.yiiframework.com/wiki/48/by-example-chtml/#hh4 | |
| If you need to generate dropdownlist using both optgroup and option tags use the following code. | |
| <div class="cars-select"> | |
| <?php echo CHtml::dropDownList('Cars', 'car_id', array( | |
| 'Mazda'=>array( | |
| 'mazda-rx7'=>'RX7', | |
| 'mazda-rx5'=>'RX5', |
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 | |
| public function rules() | |
| { | |
| return array( | |
| array( 'field', 'required' ), | |
| array( 'field', 'numerical', 'integerOnly' => true ), | |
| array( 'field, field2', 'length', 'max' => 10 ), | |
| array( 'field, field2', 'safe', 'on' => 'search' ), | |
| array( 'status', 'safe' ), |
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 | |
| $criteria=new CDbCriteria; | |
| $criteria->addSearchCondition('title', $_GET['Press']['title']); | |
| $criteria->addSearchCondition('body', $_GET['Press']['title']); | |
| $presses=Press::model()->findAll($criteria); | |
| // SELECT * FROM 'presses' 't' WHERE (title LIKE :ycp0) AND (body LIKE :ycp1) | |
| $criteria=new CDbCriteria; |
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 | |
| /** | |
| * Controller is the customized base controller class. | |
| * All controller classes for this application should extend from this base class. | |
| */ | |
| class RestController extends CController | |
| { | |
| /** | |
| * @var string the default layout for the controller view. Defaults to '//layouts/column1', | |
| * meaning using a single column layout. See 'protected/views/layouts/column1.php'. |
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
| #define DEBUG_CONSOLE | |
| #define DEBUG_LEVEL_LOG | |
| #define DEBUG_LEVEL_WARN | |
| #define DEBUG_LEVEL_ERROR | |
| #if (UNITY_EDITOR || DEVELOPMENT_BUILD) | |
| #define DEBUG | |
| #endif | |
| #if (UNITY_IOS || UNITY_ANDROID) |
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
| var scrollSpeed = 0.90; | |
| var scrollSpeed2 = 0.90; | |
| function FixedUpdate() | |
| { | |
| var offset = Time.time * scrollSpeed; |