Custom Functions :

Smarty comes with several custom functions that you can use in the templates.
Some of the Custom Functions are given below.

assign

cycle

html_checkboxes:

html_image:

html_options:

html_radios:

html_select_date:

html_select_time:

html_table:

eval:

Question for Smarty

  1. Design a form having the above form fields at least 2 from each in smarty.
  2. Suppose I have an array as array(a1=>array(a11,a12,a13),b1=>array(b11,b12,b13),c1=>array(c11,c12,c13)).
    Write down the code in smarty so that the output will be as follows:
    a11 a12
    a13
    b11 b12
    b13
    c11 c12
    c13
  3. Write the code in smarty so that the in a table the alternative colum have different colors and also it should continue in alternative row.
  4. Write the code in smarty so that I have four check boxes and all the check boxes are checked and have the value which is different from the output value;
  5. Write the code in smarty so that I have an image having height of 40px ahd width of 40px .
  6. Write code so that I have three drop down fields one for country, one for state and one for district when i select the country then the corresponding state should display and when i select the state then the corresponding district should display.
  7. Suppose I have two associative arrays like
    $smarty->assign('a', array(1=>array('subha','amar'),4=>array('nibedita','harapriya')));
    $smarty->assign('b', array(1=>array(8,9),4=>array(11,12)));
    The output should be as follows:
    subha   amar
    nibedita   harapriya
  8. Show the drop down for date in which the starting year will be 2011 and ending year will be 2018 the year should be in ascending order.
  9. Show the drop down for hour,minute and second and should show in 12hour format and show AM and PM.
  10. Suppose I have an array $smarty->assign('arr',array('a'=>array('b','c','d'),'e'=>array('f','g','h'),'f'=>array('f','g','h'))); Write the code so that the output will be like this:
    bc
    d

    f
    g
    h

    fg
    h
After editing Click here:
Php Code :
Output:
Hello World
Smarty Code :