Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * utility create table use template_table2.php file
  5. *
  6. */
  7.  
  8. namespace news2\views\util;
  9.  
  10. use framework2\lib\html_view\HtmlDts;
  11. use news2\views\CreateTablesec1;
  12.  
  13. class CreateTablesec1Temp2
  14. {
  15. /**
  16. * table view function
  17. *
  18. * @param array $h2plain
  19. * @param string $caption
  20. * @param array $th
  21. * @param array $td
  22. * @param array $p
  23. * @param HtmlDts $htmldts
  24. */
  25. public static function view (array $h2plain,
  26. string $caption,
  27. array $th,
  28. array$td ,
  29. array $p,
  30. HtmlDts $htmldts)
  31. {
  32. $render = "createTablesec1"; # rendering file
  33. $temp = "template_table2"; # template file
  34.  
  35. $dt = [];
  36.  
  37. $dt[0][0][0] = "plain";
  38. $dt[0][0][] = $h2plain; # ex. $h2plain=["link"=>"val1","str"=>"val2"]
  39. $dt[1][0][0] = "table";
  40. $dt[1][0]["caption"] = $caption;
  41. $dt[1][0]["th"] = $th;# ex. $th=["","th1","th2"]
  42. $dt[1][0]["td"] = $td;# ex. $td =["","td1","td2","td3"],,,
  43.  
  44. $dt[1][1][0] = "tag";
  45. $dt[1][1][] = $p;# ex. $p=["p"=>"val"]
  46.  
  47. //ex. $dt[0]はtemplate_table.phpの#h2-1#、$dt[1]は#table1#をreplaceされる
  48. $htmldts->addDtblock($dt[0]);
  49. $htmldts->addDtblock($dt[1]);
  50.  
  51. $htmldts->display($render, $temp, $htmldts);
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement