SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $smarty->assign() question

    Which is the good method of assigning value(array or object) to smarty template.

    for example, my domain mapper class returns me a product object and want to pass to smarty template, should is assign product object as such or convert to array and assign?

    ie..
    $smarty->assign('product',$productObject);
    OR
    $smarty->assign('product',(array)$productObject);

    which is good?

    Thanks

  2. #2
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't see what it matters, since Smarty can handle both just fine.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd


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
  •