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


PHP Button::render方法代碼示例

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


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

示例1: testRender

 /**
  * @covers Xoops\Form\Button::render
  */
 public function testRender()
 {
     $value = $this->object->render();
     $this->assertTrue(false !== strpos($value, '<input'));
     $this->assertTrue(false !== strpos($value, 'type="button"'));
     $this->assertTrue(false !== strpos($value, 'name="button_name"'));
     $this->assertTrue(false !== strpos($value, 'id="button_name"'));
     $this->assertTrue(false !== strpos($value, 'title="button_caption"'));
     $this->assertTrue(false !== strpos($value, 'value="button_value"'));
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:13,代碼來源:ButtonTest.php

示例2: render

 /**
  * Render button
  *
  * @return void
  */
 function render()
 {
     if (!isset($this->options['icons']['secondary'])) {
         $this->options['icons']['secondary'] = $this->js_triangle_class;
     }
     parent::render();
 }
開發者ID:easyconn,項目名稱:atk4,代碼行數:12,代碼來源:DropButton.php

示例3: test__construct

 /**
  * @covers Xoops\Form\Button::__construct
  * @covers Xoops\Form\Button::render
  * @covers Xoops\Form\Element::themeDecorateElement
  */
 public function test__construct()
 {
     $oldWay = new Button('mycaption', 'myname', 'myvalue', 'button');
     $newWay = new Button(['caption' => 'mycaption', 'type' => 'button', 'name' => 'myname', 'value' => 'myvalue']);
     $this->assertEquals($oldWay->render(), $newWay->render());
     $this->assertNotFalse($oldWay->hasClassLike('btn'));
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:12,代碼來源:ButtonTest.php

示例4: testMultiplos

 public function testMultiplos($value = '')
 {
     $button = new Button(['value' => "Valor"]);
     $button->addBtn(new Button(['value' => "Novo"]));
     $this->assertEquals($button->renderButton(), '<input value="Valor" type="button" />');
     $this->assertEquals($button->render(), '<div class=\'form-group\'><input value="Valor" type="button" /><input value="Novo" type="button" /></div>');
 }
開發者ID:LeandroSenni,項目名稱:Code.Education.DesignPatterns,代碼行數:7,代碼來源:ButtonTest.php

示例5: render

 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'\\&\\#x0300\\;','')");
     } else {
         $this->addClass('wrap_selection');
         $this->setOpenTag('&#x0300;');
     }
     return parent::render();
 }
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:15,代碼來源:GaccentButton.php

示例6: render

 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isXhtml11()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<del>','</del>')");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<s>','</s>')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->addClass('lang-html');
         $this->setOpenTag('p style=\'text-decoration: line-through;\'');
         $this->setCloseTag('p');
     }
     return parent::render();
 }
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:21,代碼來源:StrikeButton.php

示例7: render

 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isXhtml11()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<div class=\\'s9y_typeset s9y_typeset_center\\' style=\\'text-align: center; margin: 0px auto 0px auto\\'>','</div>')");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<center>','</center>')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->addClass('lang-html');
         $this->setOpenTag('p style=\'text-align: center;\'');
         $this->setCloseTag('p');
     }
     return parent::render();
 }
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:21,代碼來源:CenterButton.php

示例8: render

 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isUseRealApos() === false) {
             if ($this->isUseNamedEnts()) {
                 $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'&rsquo;','')");
             } else {
                 $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'&#8217;','')");
             }
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'\\&\\#39\\;','')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->setOpenTag('&apos;');
     }
     return parent::render();
 }
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:23,代碼來源:AposButton.php

示例9: render

 /**
  * @return string
  */
 public function render()
 {
     $this->overwriteValue();
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isUseNamedEnts()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "']," . $this->getSurroundingNamedEntitiesStringByType() . ")");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "']," . $this->getSurroundingStringByType() . ")");
         }
     } else {
         $this->addClass('wrap_selection');
         $namedEntities = $this->getCleanSurroundingStringByType();
         $tags = explode(',', $namedEntities);
         $this->setOpenTag(trim($tags[0], '\''));
         $this->setCloseTag(trim($tags[1], '\''));
     }
     return parent::render();
 }
開發者ID:sqall01,項目名稱:additional_plugins,代碼行數:23,代碼來源:SquotesButton.php

示例10: render

 public function render()
 {
     $this->setAttribute("type", "submit");
     return parent::render();
 }
開發者ID:ekowabaka,項目名稱:cfx,代碼行數:5,代碼來源:SubmitButton.php

示例11: render

 public function render()
 {
     $this->set('type', 'submit');
     return parent::render();
 }
開發者ID:siriusphp,項目名稱:form-renderer,代碼行數:5,代碼來源:Submit.php


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