private function addMovieAttributes($arr_infos) { foreach ($arr_infos as $key => $value) { if (is_array($value)) { $value = Callback::encode($value); } $attr = new MovieAttributes(); $attr->code = $key; $attr->value = utf8_encode($value); $attr->movie_id = $this->id; $attr->save(); } }
<?php $this->pageTitle = Yii::app()->name . ' - Dashboard'; ?> <?php $this->widget('zii.widgets.jui.CJuiAccordion', array('panels' => array('Recent Comments' => $this->renderPartial('_list', array('items' => Comment::model()->recent()->findAll()), true), 'LMDB Popular Movies' => $this->renderPartial('_list', array('items' => Movie::model()->popular()->findAll()), true), 'Top Public Movies' => $this->renderPartial('_list', array('items' => MovieAttributes::model()->top()->findAll()), true), 'Recent Added Movies' => $this->renderPartial('_list', array('items' => Movie::model()->recent()->findAll()), true), 'Recent Searches' => $this->renderPartial('_list', array('items' => SearchLog::model()->recent()->findAll()), true)), 'options' => array('animated' => 'bounceslide')));