Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

> right delimiter and objects

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
taerendil
Smarty Rookie


Joined: 05 Mar 2004
Posts: 5
Location: France

PostPosted: Fri Mar 05, 2004 5:09 pm    Post subject: > right delimiter and objects Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Mar 05, 2004 5:42 pm    Post subject: Reply with quote

maybe use :> as your right delimiter? Or stick with { }, they are still pretty "clear" Wink
Back to top
View user's profile Send private message Visit poster's website
taerendil
Smarty Rookie


Joined: 05 Mar 2004
Posts: 5
Location: France

PostPosted: Fri Mar 05, 2004 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Mar 05, 2004 6:03 pm    Post subject: Reply with quote

I'm sure its possible with a Smarty modification, good luck.
Back to top
View user's profile Send private message Visit poster's website
taerendil
Smarty Rookie


Joined: 05 Mar 2004
Posts: 5
Location: France

PostPosted: Fri Mar 05, 2004 6:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP