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


PHP Text::render方法代碼示例

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


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

示例1: testCreatingTextElementWithNameSimilarToTheFormMethods

 /**
  * Tests Text::render
  *
  * @issue  10398
  * @author Serghei Iakovlev <serghei@phalconphp.com>
  * @since  2016-07-17
  */
 public function testCreatingTextElementWithNameSimilarToTheFormMethods()
 {
     $this->specify('Text::render does not return expected result', function ($name) {
         $element = new Text($name);
         expect($element->getName())->equals($name);
         expect($element->render())->equals(sprintf('<input type="text" id="%s" name="%s" />', $name, $name));
         expect($element->getValue())->null();
     }, ['examples' => $this->nameLikeFormMethodsProvider()]);
 }
開發者ID:mattvb91,項目名稱:cphalcon,代碼行數:16,代碼來源:TextTest.php

示例2: testIssue2045

 public function testIssue2045()
 {
     $this->specify("Attributes are not properly rendered", function () {
         $element = new Text("name");
         $element->setAttributes(["class" => "big-input"]);
         $element->setAttribute("id", null);
         $expected = '<input type="text" name="name" class="big-input" />';
         expect($element->render())->equals($expected);
     });
 }
開發者ID:phalcon,項目名稱:cphalcon,代碼行數:10,代碼來源:TextTest.php

示例3: testFormElementRender

 public function testFormElementRender()
 {
     $element1 = new Text("name");
     $element1->setAttributes(array('class' => 'big-input'));
     $element2 = new Radio('radio');
     $element2->setAttributes(array('value' => 0));
     $this->assertEquals('<input type="text" id="name" name="name" class="big-input" />', $element1->render());
     $this->assertEquals('<input type="text" id="name" name="name" class="big-input" />', (string) $element1);
     $this->assertEquals('<input type="radio" id="radio" name="radio" value="0" />', (string) $element2);
 }
開發者ID:phalcon,項目名稱:cphalcon,代碼行數:10,代碼來源:FormsTest.php

示例4: testIssue2045

 public function testIssue2045()
 {
     $element = new \Phalcon\Forms\Element\Text("name");
     $element->setAttributes(array('class' => 'big-input'));
     $element->setAttribute("id", NULL);
     $this->assertEquals('<input type="text" name="name" class="big-input" />', $element->render());
 }
開發者ID:lisong,項目名稱:cphalcon,代碼行數:7,代碼來源:FormsTest.php

示例5: testRenderCompare

 public function testRenderCompare()
 {
     $phalconText = new Text('test');
     $vegasText = new \Vegas\Forms\Element\Text('test');
     $this->assertEquals($phalconText->render(), $vegasText->renderDecorated());
 }
開發者ID:vegas-cmf,項目名稱:forms,代碼行數:6,代碼來源:UnDecoratedTraitTest.php

示例6: testFormElementRender

 public function testFormElementRender()
 {
     $element1 = new Text("name");
     $element1->setAttributes(array('class' => 'big-input'));
     $this->assertEquals($element1->render(), '<input class="big-input" name="name" id="name" value="" type="text" />');
     $this->assertEquals((string) $element1, '<input class="big-input" name="name" id="name" value="" type="text" />');
 }
開發者ID:aisuhua,項目名稱:phalcon-php,代碼行數:7,代碼來源:FormsTest.php


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