Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: $15 for Indexu Commercial Template Pack!

  1. #16
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    I could agree with that. my take on SMARTY is, if you are not comfortable with reading/writing some basic PHP code, you will not feel comfortable with SMARTY.

    here is a SMARTY example
    Code:
    Name: {$name|capitalize}<br>
    Address: {$address|escape}<br>
    Date: {$smarty.now|date_format:"%Y-%m-%d"}<br>
    
    <table>
    {section name=mysec loop=$name}
    {strip}
       <tr bgcolor="{cycle values="#eeeeee,#dddddd"}">
          <td>{$name[mysec]}</td>
       </tr>
    {/strip}
    {/section}
    </table>
    
    <table>
    {section name=mysec loop=$users}
    {strip}
       <tr bgcolor="{cycle values="#aaaaaa,#bbbbbb"}">
          <td>{$users[mysec].name}</td>
          <td>{$users[mysec].phone}</td>
       </tr>
    {/strip}
    {/section}
    </table>
    and that is just the HTML file. you (or someone) will still need to go into the PHP file and assign the actual data values to the variables in order for the data to print in the SMARTY template.

    Here is an example of that assignment in SMARTY:
    Code:
    $smarty->assign('users', array(
    	array('name' => 'bob', 'phone' => '555-3425'),
    	array('name' => 'jim', 'phone' => '555-4364'),
    	array('name' => 'joe', 'phone' => '555-3422'),
    	array('name' => 'jerry', 'phone' => '555-4973'),
    	array('name' => 'fred', 'phone' => '555-3235')
    	));
    just your standard array inside of an array. not much different that just plain old PHP.



    .
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  2. #17
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    considering that smarty is ment to seperate code from design, it probably does get a little bogged down sometimes
    Last edited by inspireme; 01-08-2005 at 04:48 PM.

  3. #18
    Join Date
    Feb 2004
    Posts
    455

    Default

    Quote Originally Posted by inspireme
    considering that smarty is ment to seperate code from design, it probably does get a little bogged down sometimes
    Hello,

    I personaly think that smarty is one of the worst program I had the misfortune to use, it does not compile template very well in the best case and if you have Java in the template it may not compile at all.
    If you are a programmer you will not have any problem but if you are a programmer you do not need it.

  4. #19
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    Smarty does allow you to develop complicated code without having to mess with php, you can use loops, and other programming functions in the template to get the results you need without worrying about breaking the php code. I reckon this would only by an advantage to indexU users that really want to change the program. For out of the box users its an added complication.

Similar Threads

  1. switch to smarty template engine
    By dody in forum v5.x
    Replies: 20
    Last Post: 01-10-2005, 04:58 PM
  2. Undestanding templates
    By dody in forum Tutorials, Hints & Tips
    Replies: 2
    Last Post: 01-04-2004, 03:37 AM
  3. Replies: 3
    Last Post: 04-24-2003, 04:31 PM
  4. Replies: 6
    Last Post: 11-11-2002, 02:31 AM
  5. Replies: 1
    Last Post: 06-24-2002, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •