Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

HOW TO CREATE A FIELD DATE, you have the current date as the value ?. IF POSSIBLE IN VOLT AND PHTML

HOW TO CREATE A FIELD DATE, you have the current date as the value ?. IF POSSIBLE IN VOLT AND PHTML



3.3k
Accepted
answer

You can use helper https://docs.phalconphp.com/en/latest/api/Phalcon_Forms_Element_Date.html More about tag helper read -> https://docs.phalconphp.com/en/latest/reference/tags.html#helpers-to-generate-form-elements

Or if you create form in form class as described in https://docs.phalconphp.com/en/latest/reference/forms.html use https://docs.phalconphp.com/en/latest/api/Phalcon_Forms_Element_Date.html

Is it what you need?

P.S. don't forget input with type date support only Blink and Webkit based browser (Google Chrome, Safari, Opera) for another browser you need override class for detect browser and automatically switch to using some js plugin



36.4k
edited Oct '15

Also I had read the documentation but exactly what I need is having a field

{{Date_field ("date", "size": 32}}

assign the default of the current date. Previously he had done with JavaScript but giving me that I can get the current date with:

{{Date ('d-m-y', time ())}}

How to join the two? How do I assign a value to datefield?