Smarty Checkbox not displaying in HTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aditya2
    New Member
    • May 2010
    • 3

    Smarty Checkbox not displaying in HTML

    I am having problem displaying the contents of array into Smarty Checkbox in HTML

    The details of array $people are:

    $people = Array ( [1746524] => Allen Jamie [3118171] => Browning Andy [1246417] => Barrett Rich [4677613] => Chang Dongin [2962280] => Chupack Marla [1193259] => Dimmitt Holly [1828493] => Ezell Trevor L)

    Code:
    PHP code:
    
    foreach ($rawPeople->person as $p)
      {	  
        $lastname = (string)$p->{'last-name'};
        $firstname = (string)$p->{'first-name'};
        $name = $lastname." ".$firstname;
    	$people[(int)(string)$p->id] = $name;
      }
    
    $smartyObj = new ConfigSmarty();
    $smartyObj->assign('mt',$people);
    
    
    HTML:
    
    <tr><td>{html_checkboxes name='id' options=$mt
       		 separator='<br />'} </td></tr>

    The checkbox just does not display at all.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    What does the HTML output look like, exactly?
    And where do you call the display or fetch method on the Smarty object?

    Comment

    • aditya2
      New Member
      • May 2010
      • 3

      #3
      The html does not diaplay anything.

      This is just a short snippet of the code , I have called the diaplay mehtod on the smaty object at the end.

      Like this

      Code:
      $smartyObj = new ConfigSmarty();
      $smartyObj->assign('mt',$people);
      $smartyObj->display('ts3.html');
      Last edited by Dormilich; May 31 '10, 02:18 PM. Reason: Please use [code] tags when posting code

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Ok. Why do you use a ConfigSmarty class, rather than the usual Smarty class? Is it a custom extension? Anything in there that could be affecting it in this way?

        And do you have the error messages turned on? Any error messages would help finding potential bugs.

        Comment

        • aditya2
          New Member
          • May 2010
          • 3

          #5
          Yes configSmarty is the customized version which extends smarty.

          And the other works just fine for radio buttons and drop down list.
          I cannot see any error , just a blank html page.

          I tried to print the contents of array $people. Which I uploaded in the previous post.
          It is of the exact format needed in html_checkboxes .

          Comment

          Working...