When you have many inputs (select/textarea/input), it will look real messy when you include isset()
For example:
<input id="firstname" type="text" name="firstname"
value="<?php echo (isset($_POST['firstname']) ? $_POST['firstname'] : "";?>">
In there alternative way so it will look tidy and maintainable?
I am using MVC Framework if that help.
You could build your own function that would fill values:
And use it as:
Or anyway that it’d be incorporated into your framework.
If you need more complete keys you could do it like this:
Preparing variables
You may also take advantage of php
array operator+and set all variables:And than just: