dmstr / yii2-adminlte-asset Goto Github PK
View Code? Open in Web Editor NEWAdminLTE Asset Bundle for Backend Theme in Yii2 Framework
AdminLTE Asset Bundle for Backend Theme in Yii2 Framework
As the question title, how can I do this?
Hi
What about changing this package to follow best practice in package namespacing and following rule VendorName\PackageName\ClassName
?
Of course this will be a breaking change, so package version should be bumped to 3.0.
I you agree, I can make PR.
@schmunk42
basic example is same as advanced example, except
backend\assets\AppAsset::register($this); //advanced
app\assets\AppAsset::register($this); //basic
it can be replace to
if (class_exists('backend\assets\AppAsset')) {
backend\assets\AppAsset::register($this);
} else {
app\assets\AppAsset::register($this);
}
Now basic use vesion 1.x admin-lte. I try to used for basic app
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-advanced-app'
],
],
],
"dmstr/yii2-adminlte-asset": "2.*"
It works.
Therefore we can delete basic and advanced expamples and create a universal.
But how to be with backward compatible? Need a new version :)
Follow up from #45 (comment)
Excuse me, when will be a release ready? I seem to not be able to install it through composer due to the lack of one.
Thanks
On windows XAMPP I got this. On Debian works fine the same code
Any ideas?
My code:
`
use yii\helpers\Html;
use dmstr\web\AdminLteAsset as AdminLteAsset;
/* @var $this \yii\web\View /
/ @var $content string */
if (Yii::$app->controller->action->id === 'login') {
/**
Do not use this code in your template. Remove it.
Instead, use the code $this->layout = '//main-login'; in your controller.
*/
echo $this->render(
'main-login',
['content' => $content]
);
} else {
if (class_exists('backend\assets\AppAsset')) {
backend\assets\AppAsset::register($this);
} else {
app\assets\AppAsset::register($this);
}
AdminLteAsset::register($this);`
Thanks for the nice theme
I have tried to install version 1 but all the links are broken and and the layout is a bit messed up.
It seems the required files are not generated in the assets folder. I have tried to run the command composer global require "fxp/composer-asset-plugin:1.0.0" and re-install again theme still there are brocken links.
When I run:
php composer.phar require dmstr/yii2-adminlte-asset "*"
I get:
Reading bower.json of bower-asset/admin-lte (v1.2.1)
Importing tag v1.2.1 (1.2.1.0)[InvalidArgumentException]
No driver found to handle Asset VCS repository > http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.min.js
Can you add support for linkOptions to Menu widget?
Code described here:
https://toster.ru/q/204731
It`s very usefull option for create LogOut link in Menu (not in navbar, etc).
Dear all
First and foremost, good work on the template! I just have one issue, which I cannot seem to resolve: my layout gets all messed up in IE 11. Do you have the same problems?
Kind regards
I use yii2 basic application and adminlte theme.
As soon as the page became longer a double vertical scroolbar appear.
One is from the windows container (which is correct), but another seem from the body container.
The one from the body prevent you to use the mouse wheel to scroll efficiently.
In plus when the body scroll the header get detached from the left menu.
I think is some problem with the javascrpt assets.
Following the documention, the code to change skin:
'components' => [
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
],
],
],
Returns the following error:
Unknown Property โ yii\base\UnknownPropertyException
Setting unknown property: dmstr\web\AdminLteAsset::skin
After PR #61
people complain:
adminlte include several plugins and those are not included on the dmstr\web\AdminLteAsset
asset class.
the best way to load those plugins is to make an asset for each of them, for example
class ICheckAsset extends AssetBundle
{
public $sourcePath = '@bower/admin-lte/plugins/iCheck';
public $css = [
'all.css'
];
public $js = [
'icheck.min.js'
];
public $depends = [
'dmstr\web\AdminLteAsset',
];
}
Hi!.. I have trouble in integrating the plugins here under vendor\almasaeed2010\adminlte\plugins like charts.. Im ok about using the adminLTE skins co'z of this Yii::$app->assetManager->getPublishedUrl('@vendor/almasaeed2010/adminlte/dist'); now how to declare the plugins under the @vendor/almasaeed2010/adminlte/plugins?
I can't connect to fonts.googleapis.com
so I want to know how I remove
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);
from adminLTE.min.css
Hello.
I've two url :
/frontend/web/index.php/individual/manage
/frontend/web/index.php/individual/upload
$items [] = ['label' => Yii::t('app','Register Car'), 'url' => ['individual/upload']]; $items [] = ['label' => Yii::t('app','Manage Cars'), 'url' => ['individual/manage']]; echo dmstr\widgets\Menu::widget( [ 'options' => ['class' => 'sidebar-menu'], 'items' => $items, ] );
No matter which one i click both of them 'li' has the active tag on. I've deleted the complete isItemActive method, now its working fine.
#61
Perhaps we need to register 'yii\bootstrap\BootstrapAsset',
in out AdminLteAsset.php ?
Related #59 login page problem
I recently (a couple of days ago) downloaded the AdminLTE Asset Bundle for usage with Yii2 Advanced, by adding the following line to composer.json: "dmstr/yii2-adminlte-asset": "2.*@beta"
After it was done downloading and installing, I copied the layout files from vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-advanced-app/layouts/ into my frontend/views/layouts/ folder (and modified the main.php layout file to point to frontend instead of backend).
I then created a new, blank index.php view page and setup a controller action for it.
When loading up the new page, I see the adminLte layout (with "blue skin"), but I have some issues that I have been unable to solve, and could use some assistance with.
Issue 1: The "left.php" layout file contains a basic menu setup through a Nav widget. When I tried to add a submenu to one of the entries in this basic menu, they were added to the page as a "dropdown" toggle, and not as an "accordion" as seen in the example/demo pages included with adminLTE. I tried manually adding classes "treeview" and "treeview-menu" to the menu entries, but that just resulted in the submenu items no longer showing up at all. Is there an example of a simple Nav widget menu setup with submenus? Here's how I tried to do it:
Nav::widget(
[
'encodeLabels' => false,
'options' => ['class' => 'sidebar-menu'],
'items' => [
[
'label' => 'Menu Header',
'url' => '#',
'options'=>['class'=>'header']
],
['label' => '<span class="fa fa-circle-o"></span> Menu Entry', 'url' => ['/contacts']],
['label' => '<span class="fa fa-circle-o"></span> Menu Entry', 'url' => ['/projects']],
['label' => '<span class="fa fa-circle-o"></span> Menu With Submenu',
'options' => ['class' => 'treeview'],
'items' => [
['label' => '<span class="fa fa-file-code-o"></span> SubMenu Entry', 'linkOptions' => ['class' => 'treeview-menu'], 'url' => ['/news']],
['label' => '<span class="fa fa-file-code-o"></span> SubMenu Entry', 'linkOptions' => ['class' => 'treeview-menu'], 'url' => ['/articles']],
]],
['label' => '<span class="fa fa-file-code-o"></span> Gii', 'url' => ['/gii']],
['label' => '<span class="fa fa-dashboard"></span> Debug', 'url' => ['/debug']],
],
]
);
See attached image adminlte-01.jpg to see how it looks.
Issue 1b: Not sure if this is related to issue 1, but when I hover over menu items that have class "header", the hover effect doesn't extend to the complete width of the sidebar menu like it does with the other menu items. See attached image adminlte-02.jpg.
Issue 2: The footer on my new, blank page, doesn't extend across the entire page, but leaves a gap between the footer and the collapsable sidebar on the left. If I collapse the menu, the footer extends all the way as it should, but if I toggle it back open, the footer is pushed so far to the right there would be enough space for a second sidebar inbetween it and the existing sidebar. No idea what's causing this. :/ See attached image adminlte-03.jpg
Issue 3: The example images (like profile image) that come with the demo-setup aren't showing up. Checked source, and they seem to point to a web/assets/ folder that doesn't exist. I tried to preview the quick example by modifying theme view path in main config, too, but the images still don't show up. All the images currently reside in the vendor/bower/admin-lte/dist/img/ folder.
I'm including some images to illustrate the problems, and hope someone can help me out :/
Is this possible? That I disable a side menu item, "Change Password" for example, and when a specific page is loaded, say staff.php
, that disabled menu item will be enabled.
when i tried to intall im getting this message
[UnexpectedValueException]
Could not parse version constraint <=2.: Invalid version string "2."
i'v already updated composer "selfupdate"
Using current stable version.
All pages display a double scroll bar on the right. There appears to be an element with overflow:auto.
How can this be removed?
AdminLTE v.2 has new structure forlder.
Demo
Need new branch or how?
some of the admin lte assets would work very fine as yii2 widgets, for example the tree-view menu used https://github.com/dmstr/yii2-adminlte-asset/blob/master/example-views/yiisoft/yii2-app/layouts/left.php#L53 would make perfect sense to turn it into nested Widgets.
I want to know if your template supports right to left layout ?
When starting with a complete fresh installation (Yii2 framework), composer gives me the following error when I install adminlte (an error which I don't understand, so I have no idea how to fix it).
Error in composer:
[InvalidArgumentException]
No driver found to handle Asset VCS repository http://omnipotent.net/jquery.sparkline/2.1.2/jquery.sparkline.min.js
The install command I issue is: composer require --prefer-dist dmstr/yii2-adminlte-asset "*"
I hope that you can shed some light on this issue.
kind regards,
Rob Mies
when installing version 1.* in composer i get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- dmstr/yii2-adminlte-asset 1.0.x-dev requires bower-asset/admin-lte ~1.3 -> no matching package found.
- dmstr/yii2-adminlte-asset 1.0.0 requires bower-asset/admin-lte ~1.3 -> no matching package found.
- Installation request for dmstr/yii2-adminlte-asset 1.* -> satisfiable by dmstr/yii2-adminlte-asset[1.0.0, 1.0.x-dev].
Is there any way to fix this?
Hello.
I've just tried to install the v2 version of adminlte but the default page doesn't seems to be fine.
we need another solution for font-awesome
Social buttons for google plus and facebook does not show the icon from font awesome.
how to remove the left-sidebar .. i successfully remove the content of sidebar but still two columns
Hi,
I'm trying to install version 2 through composer but getting this error
g:\projects\WebApp>composer require dmstr/yii2-adminlte-asset "2.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
[RuntimeException]
Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.*:
Invalid version string "v4.1.*"
[UnexpectedValueException]
Could not parse version constraint v4.1.*: Invalid version string "v4.1.*"
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [packages1] ... [packagesN]
How to get yii2-adminlte-asset installed?
public $linkTemplate = '<a href="{url}"{linkOptions}>{icon} {label}</a>';
so that it could be possible to add target="_blank"
public static function skinClass()
{
/** @var \dmstr\web\AdminLteAsset $bundle */
$bundle = Yii::$app->assetManager->getBundle('dmstr\web\AdminLteAsset');
return $bundle->skin;
}
When $bundle->skin
is _all-skins
by default then skinClass()
return wrong css of body class.
Need return correct css class, e.g. skin-black
Yes or no? :)
Problem 1
- Installation request for dmstr/yii2-adminlte-asset * -> satisfiable by dmstr/yii2-adminlte-asset[0.1.0].
- dmstr/yii2-adminlte-asset 0.1.0 requires bower-asset/admin-lte * -> no matching package found.
It work on mac. but not in server ubuntu @@
[RuntimeException]
Could not load package rmrevin/yii2-fontawesome in http://packagist.org: [UnexpectedValueException] Could not parse version constraint v4.1.: Invalid version string "v4.1.
"
[UnexpectedValueException]
Could not parse version constraint v4.1.: Invalid version string "v4.1."
Hello,
The dashboard is ok in my yii2 app but i have a problem with the login page. I think they can load the necessary asset css or js because i can see the icon or the style of the normal login page.
Could you explain me the procedure to have a correct login page ?
Do i use the $this->layout = '//main-login' ? i dont understant where i put it ...
BR,
Thank you
Do you have the way to make the same for yii1?
Installing from composer the package is missing the directory
example-views/yiisoft/yii2-basic-app/
Could we get some additional docs on the menu widget?
It is usable, but it would be nice to get a better idea of what can be done with it.
For example, i would like to put some horizontal bars in the menu to seperate sections of the menu.
Thanks! Great work!
-John
I am working on a PR right now and i noticed there is an issue with the namespace.
Right now the namespace for the AdminLteAsset
class is dmstr\web
and the PSR 2 specifies that the namespace should start with vendor\package
So I think we need to change it to
namespace dmstr\adminlte\assets;
For the assets and
namespace dmstr\adminlte\widgets;
For widgets. Specially since the dmstr
vendor has already many packages and most of them contains assets or widgets.
Using google chrome, icons works perfectly by using other browsers, icons are not showing.
Now uses "bower-asset/admin-lte": "~2.0",
It is redundant, since the probability of collisions is approximately zero.
I propose to change on https://packagist.org/packages/almasaeed2010/adminlte
"almasaeed2010/adminlte": "~2.0",
This will save the life of ~10 seconds ๐ด โ๏ธ ๐
When I switch to this theme, I have noted that some controls become Inactive. For instance, the bootstrap tab. You can not switch from one tab to another, all the tabs are inactive
I am using yii2-adminlte-asset version 1.1.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.