【问题标题】:How to put a new line between buttons? PHP如何在按钮之间换行? PHP
【发布时间】:2015-08-05 05:45:06
【问题描述】:
$form->addElement( new Element\Button (" Edit " , "button " ));

$form->addElement(new Element\Button);

$form->addElement(new Element\Button ( "Cancel " , "button"));

我使用了\n 和PHP_EOL,但没有任何效果。新行应位于 EDIT 按钮和新元素之间。 我应该使用 HTML 吗?

【问题讨论】:

  • 是的,使用 HTML <br />?
  • \n 和 php_eol 将在源代码中生成返回,而不是 html 返回。使用

标签: php newline


【解决方案1】:

在 php 风格的按钮之间使用

$form->addElement( new Element\Button (" Edit " , "button " ));
echo "<br>";
$form->addElement(new Element\Button);
echo "<br>";    
$form->addElement(new Element\Button ( "Cancel " , "button"));

【讨论】:

    【解决方案2】:

    将此语句用于换行:

     echo '<br/>';
    

    【讨论】:

      猜你喜欢
      • 2018-09-09
      • 2017-09-12
      • 2017-01-02
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-11
      • 2019-02-27
      相关资源
      最近更新 更多