[TYPO3-dev] Multiline typoscript and end parenthesis
Jerome Schneider
j.schneider at ameos.com
Wed Aug 15 11:00:19 CEST 2007
Hi guys,
I have a problem using multiline typoscript syntax describe at [1]
I have a FORMIDABLE_INT cObj that can handle events thrown by the client
browser via ajax. The tasks to execute when event is trigered are
defined by php inside my so-called userobj.
My php lines are confined in a TS multiline notation ( )
The problem is that closing a function call with ");" inside such a
multiline block fools the parser, as it detects it as the end of the
multiline block.
In my TS code (complete below), here are the problematic lines:
$rSql = $GLOBALS["TYPO3_DB"]->exec_SELECTquery(
"title",
"pages",
"uid=" . $iPageUid
); // this line fools the parser
Does anybody knows a workaround to this ? I could surely avoid to place
the ");" on a single line, but this would be really unhandy on the long
term.
Here's my TS code :
# BEGIN CODE ====================================================
config.testform = FORMIDABLE_INT
config.testform < config.tx_ameosformidable.quickconf.nodb
config.testform.elements {
5 = renderlet:TEXT
5.name = pageuid
5.label = Enter a page uid
10 = renderlet:BUTTON
10.label = Click me !
10.onclick {
runat = ajax
params = pageuid
userobj.php (
$aParams = func_get_arg(1);
$iPageUid = intval($aParams["pageuid"]);
if($iPageUid > 0) {
$rSql = $GLOBALS["TYPO3_DB"]->exec_SELECTquery(
"title",
"pages",
"uid=" . $iPageUid
);
if(($aPage = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($rSql)) !== FALSE) {
// page found !
return $this->aORenderlets["box"]->majixReplaceData($aPage["title"]);
}
}
return $this->aORenderlets["box"]->majixReplaceData("Page not
found");
)
}
20 = renderlet:BOX
20.name = box
20.mode = span
}
# END CODE ====================================================
Best regards,
Jerome Schneider
[1]
http://typo3.org/documentation/document-library/core-documentation/doc_core_ts/4.1.0/view/1/2/#id3515513
More information about the TYPO3-dev
mailing list