General

  • Download this mail extension here  http://www.yiiframework.com/extension/mail. Extract the files. Move the vendors folder to protected/components/vendors/ Move YiiMail.php and YiiMailMessage.php to protected/components/ Add on protected/config/main.php [php] ‘components’=>array( … ‘mail’ => array( ‘class’ => ‘YiiMail’, ‘transportType’ => ‘php’, ‘transportType’ => ‘smtp’, ‘transportOptions’=>array( ‘host’=>’ghazalitajuddin.com’, //’encryption’=>’tls’, ‘username’=>’***@ghazalitajuddin.com’, ‘password’=>’******’, ‘port’=>25, ), ‘logging’ => true, ‘dryRun’ => false ), … ), [/php]…

    Baca catatan

  • DO name your database tables in the singular, not plural DON’T prepend db table names to field names DON’T include a table prefix in the model class name DO name each table’s primary key “id” AVOID semantically-meaningful primary key names DO define foreign-key relationships in the database schema DO name your foreign key fields ending…

    Baca catatan

  • Sample using CActiveDataProvider Sample 1: [php] $dataProvider=new CActiveDataProvider(‘User’,array( ‘criteria’=>array( ‘condition’=>’activationstatus = 1’), )); [/php] Sample 2: [php] $dataProvider=new CActiveDataProvider(‘Event’, array( ‘criteria’=>array( ‘condition’=>’date >= "’.date(‘Y-m-d’, strtotime(‘-2 years’)).’"’, ), )); [/php] Sample 3: [php] $dataProvider=new CActiveDataProvider(‘Post’, array( ‘pagination’=>array( ‘pageSize’=>5, ), ‘criteria’=>$criteria, )); [/php] Sample 4: [php] $dataProvider=new CActiveDataProvider(‘User’) [/php]

    Baca catatan

  • Some function is created to make code easy to read and manageable. The Lookup function is so powerfull to simplified data storage. Usually we store Approve, Not Approved, Qualified, Not Qualified in words for each records, but with Lookup class, we can make it short to an integer for each properties. Table scheme “tbl_lookup” [php]…

    Baca catatan