小编luk*_*ers的帖子

在Zf2中使用formRow视图助手输入前显示标签

在Zend Framework 2.1.4中,我使用标准的表单视图助手来渲染我的表单元素.

当我尝试:

<?php echo $this->formRow($form->get('Title'));?>
Run Code Online (Sandbox Code Playgroud)

标签文本和输入元素放在标签内:

<label>
<span>Title</span><input type="text" name="Title" placeholder="Inserisci titolo"
required="required" value="">
</label>
Run Code Online (Sandbox Code Playgroud)

同样的:

<?php echo $this->formCollection($form, TRUE);
Run Code Online (Sandbox Code Playgroud)

但是,如果我单独渲染标签并输入:

echo $this->formLabel($form->get('Title'));
echo $this->formInput($form->get('Title'));
Run Code Online (Sandbox Code Playgroud)

它生成我想要的html:

<label for="Title">Title</label>
<input type="text" name="Title" placeholder="Insert Title" required="required" value="">
Run Code Online (Sandbox Code Playgroud)

如何使用formRow视图助手实现相同的功能?

zend-form zend-view zend-framework2

8
推荐指数
1
解决办法
7639
查看次数

ZF2 - PaginationControl $ this-> route not working

在一个视图中我打电话:

<?php echo $this->paginationcontrol($paginator,'Jumping','pagination')?>
Run Code Online (Sandbox Code Playgroud)

它工作但在pagator.phtml里面,paginatorcontrol调用:

<a href="<?php echo $this->url($this->route, array('page' => $this->first)); ?>">
First
Run Code Online (Sandbox Code Playgroud)

$ this-> route不行,为什么空?

我应该通过paginationcontrol()?

提前致谢.

pagination zend-framework2

1
推荐指数
1
解决办法
1812
查看次数