backend/controllers/MediaBrowserController.php
/**
     * Insert URL of media to input field.
     *
     * @return string
     */
Insert URL of media to input field.
@return string
Insert URL of media to input field . @return string
public function actionFieldInsert()
    {
        $files = [];
        foreach (Yii::$app->request->post('Media') as $media) {
            $mediaUploadHandler = new MediaUploadHandler(null, false);
            $file = $mediaUploadHandler->get(
                ArrayHelper::getValue($media, 'id'),
                $mediaUploadHandler::NOT_PRINT_RESPONSE
            );
            $files[] = ArrayHelper::getValue($file, 'file');
        }
        return Json::encode($files);
    }
public function actionFieldInsert ( ) { $ files = [ ] ; foreach ( Yii :: $ app -> request -> post ( 'Media' ) as $ media ) { $ mediaUploadHandler = new MediaUploadHandler ( null , false ) ; $ file = $ mediaUploadHandler -> get ( ArrayHelper :: getValue ( $ media , 'id' ) , $ mediaUploadHandler :: NOT_PRINT_RESPONSE ) ; $ files [ ] = ArrayHelper :: getValue ( $ file , 'file' ) ; } return Json :: encode ( $ files ) ; }
Insert URL of media to input field.
Insert URL of media to input field .