tallieutallieu / dry-blog
There is no license information available for the latest version (1.3.11) of this package.
Dry Blog
1.3.11
2023-11-15 14:29 UTC
Requires
- nesbot/carbon: ^2.55
- tallieutallieu/dry-datalist: ^1.0
- tallieutallieu/dry-dbi: ^1.0.8
- tallieutallieu/oak: ^1.0.0
This package is auto-updated.
Last update: 2025-02-15 17:10:22 UTC
README
Blog package for dry including migrations, backend managers, i18n support, categories, blocks, photos and authors.
Index
Installation
composer require tallieutallieu/dry-blog
php oak migration migrate -m blog
Config options
Usage
Register the service provider
<?php $app = new \Oak\Application(); $app->register([ \Tnt\Blog\BlogServiceProvider::class, ]); $app->bootstrap();
Implementation example
Controller
<?php class blog extends base { public static function index(Request $request, Page $page) { $app = Application::get(); $dataList = $app->getWith(DataListInterface::class, [ 'repository' => BlogPosts::published()->recent(), 'urlBuilder' => $app->getWith(BuilderInterface::class, [ 'base' => \dry\url('pages::view', $page), ]), ]); $tpl = parent::get_base_template($request, $page); $tpl->blogPosts = $dataList->getResults(); $tpl->render( 'blog/index.tpl' ); } }