Project

General

Profile

Actions

Feature #17536

closed

Patch for t3lib/class.t3lib_tsparser.php adding php-HEREDOC like syntax

Added by Jerome Schneider over 17 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2007-08-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

Description

The TS multiline parenthesis syntax ( ... ) doesn't allow one to define such a multiline text :

config.something (

// this is php that will be eval'd if needed
$res = substr(
"hello world",
0,
5
);

)

As the ");" closing of call to the php function fools the parser, breaking the multiline block.

I implemented a notation similar to php's HEREDOC syntax ( http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc )

So The resulting TS would be:

config.something <<<SOMEPHP

// this is php that will be eval'd if needed
$res = substr(
"hello world",
0,
5
);

SOMEPHP

Note that "SOMEPHP" is variable and defined to whatever the user needs, thus completely avoiding the possibility of end-tag collision with the content.

I checked with TS analyzer and TS syntax highlighting, and patch works fine.
The patch is targeted for v4.1.1 of the file

(issue imported from #M6160)


Files

heredoc_patch.txt (2.81 KB) heredoc_patch.txt Administrator Admin, 2007-08-16 12:14
patch_heredoc_v2.txt (2.86 KB) patch_heredoc_v2.txt Administrator Admin, 2007-08-16 15:05
doc_core_ts_heredoc.sxw (16.5 KB) doc_core_ts_heredoc.sxw Administrator Admin, 2007-08-16 15:06
Actions

Also available in: Atom PDF