2 single: ウェブ開発 (CGI ライブラリ); はじめに
4 ===========================
6 ===========================
8 Ring で記述された CGI ライブラリでウェブアプリケーションを開発する方法を学びます。
12 pair: ウェブ開発 (CGI ライブラリ); Apache ウェブサーバーの設定
15 ===========================
17 CGI の実行に対応しているウェブサーバーであれば Ring を使えます。
19 Apache HTTP サーバーでの Ring の用法を学びます。
21 こちらから Apache をダウンロードできます。 : http://httpd.apache.org/
23 または、ほかのプロジェクトに同梱されているものを入手できます。
25 XAMPP : https://www.apachefriends.org/download.html
31 xampp\apache\conf\httpd.conf
43 Options FollowSymLinks +ExecCGI
50 Options FollowSymLinks +ExecCGI
52 この行を検索してコメントアウトされていないことを確認してください。
56 LoadModule cgi_module modules/mod_cgi.so
58 検索 : AddHandler cgi-script
60 CGI 拡張機能を拡張子 ”.ring” へ対応させます。
66 AddHandler cgi-script .cgi .ring
72 AddHandler cgi-script .cgi .pl .asp .ring
76 Web サーバーが対応しているディレクトリへウェブアプリケーションを作成します。
82 Apache2.2\htdocs\mywebapplicationfolder
88 xampp\htdocs\mywebapplicationfolder
90 この行をソースコードファイル (\*.ring) の内側に追加します。
96 .. note:: 前述の行はシステムにある ring.exe のパスに基づいて変更してください。
99 pair: ウェブ開発 (CGI ライブラリ); Ring CGI - Hello World プログラム
101 Ring CGI - Hello World プログラム
102 ==================================
104 このプログラムは、 Hello World プログラムです。
110 See "content-type: text/html" +nl+nl+
115 pair: ウェブ開発 (CGI ライブラリ); ウェブライブラリ版 Hello World プログラム
117 ウェブライブラリ版 Hello World プログラム
118 =========================================
120 ウェブライブラリで手軽に CGI ウェブアプリケーションを記述できます。
153 .. tip:: 用例①と用例②の違いは、新しいステートメントでオブジェクトを作成するのではなく、
154 WebPage() 関数でページオブジェクトを返すことです。
157 pair: ウェブ開発 (CGI ライブラリ); ウェブライブラリの機能
160 ======================
162 この機能は手軽にウェブアプリケーションを作成するために、ウェブライブラリに実装されています。
175 pair: ウェブ開発 (CGI ライブラリ); HTTP Get の用例
189 Title = "Test HTTP Get"
190 divstart([ :style = StyleSizeFull() ] )
192 text( "Test HTTP GET" )
195 divstart([ :style = Styledivcenter("600px","550px") +
197 divstart([:style = stylefloatleft() + stylesize("100px","100%") +
198 stylecolor("black") + stylegradient(58)])
199 formstart("ex5.ring")
200 tablestart([ :style = stylesize("65%","90%") +
201 stylemarginleft("35%") +
202 stylemargintop("30%") ])
208 cTextboxStyle = StyleMarginLeft("5%") +
209 StyleWidth("250px") +
210 StyleColor("black") +
211 StyleBackColor("white")
212 textbox([ :name = "Name", :style = cTextboxStyle ] )
217 text ( "Address : " )
220 textbox([ :name = "Address", :style = cTextboxStyle] )
228 textbox([ :name = "Phone", :style = cTextboxStyle ])
236 textbox([ :name = "Age", :style = cTextboxStyle ])
244 listbox([ :name = "City", :items = ["Cairo","Riyadh","Jeddah"],
245 :style = stylemarginleft("5%") + stylewidth("400px") ] )
250 text ( "Country : " )
253 combobox([ :name = "Country",
254 :items = ["Egypt","Saudi Arabia","USA"],
255 :style = stylemarginleft("5%") +
258 stylebackcolor("white")+
259 stylefontsize("14px") ])
267 editbox([ :name = "Notes",
268 :style = stylemarginleft("5%") +
269 stylesize("400px","100px")+
271 stylebackcolor("white") ,
272 :value = "write comments here..." ] )
279 submit([ :value = "Send" , :Style = stylemarginleft("5%") ])
303 divstart([ :style = styledivcenter("800px","500px") ])
305 text ( "HTTP GET Response" ) newline()
307 divstart([ :style = stylefloatleft()+stylewidth("10%")+
308 stylecolor("black")+stylegradient(58) ])
312 text ( "Address : " )
320 text ( "Country : " )
325 divstart([ :style = stylefloatleft()+stylewidth("90%")+
326 stylecolor("black")+stylegradient(47) ])
327 divstart([ :style = stylefloatleft() + stylewidth("1%") ])
330 divstart([ :style = stylefloatleft() + stylewidth("95%") ])
332 text ( aPageVars["Name"] )
334 text ( aPageVars["Address"] )
336 text ( aPageVars["Phone"] )
338 text ( aPageVars["Age"] )
340 text ( aPageVars["City"] )
342 text (aPageVars["Country"] )
344 text ( aPageVars["Notes"] )
357 pair: ウェブ開発 (CGI ライブラリ); HTTP POST の用例
375 divstart([ :style=StyleFloatLeft()+StyleWidth("100px") ])
377 text( "Number1 : " ) newline() newline()
378 text( "Number2 : " ) newline() newline()
381 divstart([ :style = styleFloatLeft()+StyleWidth("200px") ])
383 textbox([ :name = "Number1" ]) newline() newline()
384 textbox([ :name = "Number2" ]) newline() newline()
385 submit([ :value = "Send" ] )
406 text( "Post Result" )
409 divstart([ :style = styleFloatLeft()+styleWidth("200px") ])
411 text( "Number1 : " + aPageVars["Number1"] )
413 text( "Number2 : " + aPageVars["Number2"] )
415 text( "Sum : " + (0 + aPageVars["Number1"] + aPageVars["Number2"] ) )
426 pair: ウェブ開発 (CGI ライブラリ); Upload Files
429 ======================
441 text( "Upload File" )
444 for x = 1 to 3 newline() next
445 formupload("ex9.ring")
446 text( "Customer Name : " )
447 textbox([ :name = "custname" ])
449 divstart([ :style = styleFloatLeft() + styleWidth("90px") ])
450 uploadfile("file") newline() newline()
451 uploadfile("file2") newline() newline()
452 submit([ :value = "Send" ])
470 cUploadPath = "C:/Apache2.2/htdocs/ringapp/upload/"
471 cUploadFolder = "/ringapp/upload/"
476 text( "Upload Result" )
480 divstart([ :style= styleFloatLeft() + styleWidth("100px") ])
481 text( "Name : " + aPageVars["custname"] )
484 if aPageVars["file"] != char(13)
485 getuploadedfile(self,"file")
487 if aPageVars["file2"] != char(13)
488 getuploadedfile(self,"file2")
492 Func getuploadedfile oObj,cFile
493 # ここで object.プロパティ を使用
494 # オブジェクトの代わりに { } を使うと braceend メソッドの実行を回避します。
495 cFileName = cUploadPath + oObj.getfilename(aPageVars,cFile)
496 write(cFileName,aPageVars[cFile])
497 system("chmod a+x "+cFileName)
499 oObj.text( "File "+cFileName+ " Uploaded ..." )
501 imageURL = cUploadFolder + oObj.getfilename(aPageVars,cFile)
502 oObj.link([ :url = imageURL, :title = "Download" ])
504 oObj.image( [ :url = imageURL , :alt = :image ] )
513 pair: ウェブ開発 (CGI ライブラリ); Cookies (クッキー)
529 text( "Cookie Test" )
533 link([ :url = "ex11.ring", :title = "Use Cookies" ])
534 cookie("custname","Mahmoud Fayed")
554 text( "Cookies Values" )
557 link([ :url = "ex10.ring", :title = "back" ])
559 divstart([:style="float:left;width:200px"])
560 text( "Name : " + aPageVars["custname"] )
562 text( "Age : " + aPageVars["custage"] )
573 pair: ウェブ開発 (CGI ライブラリ); URL エンコード
592 link([ :url = "ex5.ring?Name="+URLEncode("-*{Mahmoud}*-")+
593 "&Address=Egypt&Phone=123456&Age=28&Notes=Programmer",
594 :title = "Test URL Encode" ])
609 pair: ウェブ開発 (CGI ライブラリ); テンプレート
614 テンプレートで HTML ファイルの内側に Ring コードを記述できます。
627 <h1>Listing Numbers</h1>
630 <th> <%= myheader.cColumn1 %> </th>
631 <th> <%= myheader.cColumn2 %> </th>
636 <% for x in aNumbers %>
638 <td> <%= x.nValue %> </td>
639 <td> <%= x.nSquare %> </td>
652 New NumbersController { start() }
654 Class NumbersController
660 MyHeader = New Header
662 cColumn1 = "Number" cColumn2 = "Square"
667 for x = 1 to len(aNumbers)
668 aNumbers[x] = new number
670 nValue = x nSquare = x*x
674 cTemp = Template("mynumbers.html",self)
679 text( "Test Templates" )
685 Class Header cColumn1 cColumn2
686 Class Number nValue nSquare
694 pair: ウェブ開発 (CGI ライブラリ); HTML の特殊文字
699 text() 関数は HTML の特殊文字を表示します。
701 HTML コードを記述したい場合は html() 関数を使用します。
712 text("HTML Special Characters")
718 <p> "hello world" </p>
731 pair: ウェブ開発 (CGI ライブラリ); ハッシュ関数
750 divstart([ :style = StyleFloatLeft() + StyleWidth("100px") ])
755 formpost("ex16.ring")
756 divstart([ :style = StyleFloatLeft() + StyleWidth("300px") ])
758 textbox([ :name = "Value" ])
760 submit([ :value = "Send" ])
781 text( "Hash Result" )
784 divstart([ :style = styleFloatLeft() + styleWidth("100%") ])
786 text( "Value : " + aPageVars["Value"] )
788 text( "MD5 : " + MD5(aPageVars["Value"]) )
790 text( "SHA1 : " + SHA1(aPageVars["Value"]) )
792 text( "SHA256 : " + SHA256(aPageVars["Value"]) )
794 text( "SHA224 : " + SHA224(aPageVars["Value"]) )
796 text( "SHA384 : " + SHA384(aPageVars["Value"]) )
798 text( "SHA512 : " + SHA512(aPageVars["Value"]) )
809 pair: ウェブ開発 (CGI ライブラリ); 画像の無作為表示
820 cUploadPath = "C:/Apache2.2/htdocs/ringapp/upload/"
828 divstart([ :style = styleFloatLeft() + styleWidth("400px") ])
830 aList = dir(cUploadPath)
832 nIndex = random(len(aList))
833 if nindex = 0 nIndex = 1 ok
834 cItem = "upload/" + aList[nIndex][1]
836 image( [ :url = cItem , :alt = :image ] )
838 text("No images!") newline()
849 pair: ウェブ開発 (CGI ライブラリ); HTML のリスト
854 この用例では、 1 ~ 10 までの数値があるリストの内容を表示します。
856 そして Ring のリストからリストを表示します。
858 最終的にボタンのリストがあり、ボタンが押されたときにクリックされた
859 ボタンの番号を有するメッセージを取得します。
861 リストを開始するには ulstart() 関数を使用します。
863 リストを終了するには ulend() 関数を使用します。
865 listart() と liend() 関数でリストの項目を決定します。
883 list2ul(["one","two","three","four","five"])
887 cFuncName = "btn"+x+"()"
888 button([ :onclick = cFuncName , :value = x])
889 script(scriptfuncalert(cFuncName,string(x)))
901 pair: ウェブ開発 (CGI ライブラリ); HTML のテーブル
906 この用例では tablestart(), tableend(), rowstart(), rowend(),headerstart(),
907 headerend(), cellstart() および cellend() 関数版 HTML テーブルの生成方法を学びます。
918 divstart([ :style = styledivcenter("400px","500px") ] )
919 style(styletable() + styletablerows("t01"))
920 tablestart([ :id = :t01 , :style = stylewidth("100%") ])
922 headerstart([]) text("Number") headerend()
923 headerstart([]) text("square") headerend()
927 cellstart([]) text(x) cellend()
928 cellstart([]) text(x*x) cellend()
942 pair: ウェブ開発 (CGI ライブラリ); グラデーション
947 この用例では StyleGradient() 関数の用法を学びます。
949 関数の入力としてスタイルを数値で指定します (1 から 60 までの範囲)。
961 text("StyleGradient() Function")
964 divstart([ :id = x , :align = "center" ,
965 :style = stylefloatleft() +
966 stylesize(string(100/60*6)+"%","50px") +
979 pair: ウェブ開発 (CGI ライブラリ); オブジェクト版ページ生成
982 ========================
984 HTML ページを生成するために関数、メソッドではなく
985 ページで要素ごとのオブジェクトを使えます。
987 この選択をするとコードは綺麗になりますが、動作速度は遅くなります。
989 最も高速な方法は関数の使用、次に早いのはテンプレートの使用、
990 そして最後にオブジェクトを使用 (低速) して HTML コードを直接出力することです。
1002 Title = "Using objects to create the Web Page content"
1003 h1 { text("welcome") }
1007 Link = "http://www.google.com"
1012 style = stylegradient(30) + stylesize("50%","50%")
1018 backgroundcolor = "green"
1030 backgroundcolor = "silver"
1037 Action = "helloworld.ring"
1040 style = stylewidth("100%") + stylegradient(24)
1043 TD { WIDTH="10%" text("Name : " ) }
1044 TD { Input { type = "text" } }
1048 TD { WIDTH="10%" text("Email : " ) }
1049 TD { Input { type = "text" } }
1053 TD { WIDTH="10%" text("Password : " ) }
1054 TD { Input { type = "password" } }
1059 TD { WIDTH="10%" text("Notes") }
1060 TD { TextArea { width="100%" rows = 10 cols = 10
1061 text("type text here...") } }
1065 TD { WIDTH="10%" text("Gender") }
1070 option { text("Male") }
1071 option { text("Female") }
1077 TD { WIDTH="10%" text("Role") }
1082 multiple = "multiple"
1084 option { text("student") }
1085 option { text("admin") }
1090 Input { type = "submit" value = "send" }
1091 Image { src="upload/profile1.jpg" alt="profile"}
1092 Input { type = "checkbox" value = "Old Member"} text("old member")
1093 Input { type = "range" min=1 max=100}
1094 Input { type = "number" min=1 max=100}
1095 Input { type = "radio" color="black" name="one"
1096 value = "one"} text("one")
1102 backgroundcolor = "blue"
1108 LI { TEXT("THREE") }
1131 onchange = "clickColor(0, -1, -1, 5)"
1141 .. image:: ex21_2.jpg
1142 :alt: オブジェクトの使用 - 第二部
1146 pair: ウェブ開発 (CGI ライブラリ); HtmlPage クラス
1151 このクラスは標準出力を経由せずに HTML ドキュメントを作成します。
1153 ウェブアプリケーションだけで WebLib を使うときの代用になります。
1155 また、コンソール、 GUI、モバイル用のアプリケーションでも使えます。
1159 .. code-block:: ring
1168 mypage = new HtmlPage {
1169 h1 { text("Customers Report") }
1172 style = stylewidth("100%") + stylegradient(4)
1175 TD { WIDTH="10%" text("Customers Count : " ) }
1182 style = stylewidth("100%") + stylegradient(26)
1185 style = stylewidth("100%") + stylegradient(24)
1186 TD { text("Name " ) }
1188 TD { text("Country" ) }
1190 TD { text("Company" ) }
1195 TD { text("Test" ) }
1197 TD { text("Egypt" ) }
1198 TD { text("Sales" ) }
1199 TD { text("Future" ) }
1206 write("report.html",mypage.output())
1209 pair: ウェブ開発 (CGI ライブラリ); 関数版 Bootstrap ライブラリの用法
1211 関数版 Bootstrap ライブラリの用法
1212 =================================
1214 この用例は HTML ページ生成時に Bootstrap JavaScript ライブラリを使います。
1216 .. code-block:: ring
1224 divstart([ :class = "container" ])
1225 divstart([ :class = "jumbotron" ])
1226 h1("Bootstrap Page")
1228 divstart([ :class = :row ])
1229 divstart([ :class = "col-sm-4" ])
1230 h3("Welcome to the Ring programming language")
1231 p([ :text = "Using a scripting language is very fun!" ])
1233 divstart([ :class = "col-sm-4" ])
1234 h3("Welcome to the Ring programming language")
1235 p([ :text = "using a scripting language is very fun!" ])
1237 divstart([ :class = "col-sm-4" ])
1238 h3("Welcome to the Ring programming language")
1239 p([ :text = "using a scripting language is very fun!" ])
1252 pair: ウェブ開発 (CGI ライブラリ); オブジェクト版 Bootstrap ライブラリの用法
1254 オブジェクト版 Bootstrap ライブラリの用法
1255 =========================================
1257 この用例では、 HTML ページの生成時に Bootstrap JavaScript ライブラリを使用します。
1259 HTML 要素の生成関数ではなくオブジェクトを使用します。
1261 .. code-block:: ring
1272 classname = :container
1275 classname = :jumbotron
1276 H1 { text("Bootstrap Page") }
1284 classname = "col-sm-4"
1285 H3 { html("Welcome to the Ring programming language") }
1286 P { html("Using a scripting language is very fun!") }
1295 classname = "col-sm-4"
1298 classname = "btn btn-info btn-lg"
1300 datatarget = "#myModal"
1301 text("Open Large Modal")
1306 classname = "col-sm-4"
1307 Button { classname = "btn btn-default btn-lg" text("default") }
1308 Button { classname = "btn btn-primary btn-md" text("primary") }
1309 Button { classname = "btn btn-sucess btn-sm" text("sucess") }
1310 Button { classname = "btn btn-info btn-xs" text("info") }
1311 Button { classname = "btn btn-warning" text("warning") }
1312 Button { classname = "btn btn-danger" text("danger") }
1313 Button { classname = "btn btn-link" text("link") }
1317 classname = "col-sm-4"
1318 Button { classname = "btn btn-default btn-block" text("default") }
1319 Button { classname = "btn btn-primary btn-block" text("primary") }
1320 Button { classname = "btn btn-sucess btn-block" text("sucess") }
1321 Button { classname = "btn btn-info btn-block" text("info") }
1322 Button { classname = "btn btn-warning btn-block" text("warning") }
1323 Button { classname = "btn btn-danger btn-block" text("danger") }
1324 Button { classname = "btn btn-link btn-block" text("link") }
1328 classname = "col-sm-4"
1329 div { classname = "btn-group"
1330 button { classname="btn btn-primary" text("one") }
1331 button { classname="btn btn-primary" text("two") }
1332 button { classname="btn btn-primary" text("three") }
1337 classname = "col-sm-4"
1338 div { classname = "btn-group btn-group-lg"
1339 button { classname="btn btn-primary" text("one") }
1340 button { classname="btn btn-primary" text("two") }
1341 button { classname="btn btn-primary" text("three") }
1346 classname = "col-sm-4"
1348 classname = "btn-group-vertical btn-group-lg"
1349 button { classname="btn btn-primary" text("one") }
1350 button { classname="btn btn-primary" text("two") }
1351 button { classname="btn btn-primary" text("three") }
1355 div { classname="modal fade" id="myModal" role="dialog"
1356 div { classname = "modal-dialog modal-lg"
1357 div { classname="modal-content"
1358 div { classname="modal-header"
1359 button { classname="close" datadismiss="modal"
1362 h4 { classname="modal-title"
1363 text("Modal Header")
1366 div { classname = "modal-body"
1367 p { text("This is a large model.") }
1369 div { classname="modal-footer"
1370 button { classname = "btn btn-default" datadismiss="modal"
1383 :alt: オブジェクト版 Bootstrap ページ
1386 pair: ウェブ開発 (CGI ライブラリ); MVC 版 CRUD の用例
1391 この用例では、 weblib.ring と datalib.ring を使用します。
1393 datalib.ring には MVC パターンでデータベースアプリケーションを作成するためのクラスがあります。
1395 この用例では SalaryController クラスからオブジェクトを作成して Routing メソッドを呼び出します。
1397 ページの基本的な URL を保持するために変数 website を定義します。
1399 ModelBase クラスから SalaryModel クラスを作成する時に、テーブル salary が開かれ model クラスでカラムデータが属性として定義されます。
1401 SalaryView クラスは、変換用の SalaryLanguageEnglish クラスからオブジェクトを作成します。
1403 AddFuncScript メソッドはフォームへレコードデータを追加、または修正するために使用されます。
1405 FormViewContent メソッドはフォームへレコードを追加、または修正するときにコントロールを決定するために使用されます。
1407 .. code-block:: ring
1414 website = "ex24.ring"
1416 New SalaryController { Routing() }
1418 Class SalaryModel from ModelBase
1420 Class SalaryController From ControllerBase
1422 Class SalaryView From ViewBase
1424 oLanguage = new SalaryLanguageEnglish
1426 Func AddFuncScript oPage,oController
1427 return oPage.scriptfuncajax("myadd",oController.cMainURL+
1428 oController.cOperation+"=add","mysubpage")
1430 Func FormViewContent oController,oTranslation,oPage
1432 [ oTranslation.aColumnsTitles[2], "textbox", "name",
1433 oController.oModel.Name, oPage.stylewidth("100%") ],
1434 [ oTranslation.aColumnsTitles[3], "textbox", "salary",
1435 oController.oModel.Salary, oPage.stylewidth("50%") ]
1438 Class SalaryLanguageEnglish
1439 cTitle = "Salary Table"
1441 aColumnsTitles = ["ID","Name","Salary"]
1442 cOptions = "Options"
1444 comboitems = ["Select Option...","Edit","Delete"]
1445 cAddRecord = "Add Record"
1446 cEditRecord = "Edit Record"
1447 cRecordDeleted = "Record Deleted!"
1448 aMovePages = ["First","Prev","Next","Last"]
1451 cRecordsCount = "Records Count"
1454 cTextAlign = temp.StyleTextRight()
1455 cNoRecords = "No records!"
1462 .. image:: ex24_2.jpg
1466 pair: ウェブ開発 (CGI ライブラリ); ユーザの登録とログイン
1469 ======================
1471 ユーザ名、および電子メールなど利用者のデータを扱うためにユーザクラス (Model,
1472 View および Controller) があります。
1474 このコードは ex25_users.ring として収録しています。
1476 .. code-block:: ring
1478 Class UsersModel from ModelBase
1479 cSearchColumn = "username"
1481 Class UsersController From ControllerBase
1482 aColumnsNames = ["id","username","email"]
1485 oModel.id = aPageVars[cRecID]
1486 oModel.updatecolumn("username", aPageVars[:username] )
1487 oModel.updatecolumn("email", aPageVars[:email] )
1488 oView.UpdateView(self)
1490 Class UsersView from ViewBase
1492 oLanguage = new UsersLanguageEnglish
1494 Func AddFuncScript oPage,oController
1495 return oPage.scriptfunc("myadd",oPage.scriptredirection("ex26.ring"))
1497 Func FormViewContent oController,oTranslation,oPage
1499 [oTranslation.aColumnsTitles[2],"textbox","username",
1500 oController.oModel.UserName,oPage.stylewidth("100%")],
1501 [oTranslation.aColumnsTitles[3],"textbox","email",
1502 oController.oModel.Email,oPage.stylewidth("50%")]
1505 Class UsersLanguageEnglish
1506 cTitle = "Users Table"
1508 aColumnsTitles = ["ID","User Name","Email"]
1509 cOptions = "Options"
1511 comboitems = ["Select Option...","Edit","Delete"]
1512 cAddRecord = "Add Record"
1513 cEditRecord = "Edit Record"
1514 cRecordDeleted = "Record Deleted!"
1515 aMovePages = ["First","Prev","Next","Last"]
1518 cRecordsCount = "Records Count"
1521 cTextAlign = temp.StyleTextRight()
1522 cNoRecords = "No records!"
1524 ファイル ex25.ring では ex25_users.ring を読み込み後に UsersController クラスからオブジェクトを作成します。
1526 作成されたオブジェクトで routing メソッドを呼び出します。
1528 .. code-block:: ring
1533 Load "ex25_users.ring"
1536 website = "ex25.ring"
1537 New UsersController { Routing() }
1546 .. code-block:: ring
1553 website = "ex26.ring"
1560 divstart([:style = stylegradient(6) + stylesize("100%","95%") ])
1561 link([ :url = website, :title = "back" , :style = stylecolor("white")])
1563 divstart([ :style= styledivcenter("500","160") + stylegradient(52) ])
1564 formpost("ex27.ring")
1565 tablestart([ :Style = stylemarginleft("2%") + stylemargintop("2%") +
1566 stylewidth("90%") ])
1568 cellstart([:style = stylewidth("20%") + styleheight(30)])
1571 cellstart([ :style = stylewidth("80%") ])
1572 textbox([:name = "username", :style = stylewidth("100%")])
1576 cellstart([ :Style = styleheight(30)])
1580 textbox([:name = "password" , :type = "password"])
1584 cellstart([ :style = styleheight(30)])
1588 textbox([:name = "email" , :style = stylewidth("100%")])
1592 cellstart([ :style = styleheight(30)])
1594 cellstart([ :style = styleheight(30)])
1595 submit([:value = "Register" ])
1612 .. code-block:: ring
1617 Load "ex25_users.ring"
1621 oUser = new UsersModel
1623 if oUser.findwith("username",aPageVars["username"])
1625 text("The user name is already registered")
1629 if oUser.findwith("email",aPageVars["email"])
1631 text("This email is already registered")
1636 aPageVars["salt"] = str2hex(RandBytes(32))
1637 aPageVars["pwhash"] = sha256(aPagevars["password"]+aPageVars["salt"])
1638 aPageVars["sessionid"] = str2hex(randbytes(32))
1641 cookie("sessionid",aPageVars["sessionid"])
1642 text("New User Created!")
1644 text("User Name : " + aPageVars["username"])
1649 このコードはログインページを示しています。
1651 .. code-block:: ring
1659 website = "ex28.ring"
1666 divstart([:style = stylegradient(6) + stylesize("100%","95%") ])
1667 link([ :url = website, :title = "back" , :style = stylecolor("white")])
1669 divstart([ :style= styledivcenter("500","130") + stylegradient(52) ])
1670 formpost("ex29.ring")
1671 tablestart([ :Style = stylemarginleft("2%") + stylemargintop("2%") +
1672 stylewidth("90%") ])
1674 cellstart([:style = stylewidth("20%") + styleheight(30)])
1677 cellstart([ :style = stylewidth("80%") ])
1678 textbox([:name = "username", :style = stylewidth("100%")])
1682 cellstart([ :style = styleheight(30)])
1686 textbox([:name = "password" , :type = "password"])
1690 cellstart([ :style = styleheight(30) ])
1693 submit([:value = "Login" ])
1710 .. code-block:: ring
1715 Load "ex25_users.ring"
1719 oUser = new UsersModel
1721 lResult = oUser.FindWith("username",aPageVars["username"])
1724 if sha256(aPagevars["password"]+oUser.Salt) = oUser.pwhash
1725 text ("Correct Password!")
1726 aPageVars["sessionid"] = str2hex(randbytes(32))
1727 oUser.UpdateColumn("sessionid",aPageVars["sessionid"])
1728 cookie("sessionid",aPageVars["sessionid"])
1730 text ("Bad password!")
1733 text("Bad User Name!")
1738 このコードはユーザのログインが必要かどうかを確認するためのものです。
1740 .. code-block:: ring
1745 Load "ex25_users.ring"
1749 oUser = new UsersModel
1751 lResult = oUser.FindWith("sessionid",aPageVars["sessionid"])
1754 text("User Name : " + oUser.username )
1756 text("Please Login First!")
1762 pair: ウェブ開発 (CGI ライブラリ); Database, ModelBase と ControllerBase クラス
1764 Database, ModelBase と ControllerBase クラス
1765 ============================================
1767 datalib.ring からコードの一部を示します。
1769 このコードでは Database, ModelBase と ControllerBase クラスです。
1771 .. code-block:: ring
1777 cServer = "localhost"
1785 mysql_connect(con, cServer, cUserName, cPassWord,cDatabase)
1793 mysql_query(con,cQuery)
1797 return mysql_result(con)
1799 Func QueryResultWithColumns
1801 return mysql_result2(con)
1804 aResult = mysql_result(con)
1805 if islist(aResult) and len(aResult) >= 1
1806 aResult = aResult[1]
1807 if len(aResult) >= 1
1815 return MySQL_Escape_String(con,x)
1817 return MySQL_Escape_String(con,string(x))
1823 Class ModelBase from Database
1826 cSearchColumn = "name"
1831 # クラス名からテーブル名を設定します。
1832 classname = lower(classname(self))
1833 if right(classname,5) = :model
1834 cTablename = left(classname,len(classname)-5)
1841 cValues += "'" + EscapeString(aPageVars[x]) + "',"
1843 cValues = left(cValues,len(cValues)-1) # 末尾のカンマを削除
1848 cColumns = left(cColumns,len(cColumns)-1)
1849 query("insert into " + cTableName + "("+cColumns+") values (" +
1856 cStr += x + " = '" + EscapeString(aPageVars[x]) + "' , "
1859 cStr = left(cStr,len(cStr)-2)
1860 query("update " + cTableName + " set " + cStr + " where id = " + nID )
1862 Func UpdateColumn cColumn,cValue
1863 query("update " + cTableName + " set " + cColumn + " = '" +
1864 EscapeString(cValue) + "' where id = " + self.ID )
1869 query("SELECT count(*) FROM " + cTableName +
1870 " where "+cSearchColumn+" like '" + EscapeString(cValue) + "%'")
1873 Func Read nStart,nRecordsPerPage
1875 query("SELECT * FROM "+ cTableName+" limit " + EscapeString(nStart) + "," +
1876 EscapeString(nRecordsPerPage) )
1877 aQueryResult = queryResult()
1879 Func Search cValue,nStart,nRecordsPerPage
1881 query("SELECT * FROM "+ cTableName+" where "+cSearchColumn+" like '" +
1882 EscapeString(cValue) + "%'" +
1883 " limit " + EscapeString(nStart) + "," + EscapeString(nRecordsPerPage) )
1884 aQueryResult = queryResult()
1888 query("select * from " + cTableName + " where id = " + EscapeString(nID) )
1889 aResult = queryResult()[1]
1890 # オブジェクトの属性から配列へ結果を移動
1893 for x = 2 to len(aResult)
1894 cCode += aColumns[x-1] + " = hex2str('" + str2hex(aResult[x]) + "')" + nl
1898 Func FindWith cColumn,cValue
1900 query("select * from " + cTableName + " where "+cColumn+" = '" +
1901 EscapeString(cValue) + "'" )
1902 aResult = queryResult()
1904 aResult = aResult[1]
1908 # オブジェクトの属性から配列へ結果を移動
1911 for x = 2 to len(aResult)
1912 cCode += aColumns[x-1] + " = hex2str('" + str2hex(aResult[x]) + "')" + nl
1919 query("delete from " + cTableName + " where id = " + EscapeString(ID) )
1925 cCode += x + ' = ""' + nl
1932 query("SELECT * FROM "+ cTableName + " limit 0,1")
1933 aQueryResult = QueryResultWithColumns()[1]
1934 for x = 2 to len(aQueryResult)
1935 aColumns + lower(trim(aQueryResult[x]))
1940 addattribute(self,x)
1956 Class ControllerBase
1963 # oView = new tablenameView と oModel = new tablename.Model の動的生成
1964 classname = lower(classname(self))
1965 if right(classname,10) = :controller
1966 tablename = left(classname,len(classname)-10)
1967 cCode = "oView = new " + tablename+"View" + nl
1968 cCode += "oModel = new " + tablename+"Model" + nl
1973 cSearchName = "searchname"
1975 cPageError = "The page number is not correct"
1977 cOperation = "operation"
1980 aColumnsNames = ["id"]
1981 for t in oModel.aColumns
1985 cMainURL = website + "?"
1989 switch aPageVars[cOperation]
1992 on :save saverecord()
1993 on :delete deleterecord()
1994 on :edit editrecord()
1995 on :update updaterecord()
2000 nRecordsCount = oModel.Count( aPageVars[cSearchName] )
2002 nPagesCount = ceil(nRecordsCount / nRecordsPerPage)
2004 if aPageVars[cPart] = cLast
2005 aPageVars[cPart] = string(nPagesCount)
2008 nActivePage = number(aPageVars[cPart])
2009 if nActivePage = 0 nActivePage = 1 ok
2011 if ( nActivePage > nPagesCount ) and nRecordsCount > 0
2012 ErrorMsg(cPageError)
2016 nStart = (nActivePage-1)*nRecordsPerPage
2018 if aPageVars[cSearchName] = NULL
2019 oModel.Read( nStart,nRecordsPerPage )
2021 oModel.Search( aPageVars[cSearchName],nStart,nRecordsPerPage )
2024 oView.GridView(self)
2029 oView.FormViewAdd(Self,:save,false) # false ならば レコード ID はない
2034 oView.SaveView(self)
2038 oModel.Find( aPageVars[cRecID] )
2039 oView.FormViewEdit(Self,:update,true) # true ならば レコード ID はある
2043 oModel.update( aPageVars[cRecID] )
2044 oView.UpdateView(self)
2048 oModel.Delete( aPageVars[cRecID] )
2056 pair: ウェブ開発 (CGI ライブラリ); WebLib API
2061 ウェブライブラリ関数、クラスとメソッドについて示します。
2063 ===================== ============= =================================================================================
2065 ===================== ============= =================================================================================
2066 LoadVars なし aPageVars リストにリクエストの仮引数とクッキーを保存します。
2067 WebPage なし WebPage クラスから新しいオブジェクトを作成します。
2068 BootStrapWebPage なし BootStrapWebPage クラスから新しいオブジェクトを作成します。
2069 HTMLSpecialChars cString HTML と等価な特殊文字をエンコードします。
2070 Template cFile,oObject { } で oObject へアクセス後に cFile にある Ring コードを実行します。
2071 Alert cMessage cMessage を表示するために JavaScript Alert() で HTML ページを生成します。
2072 HTML2PDF cString HTML 文字列 (cString) から PDF ファイルの生成と表示を行います。
2073 ===================== ============= =================================================================================
2075 このようなクラスが Package System.Web にあります。
2077 ===================== ================================================================================
2079 ===================== ================================================================================
2080 Application エンコーディング、デコーディング、クッキーなど様々なメソッドがあります。
2081 Page HTML ページを生成するためのメソッドがあります。
2082 ScriptFunctions JavaScript 関数を生成するためのメソッドがあります。
2083 StyleFunctions CSS を生成するためのメソッドがあります。
2084 PageBuffer HTML ページをメモリへ生成します (出力を表示しません)。
2085 HTML2PDF HTML コードから PDF ファイルを生成します。
2086 BootStrapPage BootStrap ライブラリを使用します。
2087 WebPage 各要素のオブジェクトでページを生成しますす。
2088 HtmlPage WebPage と同様、標準出力への出力は行いますが表示はしません。
2089 BootStrapWebPage BootStrap ライブラリではオブジェクトによりページを生成します。
2090 ObjsBase page オブジェクトの親クラスです。
2091 NewObjectsFunctions ページまたは要素により、新しいオブジェクトを作成するためのメソッドです。
2100 NewLine HTML NewLine のラップ
2103 Input HTML Input のラップ
2104 TextArea HTML TextArea のラップ
2105 Select HTML Select のラップ
2106 Option HTML Option のラップ
2107 Image HTML Image のラップ
2110 Table HTML Table のラップ
2114 Audio HTML Audio のラップ
2115 Video HTML Video のラップ
2118 Button HTML Button のラップ
2119 ===================== ================================================================================
2122 pair: ウェブ開発 (CGI ライブラリ); Application クラス
2127 ============ ===================================== ========================================================
2129 ============ ===================================== ========================================================
2130 DecodeString cString リクエストの仮引数をデコードします。
2131 Decode cString マルチパートまたはフォームデータのデコードをします。
2132 GetFileName aArray,cVar cVarで aArray にあるファイル名を取得します。
2133 SetCookie name,value,expires,path,domain,secure クッキーの設定
2134 Cookie name,value name および value のみでクッキーを設定します。
2135 GetCookies なし クッキーの取得
2136 URLEncode cString URL エンコード
2137 ScriptLibs なし BootStrap などを JavaScript ライブラリへ追加します。
2138 Print なし ページの内容を出力します。
2139 Style cStyle ページの CSS の内容を cStyle へ追加します。
2140 StartHTML なし ページの内容に HTTP ヘッダを追加します。
2141 ============ ===================================== ========================================================
2143 DecodeString メソッドは HTTP リクエストの仮引数を取得します。
2145 Decode および GetFileName メソッドはファイルのアップロードで使用します。
2147 SetCookie, Cookie および GetCookies メソッドはクッキーの追加と読み取りで使用します。
2149 StartHTML, ScriptsLibs, Style と Print メソッドはページの構造、および JavaScript/CSS の対応で使用します。
2151 URLEncode メソッドは HTML ページで使用される URL をエンコードするために使用します。
2154 pair: ウェブ開発 (CGI ライブラリ); Page クラス
2159 ===================== ======================================= ============================================================================================
2161 ===================== ======================================= ============================================================================================
2162 text x ページの内容へ HTMLSpecialChars(x) を追加します (文字列と数値を受け入れます)。
2163 html cString ページの内容に HTML コードを追加します。
2164 h1 x <h1> ~ </h1> の間にページの内容 x を追加します。
2165 h2 x <h2> ~ </h2> の間にページの内容 x を追加します。
2166 h3 x <h3> ~ </h3> の間にページの内容 x を追加します。
2167 h4 x <h4> ~ </h4> の間にページの内容 x を追加します。
2168 h5 x <h5> ~ </h5> の間にページの内容 x を追加します。
2169 h6 x <h6> ~ </h6> の間にページの内容 x を追加します。
2170 p aPara HTML <p> </p> の属性を取得するために aPara リストをハッシュとして使用します。
2171 NewLine なし ページの内容に <br /> を追加します。
2172 AddAttributes aPara HTML の要素属性を aPara リストのハッシュとして変換します。
2173 Link aPara HTML <a href> および </a> の属性を取得するために aPara リストをハッシュとして使用します。
2174 Image aPara HTML <img> の属性を取得するために aPara リストをハッシュとして使用します。
2175 Button aPara HTML <input type=”button”> の属性を取得するために aPara リストをハッシュとして使用します。
2176 ButtonLink aPara HTML <input type=”button”> は、リンク属性によりリンクをナビゲートするために使用します。
2177 Textbox aPara HTML <input type=”text”> の属性を取得するために aPara リストをハッシュとして使用します。
2178 Editbox aPara HTML <textarea> および </textarea> の属性を取得するために aPara を使用します。
2179 Combobox aPara HTML <select> は <option> でリスト項目の属性として使用します。
2180 Listbox aPara HTML <select multiple=’multiple’> は <option> で項目の属性として使用します。
2181 ulstart aPara HTML <ul>
2182 ulend aPara HTML </ul>
2183 listart aPara HTML <li>
2184 liend aPara HTML </li>
2185 List2UL aList Ring のリスト項目から項目をインクルードして HTML <ul> を生成します。
2186 DivStart aPara HTML <div> の属性を取得するために aPara リストをハッシュとして使用します。
2187 NavStart aPara HTML <nav> の属性を取得するために aPara リストをハッシュとして使用します。
2188 SpanStart aPara HTML <span> の属性を取得するために aPara リストをハッシュとして使用します。
2189 BoxStart なし ページのヘッダとして使用するために黒色の背景の Div を生成します。
2190 DivEnd なし HTML </div>
2191 NavEnd なし HTML </nav>
2192 SpanEnd なし HTML </span>
2193 BoxEnd なし HTML </div> であり divend() と同じです。
2194 FormStart cAction HTML <form> は cAction の action 属性または空値です。
2195 FormPost cAction HTML <form method=”post”> は cAction の action 属性です。
2196 FormEnd なし HTML </form>
2197 Submit aPara HTML <input type=”submit”>
2198 Hidden cName,cValue HTML <input type=”hidden”>
2199 FormUpload x HTML のフォームであり、 method=”post” enctype=”multipart/form-data” および x = action
2200 UploadFile x HTML <input type=”file”> および name = x
2201 Video aPara HTML <video>
2202 Audio aPara HTML <audio>
2203 GetColor aPara 配色の選択
2204 Radio aPara HTML <input type=”radio”>
2205 Checkbox aPara HTML <input type=”checkbox”>
2206 Spinner aPara HTML <input type=”number”>
2207 Slider aPara HTML <input type=”range”>
2208 TableStart aPara HTML <table>
2209 TableEnd なし HTML </table>
2210 RowStart aPara HTML <tr>
2211 RowEnd なし HTML </tr>
2212 CellStart aPara HTML <td>
2213 CellEnd なし HTML </td>
2214 HeaderStart aPara HTML <th>
2215 HeaderEnd なし HTML </th>
2216 ===================== ======================================= ============================================================================================
2218 aPara にある page メソッドは属性と値を有するリストです。
2219 aPara で下記の属性値を設定できます。
2221 .. code-block:: ring
2223 classname id name align style dir value onclick oncontextmenu ondblclick
2224 onmousedown onmouseenter onmouseleave onmousemove onmouseover onmouseout
2225 onmouseup onkeydown onkeypress onkeyup onabort onbeforeunload onerror
2226 onhashchange onload onpageshow onpagehide onresize onscroll onunload
2227 onblur onchange onfocus onfocusin onfocusout oninput oninvalid onreset
2228 onsearch onselect onsubmit ondrag ondragend ondragenter ondragleave
2229 ondragover ondragstart ondrop oncopy oncut onpaste onafterprint
2230 onbeforeprint oncanplay oncanplaythrough ondurationchange onemptied
2231 onended onloadeddata onloadedmetadata onloadstart onpause onplay
2232 onplaying onprogress onratechange onseeked onseeking onstalled onsuspend
2233 ontimeupdate onvolumechange onwaiting animationend animationiteration
2234 animationstart transitionend onmessage onopen onmousewheel ononline
2235 onoffline onpostate onshow onstorage ontoggle onwheel ontouchcancel
2236 ontouchend ontouchmove ontouchstart color opacity background backgroundattachment
2237 backgroundcolor backgroundimage backgroundposition backgroundrepeat backgroundclip
2238 backgroundorigin backgroundsize border borderbottom borderbottomcolor
2239 borderbottomleftradius borderbottomrightradius borderbottomstyle borderbottomwidth
2240 bordercolor borderimage borderimageoutset borderimagerepeat borderimageslice
2241 borderimagesource borderimagewidth borderleft borderleftcolor borderleftstyle
2242 borderleftwidth borderradius borderright borderrightcolor borderrightstyle
2243 borderrightwidth borderstyle bordertop bordertopcolor bordertopleftradius
2244 bordertoprightradius bordertopstyle bordertopwidth borderwidth boxdecorationbreak
2245 boxshadow bottom clear clip display float height left margin marginbottom marginleft
2246 marginright margintop maxheight maxwidth minheight minwidth overflow overflowx
2247 overflowy padding paddingbottom paddingleft paddingright paddingtop position
2248 right top visibility width verticalalign zindex aligncontent alignitems alignself
2249 flex flexbasis flexdirection flexflow flexgrow flexshrink flexwrap justifycontent
2250 order hangingpunctuation hyphens letterspacing linebreak lineheight overflowwrap
2251 tabsize textalign textalignlast textcombineupright textindent textjustify
2252 texttransform whitespace wordbreak wordspacing wordwrap textdecoration
2253 textdecorationcolor textdecorationline textdecorationstyle textshadow
2254 textunderlineposition @fontface @fontfeaturevalues font fontfamily fontfeaturesettings
2255 fontkerning fontlanguageoverride fontsize fontsizeadjust fontstretch fontstyle
2256 fontsynthesis fontvariant fontvariantalternates fontvariantcaps fontvarianteastasian
2257 fontvariantligatures fontvariantnumeric fontvariantposition fontweight direction
2258 textorientation unicodebidi writingmode bordercollapse borderspacing captionside
2259 emptycells tablelayout counterincrement counterreset liststyle liststyleimage
2260 liststyleposition liststyletype @keyframes animation animationdelay animationdirection
2261 animationduration animationfillmode animationiterationcount animationname
2262 animationplaystate animationtimingfunction backfacevisibility perspective
2263 perspectiveorigin transform transformorigin transformstyle transition
2264 transitionproperty transitionduration transitiontimingfunction transitiondelay
2265 boxsizing content cursor imemode navdown navindex navleft navright navup
2266 outline outlinecolor outlineoffset outlinestyle outlinewidth resize textoverflow
2267 breakafter breakbefore breakinside columncount columnfill columngap columnrule
2268 columnrulecolor columnrulestyle columnrulewidth columnspan columnwidth columns
2269 widows orphans pagebreakafter pagebreakbefore pagebreakinside marks quotes
2270 filter imageorientation imagerendering imageresolution objectfit objectposition
2271 mask masktype mark markafter markbefore phonemes rest restafter restbefore
2272 voicebalance voiceduration voicepitch voicepitchrange voicerate voicestress
2273 voicevolume marqueedirection marqueeplaycount marqueespeed marqueestyle datatoggle
2274 dataride datatarget dataslideto dataslide datadismiss dataplacement datacontent
2275 datatrigger dataspy dataoffset dataoffsettop
2278 pair: ウェブ開発 (CGI ライブラリ); ScriptFunctions クラス
2281 ======================
2283 このクラスには生成されたウェブページへ JavaScript コードを追加するためのメソッドがあります。
2285 このクラスは Page クラスへ統合されており、
2286 このメソッドから page オブジェクトを直接使えます。
2288 ================== ============================================== ===================================================================
2290 ================== ============================================== ===================================================================
2291 Script cCode <script> ~ </script> の間に文字列として cCode を追加します。
2292 ScriptRedirection cURL cURL へ window.location を設定します。
2293 ScriptFunc cFuncName,cCode cCode を有する cFuncName 関数を定義します。
2294 ScriptFuncAlert cFuncName,cMsg alert() 関数で cMsg を出力する cFuncName 関数を定義します。
2295 ScriptFuncAjax cFuncName,cLink,cDiv cDiv へ cLink を読み込みために cFuncName 関数を定義します。
2296 ScriptFuncClean cFuncName,cDiv cDiv を消去するために cFuncName 関数を定義します。
2297 ScriptFuncSelect cF,aL,cD,cR,cGR,cFC,nTO,cL1,cL2 グリッドレコードの編集・削除で使用されます。
2298 ScriptScrollFixed cDiv,nSize Size = nSize で Div を固定するために cDiv を設定します。
2299 ================== ============================================== ===================================================================
2302 pair: ウェブ開発 (CGI ライブラリ); StyleFunctions クラス
2305 =====================
2307 このクラスには生成されたウェブページへ CSS を追加するためのメソッドがあります。
2309 ScriptFunctions など StyleFunctions クラスのメソッドは Page クラスへ統合されており、
2310 このメソッドから page オブジェクトを直接使えます。
2312 ===================== ==================== ==============================================================
2314 ===================== ==================== ==============================================================
2315 StyleFloatLeft なし float: left ; を返します。
2316 StyleFloatRight なし float: right ; を返します。
2317 StyleSizeFull なし width: 100% ; height: 100% ; を返します。
2318 Stylecolor x “ color: ” + x + ” ; “ を返します。
2319 Stylebackcolor x “ background-color: ” + x + ” ;” を返します。
2320 StyleTextCenter なし “ text-align: center ;” を返します。
2321 StyleTextRight なし “text-align: right ;” を返します。
2322 StyleTextLeft なし “text-align: left ;” を返します。
2323 StyleSize x,y “ width: ” + x + ” ; height: ” + y + ” ;” を返します。
2324 StyleWidth x “ width: ” + x + ” ;” を返します。
2325 StyleHeight x “ height: ” + x + ” ;” を返します。
2326 StyleTop x “ top: ” + x + ” ;” を返します。
2327 StyleLeft x “ Left: ” + x + ” ;” を返します。
2328 StylePos x,y “ top: ” + x + ” ;” + ” Left: ” + y + ” ;” を返します。
2329 StyleHorizontalCenter なし “ margin-right:auto ; margin-left:auto; “ を返します。
2330 StyleMarginTop x “ margin-top: ” + x + ” ;” を返します。
2331 StyleMarginRight x “ margin-right: ” + x + ” ;” を返します。
2332 StyleMarginLeft x “ margin-left: ” + x + ” ;” を返します。
2333 StyleDivCenter nWidth,nHeight ページの中央に Div を作成します。
2334 StyleAbsolute なし “ position:absolute ;” を返します。
2335 StyleFixed なし “ position:fixed ;” を返します。
2336 StyleZIndex x “ z-index: ” + x + ” ;” を返します。
2337 StyleFontSize x “ font-size: ” + x + ” ;” を返します。
2338 StyleGradient x グラデーションの生成 (x の値は 1 から 60 まで)
2339 StyleTable なし テーブルの属性を設定します。
2340 StyleTableRows id テーブルの偶数、および奇数の横列へ交互に異なる色を設定します。
2341 StyleTableNoBorder なし “ border-style: none;” を返します。
2342 ===================== ==================== ==============================================================
2346 pair: ウェブ開発 (CGI ライブラリ); WebPage クラス
2351 有効な WebPage オブジェクトの属性へアクセスするために括弧を使用します。
2353 これらの属性のうち一つを括弧により使用することで再度新しい属性を返します。
2355 ===================== ========================================================
2357 ===================== ========================================================
2366 NewLine HTML NewLine のラップ
2369 Input HTML Input のラップ
2370 TextArea HTML TextArea のラップ
2371 Select HTML Select のラップ
2372 Option HTML Option のラップ
2373 Image HTML Image のラップ
2376 Table HTML Table のラップ
2380 Audio HTML Audio のラップ
2381 Video HTML Video のラップ
2384 Button HTML Button のラップ
2385 ===================== ========================================================
2388 pair: ウェブ開発 (CGI ライブラリ); HtmlPage クラス
2393 WebPage クラスと同じですが、このような変更を行っています。
2396 (2) 出力の取得用に Output メソッドがあります。
2400 .. code-block:: ring
2402 output() ---> 文字列を出力