|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
taerendil Smarty Rookie
Joined: 05 Mar 2004 Posts: 5 Location: France
|
Posted: Fri Mar 05, 2004 5:09 pm Post subject: > right delimiter and objects |
|
|
In order to have a "clearer" html code, I turned the right delimiter to > (and the left to <smarty:). But something strange happens when I use objects :
<smarty:foreach from=$Obj->Table item=Line>
The first > is found as the right delimiter.
So, I no longer use such a right delimiter but... |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 05, 2004 5:42 pm Post subject: |
|
|
maybe use :> as your right delimiter? Or stick with { }, they are still pretty "clear" |
|
Back to top |
|
taerendil Smarty Rookie
Joined: 05 Mar 2004 Posts: 5 Location: France
|
Posted: Fri Mar 05, 2004 5:52 pm Post subject: |
|
|
It's not a problem for me to use another rd but I just wanted to know if if was possible to use > (with a Smarty modification) _________________ Votre dévoué...
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 05, 2004 6:03 pm Post subject: |
|
|
I'm sure its possible with a Smarty modification, good luck. |
|
Back to top |
|
taerendil Smarty Rookie
Joined: 05 Mar 2004 Posts: 5 Location: France
|
Posted: Fri Mar 05, 2004 6:13 pm Post subject: |
|
|
I tried but I'm not familiar neither with Smarty code nor with regex...
I hope s-o could help !
Here are the results of my search :
[php:1:3ca4bca0fb]
<?php
$pFilepath = 'Identification.tpl';
$File = fopen($pFilepath, 'r');
$StringToAnalyse = fread($File, filesize($pFilepath));
fclose($File);
name="$test->truc" value="Nothing"><p>Something else</p></body></html>';
$LDelim = '<smarty:';
$RDelim = '>';
if(! preg_match_all('`<smarty:\s*((\->|[^>])*)\s*>`ms', $StringToAnalyse, $Result))
echo 'erreur';
else
print_r($Result);
?>
[/php:1:3ca4bca0fb]
It's just a test but it worked a little bit... _________________ Votre dévoué...
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|