更新时间:2023-11-08 23:14:40
Notice that there is a different approach available in TYPO3 v8 using the HeaderAssets
and FooterAssets
sections in your template. Thus your action template could look like this:
Your template code
<f:section name="FooterAssets">
<link rel="stylesheet" href="{f:uri.resource(path: 'Css/ext_booking_manager.css')}"/>
<script src="{f:uri.resource(path: 'Js/ext_booking_manager.min.js')}"></script>
</f:section>
这样,您的控制器不需要任何资源逻辑,因此可以删除initializeAction()
方法.
This way you don't need any resource logic in your controller, thus your initializeAction()
method can be dropped.
顺便说一句:我建议使用JavaScript
作为JavaScript资源的目录名称,以与TYPO3约定保持一致.
BTW: I'd recommend using JavaScript
as directory name for JavaScript resources to stay in line with TYPO3 conventions.