Skip to content

pengmaradi/userFunc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

userFunc

TYPO3 TYPOSCRIPT userFunc

Ab TYPO3 7.6

<?php 
namespace Myvendor\Myincludes;
class Example {
    public function myExampleFunction($content, $conf) {
        $color = $conf['userFunc.']['color'];
        return '<p style="color:' . $color. ';">Dynamic time: ' . date('H:i:s') . '</p><br />';
    }
}

TypoScript

page.30 = USER_INT
page.30 {
  userFunc = Myvendor\Myincludes\Example->myExampleFunction
  userFunc.color = #ff0000
}

ExtBase Extension mit userFunc Action

  • TypoScript
10 = USER_INT
10 {
    userFunc       = TYPO3\CMS\Extbase\Core\Bootstrap->run
    vendorName     = MyVendor\Myincludes
    extensionName  = MyExtension
    pluginName     = Pi1
    switchableControllerActions {
        Example {
            1 = myUserFunc
        }
    }
}
  • Controller
<?php
namespace MyVendor\MyExtension\Controller;

class ExampleController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
    public function listAction() {
        ...
    }
    
    public function myUserFuncAction() {
        return '<p style="color: red;">Dynamic time: ' . date('H:i:s') . '</p><br />';
    }

}

About

TYPO3 TYPOSCRIPT userFunc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published