當前位置: 首頁>>代碼示例>>PHP>>正文


PHP YDForm::tohtml方法代碼示例

本文整理匯總了PHP中YDForm::tohtml方法的典型用法代碼示例。如果您正苦於以下問題:PHP YDForm::tohtml方法的具體用法?PHP YDForm::tohtml怎麽用?PHP YDForm::tohtml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在YDForm的用法示例。


在下文中一共展示了YDForm::tohtml方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionDefault

 function actionDefault()
 {
     // create a form with a span and a button
     $form = new YDForm('myform');
     $form->addElement('span', 'myspanresult', ' ', array('style' => 'BACKGROUND-COLOR:#ccccff'));
     $form->addElement('button', 'mybutton', 'Get version');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // create custom effects for waiting message
     $onStart = new YDAjaxEffect('', 'opacity', 'hide()', 0);
     $onShow = new YDAjaxEffect('', 'opacity', 'custom(0,1)', 0);
     $onHide = new YDAjaxEffect('', 'opacity', "toggle()");
     // use waiting message with custom effects
     $this->ajax->useWaitingMessage("<h2>&nbsp; Please wait ... &nbsp;<\\/h2>", array(), $onStart, $onShow, $onHide);
     // to use default waiting message just try:
     // $this->ajax->useWaitingMessage();
     // register element mybutton (mybutton will be assigned with 'getversion' call in the client side)
     $this->ajax->addEvent('mybutton', array(&$this, 'getversion'));
     // process ajax events
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This example demonstrates the waiting message with custom parameters');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:25,代碼來源:waiting.php

示例2: actionDefault

 function actionDefault()
 {
     // create a form with a 2 autocompleters and a simple text element
     $form = new YDForm('myform');
     $form->addElement('autocompleter', 'arg1', 'Country with standard style:', '', array(&$this, 'getCountry'));
     $form->addElement('text', 'arg2', 'Just a simple text box without autocompleter');
     $form->addElement('autocompleter', 'arg3', 'Country with custom style:', array('style' => 'width:300px; background-color:#CCFFFF;'), array(&$this, 'getCountry'));
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // process events added
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'Just start typing a coutry name in the box to see the effect');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display();
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:16,代碼來源:autocompleter.php

示例3: actionDefault

 function actionDefault()
 {
     // create a form with a span and a button
     $form = new YDForm('myform');
     $form->addElement('span', 'myspanresult', '&nbsp;', array('style' => 'BACKGROUND-COLOR:#ccccff'));
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // register custom function
     $this->ajax->addEvent('customFunction()', array(&$this, 'getversion'));
     // process ajax events
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This is a simple ajax example');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display();
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:16,代碼來源:functions.php

示例4: actionDefault

 function actionDefault()
 {
     // create a form with a span and a button
     $form = new YDForm('myform');
     $form->addElement('span', 'myspanresult', '&nbsp;', array('style' => 'BACKGROUND-COLOR:#ccccff'));
     $form->addElement('button', 'mybutton', 'Get YDFramework version');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // register element mybutton (mybutton will be assigned with 'getversion' call in the client side)
     $this->ajax->addEvent('mybutton', array(&$this, 'getversion'));
     // process ajax events
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This is a simple ajax example');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:17,代碼來源:version.php

示例5: actionDefault

 function actionDefault()
 {
     // create a form with a span and two buttons
     $form = new YDForm('myform');
     $form->addElement('span', 'myspanresult', '&nbsp;', array('style' => 'WIDTH:350px;BACKGROUND-COLOR:#ccccff'));
     $form->addElement('button', 'mybutton', 'Get YDFramework version');
     $form->addElement('button', 'mybutton2', 'Get time');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // register element mybutton with event result and fixed argument '1' and mybutton2 with event 'result' with argument 2
     $this->ajax->addEvent('mybutton', array(&$this, 'result'), 1);
     $this->ajax->addEvent('mybutton2', array(&$this, 'result'), 2);
     // process events added
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This is a two buttons example with a different event assigned for each one');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:19,代碼來源:two_buttons.php

示例6: actionDefault

 function actionDefault()
 {
     // create a form with a 2 texts, a button and a span for result
     $form = new YDForm('myform');
     $form->addElement('text', 'arg1', 'X:');
     $form->addElement('text', 'arg2', 'Y:');
     $form->addElement('button', 'mybutton', 'Sum');
     $form->addElement('span', 'myspanresult', '&nbsp;');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // assign 'mybutton' with 'compute' call with dynamic values from form elements 'arg1' and 'arg2'
     $this->ajax->addEvent('mybutton', array(&$this, 'compute'), array('arg1', 'arg2'));
     // process events added
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This a calculator example. Fill X and Y');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:19,代碼來源:calculator.php

示例7: actionDefault

 function actionDefault()
 {
     // create a form with a 2 texts, a select to choose operation, a button and a span for result
     $form = new YDForm('myform');
     $form->addElement('text', 'arg1', 'X:');
     $form->addElement('select', 'operation', 'Operation', array(), array(0 => '+', '-', 'x', '/'));
     $form->addElement('text', 'arg2', 'Y:');
     $form->addElement('span', 'myspanresult', '&nbsp;');
     $form->addElement('button', 'mybutton', 'Calc');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // assign 'mybutton' with 'compute' call with dynamic values from form elements 'arg1', 'arg2' and 'operation'
     $this->ajax->addEvent('mybutton', array(&$this, 'compute'), array('arg1', 'arg2', 'operation'));
     // process events added
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This a dynamic calculator example (you can choose operation)');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:20,代碼來源:calculator_dynamic.php

示例8: actionDefault

 function actionDefault()
 {
     // create a form with a span and a button
     $form = new YDForm('myform');
     $form->addElement('span', 'myspanresult', '&nbsp;', array('style' => 'WIDTH:350px;BACKGROUND-COLOR:#ccccff'));
     $form->addElement('button', 'mybutton', 'Get YDFramework version');
     // create ajax object
     $this->ajax = new YDAjax($this->tpl, $form);
     // register element mybutton (mybutton will be assigned with 'getversion' call in the client side)
     $this->ajax->addEvent('mybutton', array(&$this, 'getversion'));
     // add confirmation to mybutton call
     $this->ajax->addConfirmation('mybutton', 'Are you shure you want to get ydf version?');
     // create an alias (submitCall). you can see a new function submitCall() is js client code
     // note that, addAlias is defined AFTER addConfirmation, then submitCall() will have confirmation too
     // alias BEFORE addConfirmation will assign submitCall() with a clean event
     $this->ajax->addAlias('mybutton', 'submitCall()');
     // process ajax events
     $this->ajax->processEvents();
     // assign form and display template
     $this->tpl->assign('title', 'This demonstrates how to add confirmations and aliases');
     $this->tpl->assign('form', $form->tohtml());
     $this->tpl->display('general');
 }
開發者ID:BackupTheBerlios,項目名稱:ydframework-svn,代碼行數:23,代碼來源:confirmation.php


注:本文中的YDForm::tohtml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。