Dynamic date creation depending on the current fixture with nelmio/alice
Published on 2021-10-24 • Modified on 2021-10-24
This snippet shows how to create a dynamic date depending on the current fixture with nelmio/alice. The trick is to use the $current
variable within the argument of the date_create
function. In this case, we create a hundred events every day from tomorrow.
App\Entity\Event:
event_{1..100}:
start_time: <(date_create('+'. $current. 'day'))>
More on Stackoverflow Read the doc Random snippet
Call to action
Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )
- Report any error/typo.
- Report something that could be improved.
- Like and repost!
- Follow me on Bluesky 🦋
- Subscribe to the RSS feed.
- Click on the More on Stackoverflow buttons to make me win "Announcer" badges 🏅.
Thank you for reading! And see you soon on Strangebuzz! 😉
