prepareData() public static method

Convert data to plain array in recursive manner.
public static prepareData ( mixed $data ) : array
$data mixed
return array
Exemplo n.º 1
0
 public function save()
 {
     $renderer = Yii::app()->getComponent('viewRenderer');
     if ($renderer instanceof Yii2DebugViewRenderer) {
         return Yii2Debug::prepareData($renderer->getStack());
     }
     return null;
 }
Exemplo n.º 2
0
 public function actionConfig()
 {
     if (!$this->getOwner()->showConfig) {
         throw new CHttpException(403, 'Forbidden');
     }
     $components = array();
     foreach (Yii::app()->getComponents(false) as $id => $config) {
         try {
             $components[$id] = Yii::app()->getComponent($id);
         } catch (Exception $e) {
             assert(is_array($config));
             $components[$id] = array_merge($config, array('_error_' => $e->getMessage()));
         }
     }
     ksort($components);
     $modules = Yii::app()->modules;
     ksort($modules);
     $data = $this->hideConfigData(array('app' => Yii2Debug::prepareData(Yii::app()), 'components' => Yii2Debug::prepareData($components), 'modules' => Yii2Debug::prepareData($modules), 'params' => Yii2Debug::prepareData(Yii::app()->params)), $this->getOwner()->hiddenConfigOptions);
     $this->render('config', $data);
 }