Releases: nova-framework/framework
Improve the Contacts module
Merge pull request #2090 from LuckyCyborg/4.0 Improve the Contacts module
Improve the Messages module
Merge pull request #2089 from LuckyCyborg/4.0 Improve the Messages module
Overall improvements
Merge pull request #2088 from LuckyCyborg/4.0 Overall improvements
Improve the Database Seeding
Merge pull request #2087 from LuckyCyborg/4.0 Improve the Database Seeding
Overall improvements
Merge pull request #2086 from LuckyCyborg/4.0 Overall improvements
Overall improvements
This release add the updates required by Kernel 4.0.62
, where for consistency, the Asset::build()
was renamed Asset::render()
and the previous View::render()
for assets positions become View::position()
with a syntax like:
echo Asset::position('header', 'css');
Improve the Themes
Merge pull request #2084 from LuckyCyborg/4.0 Improve the Themes
Overall improvements
Merge pull request #2083 from LuckyCyborg/4.0 Overall improvements
Update the Themes
Merge pull request #2082 from LuckyCyborg/4.0 Update the Themes
Implementation of the Assets Service
This release add support for the new Assets Service, and needs the Kernel version 4.0.58 or superior.
Notable changes
The Middleware for dispatching the asset files: Nova\Routing\Middleware\DispatchAssetFiles
was moved into namespace Nova\Assets\Middleware
and a new Service Provider: Nova\Assets\AssetServiceProvider
was added, then for upgrading to this application version, you should update your application configuration according.
The Helper Class Nova\Support\Assets
was replaced by the Nova\Assets\Manager
and its associated Facade Nova\Support\Facades\Asset
and offer a slightly different API.
In your Layout files, instead of Assets::css()
and Assets::js()
you should use and echoing the return value of Asset::build($type, $assets)
, for example:
Asset:css(array(
// Bootstrap 3.3.5
vendor_url('bower_components/bootstrap/dist/css/bootstrap.min.css', 'almasaeed2010/adminlte'),
// Bootstrap XL
asset_url('css/bootstrap-xl-mod.min.css', 'themes/admin-lite'),
// Font Awesome
vendor_url('bower_components/font-awesome/css/font-awesome.min.css', 'almasaeed2010/adminlte'),
// Ionicons
vendor_url('bower_components/Ionicons/css/ionicons.min.css', 'almasaeed2010/adminlte'),
// iCheck
vendor_url('plugins/iCheck/square/blue.css', 'almasaeed2010/adminlte'),
// Theme style
vendor_url('dist/css/AdminLTE.css', 'almasaeed2010/adminlte'),
// AdminLTE Skins
vendor_url('dist/css/skins/_all-skins.min.css', 'almasaeed2010/adminlte'),
// Custom CSS
asset_url('css/style.css', 'themes/admin-lite'),
));
should be replaced with:
echo Asset:build('css', array(
// Bootstrap 3.3.5
vendor_url('bower_components/bootstrap/dist/css/bootstrap.min.css', 'almasaeed2010/adminlte'),
// Bootstrap XL
asset_url('css/bootstrap-xl-mod.min.css', 'themes/admin-lite'),
// Font Awesome
vendor_url('bower_components/font-awesome/css/font-awesome.min.css', 'almasaeed2010/adminlte'),
// Ionicons
vendor_url('bower_components/Ionicons/css/ionicons.min.css', 'almasaeed2010/adminlte'),
// iCheck
vendor_url('plugins/iCheck/square/blue.css', 'almasaeed2010/adminlte'),
// Theme style
vendor_url('dist/css/AdminLTE.css', 'almasaeed2010/adminlte'),
// AdminLTE Skins
vendor_url('dist/css/skins/_all-skins.min.css', 'almasaeed2010/adminlte'),
// Custom CSS
asset_url('css/style.css', 'themes/admin-lite'),
));
Finally, the built-in support for @assets()
command within the Template Compiler was removed and you should use @php
commands to enclose the assets management code.
New features
The new Assets Service offer the ability to programmatically register assets in your bootstrap stage from application or modules, or even in Controllers, using a command like:
Assets::register('js', 'https://cdn.ckeditor.com/4.9.2/standard/ckeditor.js', 'footer');
OR, in case you use the Container to resolve the AssetManager on constructor:
$this->assets->register('js', 'https://cdn.ckeditor.com/4.9.2/standard/ckeditor.js', 'footer');
Where the first argument is the asset type, the second is the asset(s) and the third one is the position.
These commands, for working, imply that you have added in your Layout Views the following code:
<?= Assets::render('js', 'footer'); ?>
Where the first argument is the asset type and the second one is the position.
To note that the default and example Layout Views will accept two positions for JavaScript assets: header
and footer
and obviously only the header
position for CSS ones.