Elfinder filemanager

3.4k Views Asked by At

I am using laravel 4 and i want to use Elfinder filemanager but it does not work. I have tested Elfinder on my localhost first. Elfinder works seperately, but not in laravel:

This are the includes in my master page. Could there be a problem there?

{{HTML::style('filemanager1/css/elfinder.min.css')}}
{{HTML::script('filemanager1/js/elfinder.min.js')}}
<!-- Mac OS X Finder style for jQuery UI smoothness theme (OPTIONAL) -->
{{HTML::style('filemanager1/css/theme.css')}}


<!-- Normal -->

{{HTML::style('http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css')}}
{{HTML::script('text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')}}
{{HTML::script('text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js')}}
{{HTML::script('http://code.jquery.com/jquery-1.9.1.js')}}
{{HTML::script('http://code.jquery.com/ui/1.10.3/jquery-ui.js')}}


{{HTML::script('js/bootstrap.js')}}
{{HTML::script('js/expandingbox.js')}}
{{HTML::script('js/jscolor/jscolor.js')}}
{{HTML::style('css/bootstrap.css')}}

This is the code in my view.

<script type="text/javascript" charset="utf-8">
    $().ready(function() {
        var elf = $('#elfinder').elfinder({
            // lang: 'ru',             // language (OPTIONAL)
            url : 'filemanager1/php/connector.php'  // connector URL (REQUIRED)
        }).elfinder('instance');            
    });
</script>

<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>
2

There are 2 best solutions below

2
On

You have some problems in the way you are trying to create the extra tags. This is something that won't work on Blade:

{{HTML::script('text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js')}}

Here's the code that will work for you. It was tested here.

<html>
    {{HTML::style('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/smoothness/jquery-ui.css', array('media' => 'screen'))}}
    {{HTML::script('http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', array('type' => 'text/javascript'))}}
    {{HTML::script('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js', array('type' => 'text/javascript'))}}
    {{HTML::style('filemanager1/css/elfinder.min.css', array('media' => 'screen'))}}
    {{HTML::script('filemanager1/js/elfinder.min.js', array('type' => 'text/javascript'))}}
    {{HTML::style('filemanager1/css/theme.css', array('media' => 'screen'))}}

    <body>

    Elfinder
    <!-- Element where elFinder will be created (REQUIRED) -->
    <div id="elfinder"></div>

    <script type="text/javascript" charset="utf-8">
        $().ready(function() {
            var elf = $('#elfinder').elfinder({
                // lang: 'ru',             // language (OPTIONAL)
                url : 'filemanager1/php/connector.php'  // connector URL (REQUIRED)
            }).elfinder('instance');            
        });
    </script>

    </body>
</html>
0
On

Maybe its too late, but you can try this package to integrate elFinder into your laravel app, including tinymce

https://github.com/barryvdh/laravel-elfinder