Skip to content

Instantly share code, notes, and snippets.

View amirkheirabadi73's full-sized avatar
๐Ÿ™ƒ
confused about future

Amir amirkheirabadi73

๐Ÿ™ƒ
confused about future
View GitHub Profile
@amirkheirabadi73
amirkheirabadi73 / Set filed Befor Seve record
Created June 17, 2013 07:40
Set Filed Befor Save Record
mode () :
protected function beforeSave()
{
if(parent::beforeSave())
{
if($this->isNewRecord)
{
$this->create_time=$this->update_time=time();
$this->author_id=Yii::app()->user->id;
@amirkheirabadi73
amirkheirabadi73 / Static Drop Down
Created June 16, 2013 07:57
Create DropDown Menu Item Function In Mode()
model :
const type_one = 1;
const type_two = 2;
const type_three = 3;
public function getType(){
return array(
self::type_one => "one",
self::type_two => "two",