GithubHelp home page GithubHelp logo

zxbodya / yii2-elfinder Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 11.0 1.26 MB

Extension to use elFinder 1.x file manager in Yii2 application

PHP 14.31% CSS 3.95% JavaScript 81.64% Shell 0.10%
yii2 yii2-extension elfinder tinymce

yii2-elfinder's Introduction

ElFinder 1.x Yii2 extension

Extension to simplify adding elFinder to Yii2 project.

Extension is rework from Yii 1.1 extension:

https://github.com/zxbodya/yii-elfinder

##Installation The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist zxbodya/yii2-elfinder "*@dev"

or add

"zxbodya/yii2-elfinder": "*@dev"

to the require section of your composer.json file.

Backend controller configuration

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('@webroot') . '/uploads/',                    
                    'URL' => Yii::getAlias('@web') . '/uploads/',         
                    'rootAlias' => 'Home',         
                    'mimeDetect' => 'none'         
                )                    
            ),         
        ];                    
    }         
}

Widgets usage

FileInput

widget to choose file on server using ElFinder pop-up

echo $form->field($model, 'filePath')->widget(
    ElFinderInput::className(),
    ['connectorRoute' => 'el-finder/connector',]
)

ElFinderWidget

echo ElFinderWidget::widget(
    ['connectorRoute' => 'el-finder/connector',]
)

TinyMce integration

Widgets supports intergation with TinyMce wysiwyg editor For more details see tinymce extension https://github.com/zxbodya/yii2-tinymce

yii2-elfinder's People

Contributors

dastanaron avatar hooman-mirghasemi avatar zxbodya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

yii2-elfinder's Issues

Unable to connect backend

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.

elFinderInput - class for input field

how can i put class for input field? tried
$form->field($sub, "[$index]value")->widget(
ElFinderInput::className(),
[
'connectorRoute' => '/admin/pages/connector',
'options' => [
'inputOptions' => ['class' => 'form-control'],
]

                        ]
                    `)->label(false);

but it doesn't work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.