<?php

namespace YiiElfinder2;


use yiins\web\Action;
use yiins\Yii;

class FileManagerPage extends Action
{
    public $config = [];

    public function run()
    {
        $assetsUrl = Yii::web()->getAssetManager()->publish(__DIR__ . '/assets');

        $page = file_get_contents(__DIR__ . '/elfinder.html');

        echo strtr($page, [
            '{assetUrl}' => $assetsUrl,
            '{config}'   => \CJavaScript::encode($this->config),
        ]);
    }
}