flagflag  If you want to see English page, please click "English" Button at Left.
1: 2021-07-29 (木) 14:07:33 iseki ソース 現: 2021-07-29 (木) 14:14:13 iseki ソース
Line 1: Line 1:
**html_writer [#w159312b] **html_writer [#w159312b]
 +
 +#br
 +
 +*** html_writer API[#u71f5b4f]
 +
 +**** html_writer::select() [#r0fc6497]
 +- html_writer::select()
 + $ltimes = array(1=>0,5,10,15,20,25,30,35,40,45,50,​55,60,65,70,75,80,85,90,95,100,105,110,1​15,120);
 + echo html_writer::select($ltimes, 'lmin', 1, false);
 +**** html_writer::select_time() [#sc80b4fa]
 +- html_writer::select_time()
 + echo html_writer::select_time('years',  'startyear',  0);
 + echo html_writer::select_time('months', 'startmonth', 0);
 + echo html_writer::select_time('days',  'startday',  0);
 +#br
 +- ''v2.2.2+'': html_writer::select_time() は 時間,分の既定値(selected)がうまく機能しない.-> [[修正>/Moodle/Hacking/2.x#d8f40c6e]]
 +#br
 +
 +**** html_writer::table() [#h8d93af0]
 +- html_writer::table($table)
 + $table = new html_table();
 + $table->head = array(title1, title2, title3, ....);
 + $table->align = array('left', 'center', 'center', ....);
 + $table->width = "100%";
 + $table->data[] = array(....) // 1行目
 + $table->data[] = array(....) // 2行目
 + $table->data[] = array(....) // 3行目
 + ....
 + echo html_writer::table($table);
 +#br
 +
*** Sample [#ub070ced] *** Sample [#ub070ced]
 function show_demo_set_header(&$table)  function show_demo_set_header(&$table)
Line 7: Line 38:
   unset($table->size);    unset($table->size);
   unset($table->wrap);    unset($table->wrap);
 + 
   // Header    // Header
   $table->head [] = '#';    $table->head [] = '#';
Line 13: Line 44:
   $table->size [] = '20px';    $table->size [] = '20px';
   $table->wrap [] = 'nowrap';    $table->wrap [] = 'nowrap';
 + 
   $table->head [] = 'Name';    $table->head [] = 'Name';
   $table->align[] = 'center';    $table->align[] = 'center';
   $table->size [] = '80px';    $table->size [] = '80px';
   $table->wrap [] = 'nowrap';    $table->wrap [] = 'nowrap';
 + 
   $table->head [] = 'Value';    $table->head [] = 'Value';
   $table->align[] = 'left';    $table->align[] = 'left';
   $table->size [] = '100px';    $table->size [] = '100px';
   $table->wrap [] = 'nowrap';    $table->wrap [] = 'nowrap';
 + 
   return;    return;
 }  }
- +  
 + 
 function show_demo_disp_table()  function show_demo_disp_table()
 {  {
   global $CFG, $DB;    global $CFG, $DB;
 + 
   $table = new html_table();    $table = new html_table();
   $datas = array();    $datas = array();
 + 
   $datas[0]['num']  = 0;    $datas[0]['num']  = 0;
   $datas[0]['name']  = "AAA";    $datas[0]['name']  = "AAA";
   $datas[0]['value'] = "VVV";    $datas[0]['value'] = "VVV";
 + 
   $datas[1]['num']  = 1;    $datas[1]['num']  = 1;
   $datas[1]['name']  = "BBB";    $datas[1]['name']  = "BBB";
   $datas[1]['value'] = "WWW";    $datas[1]['value'] = "WWW";
 + 
   $i = 0;    $i = 0;
   foreach($datas as $data) {    foreach($datas as $data) {
Line 50: Line 81:
       $i++;        $i++;
   }    }
 + 
   show_demo_set_header($table);    show_demo_set_header($table);
   echo '<div align="center">';    echo '<div align="center">';
   echo html_writer::table($table);    echo html_writer::table($table);
   echo '</div>';    echo '</div>';
- + 
-    // +
   return;    return;
 }  }


トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

97 人のユーザが現在オンラインです。 (21 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 97

もっと...

アクセスカウンタ

今日 : 1543315433154331543315433
昨日 : 1412914129141291412914129
総計 : 2346104323461043234610432346104323461043234610432346104323461043
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com