I have like a hundred or so form elements in a multiple-page form, and I have to check if certain session variables were defined or not.
The main thing is I have sub-namespaces within my sessions by way of a CONSTANT and then a fields key.
Is there some shortcut to do it? Say,
<input value="<?php echo isset($_SESSION[CONSTANT]['fields']['first_name']) ? $_SESSION[CONSTANT]['fields']['first_name'] : ''; ?>">
I doubt I could loop this because my structure isn’t made of sibling input elements but very, very customised markup which can’t be controlled within a loop structure.
Perhaps I could use Zend Session or something similar, the last resort would be typing a variable to be replaced by my text editor, for example, $s[‘first_name’] and replace all $s instances.
Write a shortcut yourself.