davidhirtz / yii2-anakin
Admin theme for ANAKIN admin panel based on Yii 2.0 framework
Package info
github.com/davidhirtz/yii2-anakin
Type:yii2-extension
pkg:composer/davidhirtz/yii2-anakin
Requires
- php: ^8.3
- davidhirtz/yii2-skeleton: ^3.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.5
- symfony/browser-kit: ^7.4
- symfony/css-selector: ^7.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main / 3.x-dev
- 3.1.1
- 3.1.0
- 3.0.0
- v2.x-dev
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.x-dev
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- dev-next
- dev-master
This package is auto-updated.
Last update: 2026-09-25 10:37:41 UTC
README
The Anakin admin theme for yii2-skeleton:
a stylesheet layered over the skeleton's admin CSS, the Anakin logo in the navbar and the aside, a themed
dashboard, a mail layout and a default contact address. It depends on davidhirtz/yii2-skeleton alone and has
no module, no database tables and no console commands.
Installation
composer require davidhirtz/yii2-anakin
The bundle bootstraps itself through extra.bootstrap (Hirtz\Anakin\Bootstrap). There is nothing to migrate.
Put the project's own files where the theme looks for them:
| File | Used by |
|---|---|
web/images/admin/logo.svg |
The dashboard logo (AnakinAssetBundle::DEFAULT_LOGO_URL) |
web/images/mail/logo.svg |
The mail header logo (AnakinMailAssetBundle::MAIL_LOGO_URL); falls back to the admin logo |
web/images/favicons/favicon.svg |
The admin favicon |
Each is optional: a missing logo renders nothing.
Configuration
Bootstrap registers, in this order, all of it overridable from config/web.php:
- The
@anakinalias (the bundle'ssrc/) and the alias@skeleton/../resources/mail/layouts/html, re-pointed toresources/mail/layouts/html.php, so the skeleton mailer'shtmlLayoutrenders the Anakin layout. - The
anakinmessage source (messages/,forceTranslation), unless the project configured one. params.emaildefaults tohello@anakin.co, the sender of the skeleton's account mails and the address on the error page. A project sets its own inconfig/params.php.Hirtz\Skeleton\Assets\AdminAssetBundle::$faviconOptionspointing at/images/favicons/favicon.svg(sizesany,typeimage/svg+xml).view.theme.pathMapmapping the skeleton'sresources/views/admin/dashboardto the bundle'sresources/views/dashboard.- Container definitions binding
Hirtz\Skeleton\Modules\Admin\Widgets\Navs\NavBartoModules\Admin\Widgets\Navs\AnakinNavBarand…\AsideMenutoAnakinAsideMenu, only where the container has none. A project's own definition for either class wins. Assets\AnakinAssetBundleon every action of the admin module.- With
davidhirtz/yii2-mediainstalled,modules.media.avifQualityof80(Bootstrap::MEDIA_AVIF_QUALITY, the media default is60), unless the project configured its own.
The bundle has no module, so there are no modules.<id>.* flags. Its options live on the two asset bundles,
set through components.assetManager.bundles:
| Bundle | Property / method | Default | Meaning |
|---|---|---|---|
Assets\AnakinAssetBundle |
$logoAttributes |
['style' => ['height' => '6rem']] |
Attributes of the dashboard logo <img> |
Assets\AnakinAssetBundle |
setLogoUrl(string|false|null) |
null |
null uses /images/admin/logo.svg if the file exists, false renders no logo, a string is used as is |
Assets\AnakinMailAssetBundle |
$showAnakinLogo |
true |
Renders the Anakin logo below the mail body |
Assets\AnakinMailAssetBundle |
$logoWidth |
'250px' |
CSS width of the mail header logo |
Assets\AnakinMailAssetBundle |
setLogoUrl(string|false|null) |
null |
null uses /images/mail/logo.svg, then the admin logo; the URL is made absolute with urlManager.hostInfo |
'components' => [ 'assetManager' => [ 'bundles' => [ \Hirtz\Anakin\Assets\AnakinAssetBundle::class => [ 'logoAttributes' => ['style' => ['height' => '4rem']], ], \Hirtz\Anakin\Assets\AnakinMailAssetBundle::class => [ 'showAnakinLogo' => false, 'logoWidth' => '180px', ], ], ], ],
AnakinMailAssetBundle registers no CSS or JS; it only carries the mail layout's options. Since the mail logo URL
is absolute, a console command sending mail needs urlManager.hostInfo; without it the layout renders no
header logo.
The theme
AnakinNavBarrenders the inline SVG logo before the navbar items;AnakinAsideMenurenders it again as the aside header throughAnakinLogo::make()->useHref(), referencing the navbar's definition. The logo links to the dashboard for a logged-in user.- The dashboard view greets the user (
ANAKIN_DASHBOARD_HEADER), shows the project logo throughAnakinDashboardLogo, the skeleton's migration, directory, environment and Sentry alerts, the dashboard panels and the Anakin contact card (ANAKIN_DASHBOARD_CONTACT). - The mail layout inlines its styles, loads the
ATC OverlookandBebas Neuefonts fromhttps://www.anakin.co/mail/and forces a light colour scheme. - The stylesheet is built from
resources/assets/src/css/anakin.scsswithnpm run buildinside the bundle, which needs the skeleton'snode_modules; the builtresources/assets/dist/css/anakin.cssis committed, so a project installing the bundle builds nothing.
Messages live in messages/<lang>/anakin.php for de, en-US, fr and pt.