首页模板文件
设置在后台主题-管理-选中网校课程
然后前台调用代码
{% if code != ‘course-grid-with-condition-index‘ %}
{% cache ‘jianmo/default/‘ ~ code 600 %}
{% include ‘default/‘ ~ code ~ ‘.html.twig‘ with {config:config, category: category} %}
{% endcache %}
{% else %}
{% include ‘default/‘ ~ code ~ ‘.html.twig‘ with {config:config, category: category} %}
{% endif %}
输出course-grid-with-condition-index 名称的twig模板
\app\Resources\views\default\course-grid-with-condition-index.html.twig
其中循环输出课程 加载 ‘course/widgets/course-grid.html.twig‘
位置
app\Resources\views\course\widgets\course-grid.html.twig
其中涉及到的控制器是
\src\AppBundle\Extensions\DataTag\PopularCoursesByCategoryDataTag.php
时间: 2024-11-05 14:59:40