give me a solution to a problem in PHP. Must have smarty knowledge. $10, quick fix

Discussion in 'Services' started by SedNaX, Jan 14, 2007.

  1. #1
    I've been busy with this all day, for just two lines of code... help me out ;)

    this is the thread: http://forums.digitalpoint.com/showthread.php?t=219294

    so i need to convert {$cat.ID} (smarty language) into $id (php language). The one that give me the working solution gets $10!

    If you know how to do this, this is $10 in less than a minute :)
     
    SedNaX, Jan 14, 2007 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    As Seller:
    100% - 0
    As Buyer:
    100% - 3
    #2
    I doubt that I will be the one with the correct answer. :)

    But, a little more information about the context and what you want to do with the result might help someone more knowledgable help you.

    If $id= {$cat.ID} doesn't do it I won't know the answer.

    Not a smarty fan here at all.
     
    Colbyt, Jan 14, 2007 IP
  3. empservices

    empservices Peon

    Messages:
    975
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    the thing is that {$cat.ID} is set in the corresponding .php file usning something like assign_by_reference('cat', $category);
    where cat is the php variable and $category is the PHP variable used to populate it.

    Therefore if you see where the $cat.ID came from you should be able to use it.

    Also you will not be able to extract the {$cat.ID} out as it's in a template, the template has no variables, it's a simple text file with tags replaced.

    So you HAVE to do it in the calling PHP file.
     
    empservices, Jan 14, 2007 IP