S
S
Sergey2015-04-04 03:29:36
Yii
Sergey, 2015-04-04 03:29:36

Why does the php template engine do such magic?

Code in the template:

echo '<div id="filetenderside">';
echo $form6->field($model6, 'file[]', ['options' => ['class' => 'onemorefile']])->fileinput()->label('File upload:');
echo '</div>';

Its output is:
<div id="filetenderside"></div>
<div class="onemorefile field-tenderproposalform-file">
<label for="tenderproposalform-file" class="control-label">File upload:</label>
<input type="hidden" value="" name="TenderproposalForm[file][]"><input type="file" name="TenderproposalForm[file][]" id="tenderproposalform-file">

<div class="help-block"></div>
</div>

<div id="filetenderside"></div>empty,
it is higher than the others, although the rest should be in it.
Why is that? How is this possible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Nikolaev, 2015-04-04
@butteff

It's most likely the extra div that was returned on line 2:
In this case, most normal browsers will write it for you.
Such errors are sometimes subtle. I would recommend outputting with echo etc. operators only data (no markup), and write html in the view.

F
FanatPHP, 2015-04-04
@FanatPHP

what kind of magic

X
xmoonlight, 2015-04-04
@xmoonlight

I don't see an error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question