I'm learning from Album tutorial for ZF 2.3.1.
In add.phtml
I have the following code:
$form->setAttribute('action', $this->url('album', array('action' => 'add')));
$form->prepare();
echo $this->form()->openTag($form);
echo $this->formHidden($form->get('id'));
echo $this->formRow($form->get('title'));
echo $this->formRow($form->get('artist'));
echo $this->formSubmit($form->get('submit'));
echo $this->form()->closeTag();
The HTML output for this is:
<form action="/album/add" method="POST" name="album" id="album"><input type="hidden" name="id" value=""><label><span>Title</span><input type="text" name="title" value=""></label><label><span>Artist</span><input type="text" name="artist" value=""></label><input type="submit" name="submit" id="submitbutton" value="Add"></form>
However accoring to tutorial form should look like this:
Questions:
Why ZF2 doesn't generate any new lines tags as for example
<p>
or<div>
between each line? In my browser all inputs are in the same line (maybe it's some styles issue not mentioned in tutorial) however I expected some extra tags will be generatedWhy in action
/album/add
is changed into/album/add
- are there any security reasons for that? Action for form is set$form->setAttribute('action', $this->url('album', array('action' => 'add')));
but when I use the same method to generate link url<a href="<?php echo $this->url('album', array('action' => 'add')); ?>">test</a>
it creates/album/add
url as I expect