在TYPO3后端中包含CSS文件? [英] Including CSS File in TYPO3 Backend?

查看:64
本文介绍了在TYPO3后端中包含CSS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的级联样式表包含到我的TYPO3扩展中.我用"kickstarter"创建了扩展名.这是我尝试包含的方式:

I am trying to include my cascading style sheet into my TYPO3 extension. I created the extension with "kickstarter". This is the way I tried to include it:

$this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('myExt') . 'res/css/my_stylesheet.css');

我在main()方法的末尾添加了该行. 那我在做什么错?包含文件的路径确实存在.

I added that line at the end of the main() method. So what am I doing wrong? The path including the file does definately exist.

谢谢.

推荐答案

好,我终于可以解决问题了.

Ok, I could finally solve the problem.

在实例化"doc"对象后立即添加代码时,一切正常.

When adding the code right after instancing the "doc" object, everything works fine.

$this->doc = t3lib_div::makeInstance('mediumDoc');
$this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('myExt') . 'res/css/my_stylesheet.css');

这篇关于在TYPO3后端中包含CSS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆