dmstr / yii2-adminlte-asset

AdminLTE Asset Bundle for Backend Theme in Yii2 Framework
1.14k stars 425 forks source link

app.min.js not found #129

Closed robwent closed 6 years ago

robwent commented 6 years ago

I'm trying to add this to the basic Yii2 template.

Views are working fine and css is loading, but there is no js.

There is a 404 error for /assets/xxxxx/js/app.min.js

When I check the assets folder the only js file in there is adminlte.min.js and the uncompressed version (And looking again looks like there is demo.js).

Have I made a config error? I have this working fine with the advanced starter template but I can't see any different config values that might stop the js from loading.

imitronov commented 6 years ago

I have the same problem with app.min.js on yii2 basic.

schmunk42 commented 6 years ago

This is looks like a problem of the app template not yii2-adminlte-asset. Does app.min.js belong to the app template you are using?

imitronov commented 6 years ago

No, app.min.js required with adminlte template only. In folder with app.min.js exists adminlte.js, adminlte.min.js and demo.js. Without app.min.js in adminlte don't work right and left menu.

imitronov commented 6 years ago

https://github.com/dmstr/yii2-adminlte-asset/blob/master/web/AdminLteAsset.php 18 string if you change app.min.js to adminlte.min.js, then everything will work

schmunk42 commented 6 years ago

I see, looks like there have been changes to AdminLTE files in https://github.com/almasaeed2010/AdminLTE/tree/master/dist/js - will fix that tomorrow.

robwent commented 6 years ago

Thanks @imitronov

It looks like they have changed the data attribute for the left sidebar toggle as well.

This: https://github.com/dmstr/yii2-adminlte-asset/blob/master/example-views/yiisoft/yii2-app/layouts/header.php#L14

needs to be data-toggle="push-menu"

leealex commented 6 years ago

Nested menu items don't work too. Parent <li> has to have class treeview now and root <ul> has to have class sidebar-menu tree and attribute data-widget="tree"

Image

johnluxor commented 6 years ago

The package almasaeed2010/adminlte has updated to version 2.4 and because of it files in js folder were changed. There is no app.js file.

To resolve this problem I added depended package as show bellow

    "almasaeed2010/adminlte": "~2.3.0",
schmunk42 commented 6 years ago

Fixed in 2.4.4 and 2.5.0-rc1, thank you!

robwent commented 6 years ago

I think this is still an issue because of the readme file which installs 2.1

composer require dmstr/yii2-adminlte-asset "^2.1"

Anyone following instructions to install from there are going to run into the same issue.

EDIT: According to this I think it's probably still an issue on my end https://getcomposer.org/doc/articles/versions.md#caret-version-range- When I use the command from the readme I get 2.1 every time so I've manually required 2.4.4 and updated.

schmunk42 commented 6 years ago

There might be additional constraints on your side which require an installation of 2.1. You can use composer why <package> to find out more about the constraints.