public static function beforeSaveBody($text)
    {
        static::correctParams();
        $webfilesSubdir = static::$webfilesSubdir;
        $webfilesSubdirOld = static::$webfilesSubdirOld;

        $baseUrl = Yii::$app->urlManager->getBaseUrl();
        $trTable = [
            "src=\"{$baseUrl}/{$webfilesSubdirOld}" => "src=\"@{$webfilesSubdir}", //!! old -> new
            "src=\"{$baseUrl}/{$webfilesSubdir}" => "src=\"@{$webfilesSubdir}",

//...todo add useful here...

        ];
        $text = strtr($text, $trTable);
        return $text;
    }
public static function beforeSaveBody($text)
    {
        static::correctParams();
        $webfilesSubdir = static::$webfilesSubdir;
        $webfilesSubdirOld = static::$webfilesSubdirOld;

        $baseUrl = Yii::$app->urlManager->getBaseUrl();
        $trTable = [
            "src=\"{$baseUrl}/{$webfilesSubdirOld}" => "src=\"@{$webfilesSubdir}", //!! old -> new
            "src=\"{$baseUrl}/{$webfilesSubdir}" => "src=\"@{$webfilesSubdir}",

//...todo add useful here...

        ];
        $text = strtr($text, $trTable);
        return $text;
    }
public static function beforeSaveBody ( $ text ) { static :: correctParams ( ) ; $ webfilesSubdir = static :: $ webfilesSubdir ; $ webfilesSubdirOld = static :: $ webfilesSubdirOld ; $ baseUrl = Yii :: $ app -> urlManager -> getBaseUrl ( ) ; $ trTable = [ "src=\"{$baseUrl}/{$webfilesSubdirOld}" => "src=\"@{$webfilesSubdir}" , //!! old -> new "src=\"{$baseUrl}/{$webfilesSubdir}" => "src=\"@{$webfilesSubdir}" , //...todo add useful here... ] ; $ text = strtr ( $ text , $ trTable ) ; return $ text ; }
Prepare text to save after visual editor.
@param string $text
@return string
Prepare text to save after visual editor .