Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect backend #1

Open
sagarguhe opened this issue Sep 23, 2015 · 4 comments
Open

Unable to connect backend #1

sagarguhe opened this issue Sep 23, 2015 · 4 comments

Comments

@sagarguhe
Copy link

Hi, I am using yii2 basic template, I am getting "Unable to connect backend" error when I try to upload images... I am having code like this in my files:

_form.php

  $form->field($model, 'body')->widget(
        TinyMce::className(),
        [
            'fileManager' => [
                'class' => TinyMceElFinder::className(),
                'connectorRoute' => 'el-finder/connector',
            ],
        ]
    ); 

ArticleController.php

public function actions()
    {
        $actions = parent::actions();

        $actions['tinyMceCompressor'] = [
            'class' => TinyMceCompressorAction::className(),
        ];

        $actions['connector'] = array(
            'class' => ConnectorAction::className(),
            'settings' => array(
                'root' => Yii::getAlias('@webroot') . '/uploads/',
                'URL' => Yii::getAlias('@web') . '/uploads/',
                'rootAlias' => 'Home',
                'mimeDetect' => 'none'
            )
        );

        return $actions;
    }

What should be the issue, please tell me where I am getting wrong.

@zxbodya
Copy link
Owner

zxbodya commented Sep 23, 2015

'connectorRoute' => 'el-finder/connector',

You are trying to use connector action from ElFinderController, but it is defined in ArticleController... So, just replace it with 'article/connector'

@sagarguhe
Copy link
Author

Hey Thanks for quick reply, It solved the above problem I think but now new error is coming which is Invali backend configuration...

P.S: for information I have renamed "web" directory to "admin", so do I need to create an alias for it?

@myomyintaung512
Copy link

Juz create a "uploads" folder in your web root directory
may be @web\uploads

@mydesign
Copy link

namespace backend\controllers;         
use Yii;       
use yii\web\Controller;         
use zxbodya\yii2\elfinder\ConnectorAction; 

class ElFinderController extends Controller         
{         
    public function actions()         
    {         
        return [         
            'connector' => array(         
                'class' => ConnectorAction::className(),         
                'settings' => array(         
                    'root' => Yii::getAlias('@frontend') . '/web/uploads/',                    
                    'URL' => '/uploads/',         
                    'rootAlias' => 'Home',         
                    'mimeDetect' => 'none'         
                )                    
            ),         
        ];                    
    }         
}
?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants