如何在typo3 v9 中使用PHP 脚本? [英] How can I use a PHP script in typo3 v9?

查看:30
本文介绍了如何在typo3 v9 中使用PHP 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法在typo3 v9 或更新版本中使用PHP 脚本.如果可能,我更喜欢一种调用函数的方法,而不是将代码嵌入到 HTML 框中.

I'd like to know if there is a way to use a PHP script in the typo3 v9 or a newer version. If possible, I'd prefer a way to call a function and not to embed the code in an HTML box.

非常感谢

推荐答案

简史:

在早期(TYPO3 4.2 之前)有一个 PHP 内容元素.至于插入错误代码的可能性,它已被删除.

in earlier days (TYPO3 prior to 4.2) there was a PHP content element. As of the possibility to insert bad code it was removed.

然后有可能通过打字稿将任何带有 PHP 代码的文件包含为 userfunc.

then there was a possibilty to include any file with PHP code by typoscript as a userfunc.

这受到 TYPO3 6 的限制,因为您现在只能将类的方法用作 userfunc.

That was restricted by TYPO3 6 as you now can only use methods of classes as userfunc.

对于前端的使用,您可以构建一个插件,这样编辑器可以根据需要使用function(带参数).或通过打字稿 (userfunc) 将其包含在您需要的地方.这可以通过扩展(如bandanh评论)轻松完成,因此您的代码是可部署并且可以包含在任何安装中.

For usage in the front end you can build a plugin, so the editor can use a function (with parameters) as desired. or include it by typoscript (userfunc) where you need it. This can be easily done with an extension (as bandanh commented), so your code is deployable and can be included in any installation.

这篇关于如何在typo3 v9 中使用PHP 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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