I want to call a simple PHP script with typoscript to print the results of it.

I tried this,

lib.doSomething = USER                                                      
lib.doSomething {
       userFunc = fileadmin/pcoShowBlog.inc.php

page.20.marks.kumulierterInhalt  < lib.doSomething

What is wrong in this case?


also tried this:

lib.obj = USER
lib.obj.includeLibs = fileadmin/pcoShowBlog.inc.php
lib.obj.userFunc = Blog->showBlog

page.20.marks.kumulierterInhalt  < lib.obj

and this:

page.10 = USER_INT
page.10 {
  userFunc = In2code\MyUserFuncs\Blog->showBlog

page.20.marks.kumulierterInhalt = page.10.userFunc

1 Answers

Thomas Löffler On Best Solutions

You should not have any PHP files in fileadmin (security)!

Use an own extension and give the class and method name to the userFunc.

lib.doSomething.userFunc = Vendor\ExtensionName\UserFunc\ShowBlog->methodName