dissappearing slash("/") when create an form dynammically

62 Views Asked by At

I'm trying to create some input forms in PHP dynamically. It's a function which returns the html into the view. (ZF2)

In php I've got this: <input name="bla" type="text" value="bla" />

Its becoming this: <input name="bla" type="text" value="bla" >

So the slash at the end is missing. can someone tell me why?

Thanks in advance.

1

There are 1 best solutions below

0
On

The input element is a void element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input There are two ways to write a void element:

<element> or <element /> (but never <element></element>) I don't really know the zend framework, but I guess it defaults to the first, which is the more standard way or writing things. See also question Are (non-void) self-closing tags valid in HTML5?