Im trying to create a custom HTML 5 date field for using in a laravel 4 framework view.
{{
Form::macro('datetime', function($field_name)
{
return '';
});
}}
{{ Form::label('event_start', 'Event Date', array('class' => 'control-label')) }}
{{ Form::datetime('event_start') }}
The only problem is the value is not being populated, and i do not know how to do this.
Im using this form to create and edit a model called Event.
how can i populate the value of this field?
Here's what I did:
in my view I added the following macro
<?php
Form::macro('datetime', function($value) {
return '<input type="datetime" name="my_custom_datetime_field" value="'.$value.'"/>';
});
...
...
// here's how I use the macro and pass a value to it
{{ Form::datetime($datetime) }}