TSref/PHP SCRIPT

From TYPO3Wiki

Jump to: navigation, search
TypoScript Referenz - PHP_SCRIPT
Translations info
An english page for every translation.
All pagenames in english.

  en       de   nl   fr   ja   zh  

TypoScript

PHP_SCRIPT

This includes a PHP-script. You should not name these script ".php" but rather ".inc" as it's meant to be included and not executed on it's own.

NOTE: This options is ignored if $TYPO3_CONF_VARS["FE"]["noPHPscriptInclude"]=1; is set in localconf.php.

Property: Data type: Description: Default:
file resource File that will be included. This file must be valid PHP-code! It's included with "include()";

Directions:

1) All content must be put into $content. No output must be echo'ed out!

2) Call $GLOBALS["TSFE"]->set_no_cache(), if you want to disable caching of the page. Set this during development! And set it, if the content you create may not be cached.

NOTE: If you have a parsing error in your include script the $GLOBALS["TSFE"]->set_no_cache() function is NOT executed and thereby does not disable caching. Upon a parse-error you must manually clear the page-cache after you have corrected your error!

3) the array $conf contains the configuration for the PHP_SCRIPT cObject. Try debug($conf) to see the content printed out for debugging!

See later in this manual for an introduction to writing your own PHP include-scripts.

[tsref:(cObject).PHP_SCRIPT]

Personal tools