SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smarty sections and objects?

    Hi,

    I want to display values of objects variables using {section} in Smarty template engine. Those objects are stored in array which is passed to the template system. I prefer that I access the variables using "get" methods that I have wrote for each var, but if not possible it would be ok to be accessed directly.

    What is the syntax of the Smarty to do so?


    AbuAnas

  2. #2
    SitePoint Member
    Join Date
    Mar 2004
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Earth
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the links, but I have already read the manual..

    but it is not mentioned in the man how to use objects inside sections. i.e. for arrays:

    {$contacts[customer].name}


    but what about objects? do we use:

    {$contacts[customer]->name}

    and if we want to retrive the name value using getName() method, can we use:

    {$contacts[customer]->getName()}

  4. #4
    SitePoint Member
    Join Date
    Mar 2004
    Location
    Sofia, Bulgaria
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, you can (if i understood correctly your case)


Bookmarks

Posting Permissions

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