timestamp値をtwigファイルの日付形式に変換しようとしていますが、次のエラーが発生します。タイムスタンプto日付形式がtwigファイルで動作しません
{{ form_row(form.startDate)|date("m/d/Y") }}
エラー:
An exception has been thrown during the rendering of a template ("DateTime::__construct(): Failed to parse time string (<div><label for="event_setup_startDate" class="required">Start date</label><input type="text" id="event_setup_startDate" name="event_setup[startDate]" required="required" class="datetimepicker" value="1478257800" /></div>) at position 0 (<): Unexpected character")
form_row関数で生成されたHTMLコードを日付コンストラクタに渡します。フレームワークを使用していますか? – Matteo
@マテオ。私はsymfonyフレームワークを使用しています。データ型が設定されているのはstringで、datetime形式に変換しようとしています。 – user1965773