backend/controllers/MediaBrowserController.php
/**
     * Insert file to editor.
     *
     * @return string
     */
Insert file to editor.
@return string
Insert file to editor . @return string
public function actionEditorInsert()
    {
        $result = '';
        foreach (Yii::$app->request->post('Media') as $media) {
            $type = ArrayHelper::getValue($media, 'type');
            if ($type === 'image') {
                $result .= $this->getMediaImage($media);
            } elseif ($type === 'video') {
                $result .= $this->getMediaVideo($media);
            } elseif ($type === 'audio') {
                $result .= $this->getMediaAudio($media);
            } else {
                $result .= $this->getMediaFile($media);
            }
        }
        return $result;
    }
public function actionEditorInsert ( ) { $ result = '' ; foreach ( Yii :: $ app -> request -> post ( 'Media' ) as $ media ) { $ type = ArrayHelper :: getValue ( $ media , 'type' ) ; if ( $ type === 'image' ) { $ result .= $ this -> getMediaImage ( $ media ) ; } elseif ( $ type === 'video' ) { $ result .= $ this -> getMediaVideo ( $ media ) ; } elseif ( $ type === 'audio' ) { $ result .= $ this -> getMediaAudio ( $ media ) ; } else { $ result .= $ this -> getMediaFile ( $ media ) ; } } return $ result ; }
Insert file to editor.
Insert file to editor .