| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #2 (permalink) | |
| NPQ's PA, Slave, and On Call Coder Technical Services | Quote:
Code: {foreach from=$comments item=comment}
<div class="comment">
Name: {$comment.name|strip_tags|replace:'\\'':''}<br />
Message: {$comment.message|strip_tags|replace:'\\'':''}<br />
<small>Posted on: {$comment.date_added|strip_tags|replace:'\\'':''}</small>
</div>
{/foreach}
PHP Code:
__________________ | |
| |
| | #3 (permalink) | |
| NamePros Regular | Quote:
First one returns this error: Fatal error: Smarty error: [in item.tpl line 83]: syntax error: unrecognized tag: $comment.name|strip_tags|replace:'\\'':'' (Smarty_Compiler.class.php, line 415) in Smarty.class.php on line 1084 Second one (I'd prefer to do it this way) returns the letter 'A' for all of the results for some reason. Also, is there anything anyone recommends as far as inserting the data? Last edited by DylanButler; 05-21-2007 at 01:17 PM. | |
| |
| | #4 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | Ok, try this then PHP Code:
__________________ |
| |
| | #6 (permalink) |
| Buy my domains. | I've never used SMARTY or whatever it is, and so that seems kind of pointless to me. It looks like all it's doing is kind of putting code into an HTML file without using PHP. You might as well just use a PHP file and run the code, so it's more flexible. (I'm probably way off on that, but that's how it looks to me.) I've tried using Django (Python) which uses template files. It seems like a cool idea, but it's easier for me in PHP to just use the dynamic code throughout the template. |
| |
| | #7 (permalink) | |
| NamePros Regular | Quote:
The other advantage is that it allows you to separate the programming logic from the presentation. If you're using PHP for your templates you're allowing each and every designer access to your core code. The disadvantage, as you pointed out, is that it is harder for the programmer to integrate smarty into his script. Last edited by abdussamad; 05-24-2007 at 02:55 PM. | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |