yii2-aprico-asset
this project contine apricot admin panel for yii2
this version is contine:, (*1)
- Apricot Admin assets
- Apricot Admin Layouts
-
Apricot Widgets:, (*2)
- SideBar Widget
- Navbar widget
Attention
this is a TRL Admin Panel now
but in next versions will changed for international use
this is good for TRL languages and bad for LTR.
if you want , help to improve this project for all, (*3)
assets
all origin Apricot assets are here
you can use origin HTML Apricot assets in your project
OR
you can build custom widget from assets.
so the origin Apricot HTML pages are in vendor/yii2-aprico-asset/origin folder, (*4)
install on yii2
add this code to composer.json file:, (*5)
"amintado/yii2-aprico-asset": "2.*"
or Either run, (*6)
php composer.phar require amintado/yii2-aprico-asset "*"
, (*7)
, (*8)
online demo
- Apricot Admin Panel Online DEMO
Usage
add this code to config.php file in component array:
php
'components' => [
'view' => [
'title' => Yii::t('backend','app-name'),
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/amintado/yii2-aprico-asset/example-views/yiisoft/yii2-advanced-app'
],
],
],
]
, (*9)
go to:
vendor/amintado/yii2-aprico-asset/example-views/yiisoft/yii2-app
copy [layouts] and [site] folders to your view folder in your project., (*10)
# header sample code:
here is a sample of Apricot header code.
this code is written in layouts/header.php
````php
<?php, (*11)
use amintado\widgets\Navbar;
use amintado\widgets\NavbarItems;
use Behat\Gherkin\Loader\YamlFileLoader;
use common\models\User;
use common\models\Userinfo;, (*12)
if (!Yii::$app->user->isGuest){
$uid=Yii::$app->user->id;
$username=User::findOne($uid);
try {
$username=$username->fullname;
} catch ( Exception $exception) {
$username='';
}
}, (*13)
Navbar::begin();, (*14)
echo NavbarItems::widget([, (*15)
'right' =>
[
[
'user' =>
[
'name' => $username
],
'weather' =>
[
]
]
],
]);, (*16)
Navbar::end();
````
# sidebar sample code, (*17)
here is a sample code of sidebar widget that is written in layouts/left.php file, (*18)
[
['panel' =>
[
'label' => 'داده های شما',
'items' =>
[
[
'type' => 'single',
'icon' => 'fa fa-map-marker',
'label' => 'مکان ها',
'url' => '#',
'id' => ''
],
[
'type' => 'single',
'icon' => 'fa fa-user',
'label' => 'پروفایل',
'url' => '#',
'id' => ''
],
[
'type' => 'multiple',
'label' => 'محصولات',
'icon' => 'fa fa-inbox',
'badge' => [
'color' => '',
'label' => ''
],
'items' => [
[
'type' => 'single',
'icon' => 'icon-feed',
'label' => 'social',
'url' => '#',
'id' => ''
],
[
'type' => 'single',
'icon' => 'icon-feed',
'label' => 'social',
'url' => '#',
'id' => ''
],
]
]
]
]
],
['panel' =>
[
'label' => 'تنظیمات شما',
'items' =>
[
]
]
]
]
])
?>
content code sample
here is a sample for content code.
this code is written in layouts/content.php file, (*19)
````php, (*20)
````, (*23)
# changelog
2017-4-29
* add origin HTML files to origin folderz, (*24)
# Apricot Admin Origin Version
the apricot HTML that used in this project is 1.3, (*25)