Right now I have a view like this that works.
#{form @UserCreate.create()}
#{field 'user.email'}
#{text field /}
#{/field}
#{/form}
With a corresponding text tag defined which then uses the field (it is more complicated than this, just boiling down to essentials)
<input type="text" id="${_arg.id}" name="${_arg.name}" value="${_arg.value}">
Ideally I would rather have it so I did not have to declare the field in the view so it would look like this.
#{form @UserCreate.create()}
#{text 'user.email' /}
#{/form}
With a tag that looks like this.
#{field 'user.email'}
<input type="text" id="${field.id}" name="${field.name}" value="${field.value}">
#{/field}
But the field.value always returns null because user is not in the tags' template binding. I am not really sure how to approach things at this point. Suggestions?
Hey I have an interesting workaround: Just write the first line of the custom tag
%{user = _user}%
#{field 'user.email'}
<input type="text" id="${field.id}" name="${field.name}" value="${field.value}">
#{/field}
This works for me :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With