farmerstevieb / tina4php-catalog
Tina4 目录模块
dev-main
2024-05-05 21:32 UTC
Requires
Requires (Dev)
- overtrue/phplint: ^2.0
- phpmailer/phpmailer: ^6.5
- phpunit/phpunit: ^9
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-09-05 22:09:22 UTC
README
# Tina4 CMS 模块 欢迎使用 Tina4CMS 模块,它是如何工作的? ``` composer require tina4stack/tina4cms composer exec tina4 initialize:run ``` 将数据库连接添加到您的 index.php 文件中,该文件已被创建 ``` require_once "vendor/autoload.php"; global $DBA; $DBA = new \Tina4\DataSQLite3("test.db","", "", "d/m/Y"); echo new \Tina4\Tina4Php(); ``` 运行 CMS ```commandline composer start 8080 ``` 打开 CMS 以设置管理员用户 https://:8080/cms/login -> 将开始引导您 ### 登录页面 - home 您需要创建一个名为 "home" 的登录页面,这是您启动功能正常工作的起始页面。 ### 自定义制作 在您的 */src/templates* 文件夹中创建一个 *base.twig* 文件,它需要以下块 ``` {{ title }} {% block headers %} {% endblock %} {% block body %} {% block navigation %} {% include "navigation.twig" %} {% endblock %} {% block content %} {% endblock %} {% block footer %} {% endblock %} {% endblock %} ``` 或者一个扩展 tina4-cms 中现有基的示例 ``` {% extends "@tina4cms/base.twig" %} {% block headers %} {% endblock %} {% block body %} {% block navigation %} {% include "navigation.twig" %} {% endblock %} {% block content %} {% endblock %} {% endblock %} ``` #### navigation.twig 示例,您可以覆盖它 创建一个 *navigation.twig* 文件在您的 *src/templates* 文件夹中 ``` {% set menus = Content.getMenu("") %}- {% for menu in menus %}
- {{ menu.name }} {% if menu.children %}
- {% for childmenu in menu.children %}
- {{ childmenu.name }} {% endfor %}
{% endfor %}