Beispiel #1
0
 public function beforeSave()
 {
     if ($this->description) {
         Yii::import('ext.markdown.*');
         $md = new EMarkdown();
         $this->description_marked = $md->transform($this->description);
     }
     return parent::beforeSave();
 }
 public function beforeSave()
 {
     $this->alias = EString::strtolower($this->alias);
     if ($this->description) {
         Yii::import('ext.mardown.*');
         $md = new EMarkdown();
         $this->description_marked = $md->transform($this->description);
     }
     return parent::beforeSave();
 }
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->created = date('Y-m-d H:i:s');
     }
     Yii::import('ext.markdown.*');
     $md = new EMarkdown();
     $md->purifyOutput = true;
     $this->text_marked = trim($md->transform(CHtml::encode($this->text)));
     return parent::beforeSave();
 }
Beispiel #4
0
 public function beforeSave()
 {
     Yii::import('ext.markdown.*');
     $md = new EMarkdown();
     $this->text_marked = $md->transform($this->text);
     if (!empty($this->preamble)) {
         $this->preamble_marked = $md->transform($this->preamble);
     }
     $this->url = Yii::app()->createUrl('articles/view', array('alias' => $this->alias));
     return parent::beforeSave();
 }
Beispiel #5
0
 public function beforeSave()
 {
     if ($this->description) {
         Yii::import('ext.markdown.*');
         $md = new EMarkdown();
         $this->description_marked = $md->transform($this->description);
     }
     $this->uploadImage('logo_file', $this->alias, $this->logo_sizes, $this->title, 'Логотип ' . $this->title);
     return parent::beforeSave();
 }