Imagine that you need to display a calendar of events for one month. You have 3 different sources of data: 2 different databases and one api(see example response in the end). You should collect the data and render it via twig template(all markup and styles are ready). Order output ASC. Example output is provided(see example section). Example of a calendar event itself is provided at the bottom.
- Display inclusive days starting from 2050-12-01 till 2050-12-31
- Show empty days
- If a day has multiple events - group them by date
- Fake api request using example(see Order API response example)
- Display each event in format based on example page
- Write the fastest solution as possible (ugly code is welcome) and commit the changes (in one commit, squash if needed).
- Refactor your code to be reusable, flexible and scalable and commit the changes (in one commit, squash if needed).
composer installcomposer init-project
composer startcd docker && docker exec -it calendar_events_php bashcomposer installcomposer init-project- Add to your hosts file
127.0.0.1 calendar-events
Install symfony cli. Then run symfony serve to run your local server, and you're ready to go!
If you've just installed the app - docker containers should be already up.
If not - execute composer start to run your docker server and you're ready to go!
Site url is http://calendar-events:85/
Open the /example page.
- Controller
- Entities
- Multiple databases setup
- Twig templates
In order to fix your codestyle according to a @Symfony preset run composer fix-cs
You can set $type with the source of data like "birthday", "order", "meeting" or "order-api"
DateTimeInterface $date;
string $title;
string $description;
string $type;<?php
[
[
'id' => 15,
'name' => 'IPond mega',
'delivery_information' => 'to pond use IPond! delivery is free!',
'purchase_date' => '2050-12-01 17:59',
'price' => '667',
],
[
'id' => 17,
'name' => 'IPond mega XL',
'delivery_information' => 'Delivery is not free!',
'purchase_date' => '2050-12-31 19:30',
'price' => '668',
],
[
'id' => 19,
'name' => 'IPond M',
'delivery_information' => 'No delivery!',
'purchase_date' => '2050-12-31 17:30',
'price' => '665',
],
];