ast / blog-module
为cms设计的博客模块。
1.0.4
2018-04-27 08:02 UTC
Requires
- php: >=7.0.0
- ast/media-module: ~1.2
- composer/installers: ~1.0
- doctrine/dbal: ^2.5
- idavoll/core-module: ~3.0
- idavoll/tag-module: ~3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.7
- fzaninotto/faker: ~1.5
- orchestra/testbench: 3.5.*
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2024-09-12 19:38:56 UTC
README
安装
模块下载
使用AsgardCMS的模块下载命令
php artisan asgard:download:module asgardcms/blog --migrations
这将下载模块并运行其迁移。
如果您想自定义字段、视图等,这是推荐的方式。
Composer
在终端中执行以下命令
composer require asgardcms/blog-module
如果联系人模块完全符合您的使用案例,并且不需要任何更改以适应您的需求,请这样做。
注意:安装后,您需要为后端中的博客模块页面授予所需的权限。
使用
- 您必须在您的前端主题中创建一个
blog.index
和一个blog.show
页面。 - 您可以使用:
route(locale() . '.blog')
链接到博客索引页面 - 在博客索引中,您可以访问一个
$posts
变量,可以对它进行循环 - 要创建指向特定文章的链接:
route(locale() . '.blog.slug', [$post->slug])
- 在博客索引和博客显示页面上,您可以访问一个包含最新文章的
$latestPosts
变量,这个数量可以在管理中配置。 - 在文章详细页面上,您可以通过调用访问下一篇文章和上一篇文章:
$post->present()->previous
$post->present()->next
资源
信息
所有AsgardCMS模块都遵循语义版本控制。