예제 #1
0
 /**
  * Update the settings fields of other models if the settings of this one is updated.
  * @return null 
  */
 public function afterSave()
 {
     if (count($this->getDirty()) > 0) {
         \Backend\Models\BrandSettings::set(['app_name' => $this->get('name'), 'app_tagline' => $this->get('full_name')]);
         if (class_exists('\\AnandPatel\\SeoExtension\\models\\Settings')) {
             $seo_settings = \AnandPatel\SeoExtension\models\Settings::instance();
             switch ($seo_settings->title_position) {
                 case 'prefix':
                     $seo_settings->title = $this->get('name') . ' |';
                 case 'suffix':
                     $seo_settings->title = '| ' . $this->get('name');
             }
             $seo_settings->save();
         }
     }
 }