Here is the description of what you'll need to implement and answer on this technical challenge.
You'll answer the 4 following challenges.
Implement a function (on the same module - request.php
) to cache requests preventing unecessary calls. You may use this Redis module as a cache service.
Note: You may use any PHP version, including PHP7+.
Implement a JavaScript code (on the same file - date-format.html
) that replaces the date value of all elements (that have js-date-format
class) with the value of the time passed from now (new Date()
). Use the following format:
- 1 second ago OR X seconds ago
- 1 minute ago OR X minutes ago
- 1 hour ago OR X hours ago
- Date in ISO format (original format)
Example:
Note: You should use ecmascript 6 features but may not use any framework or add any dependency.
Implement the CSS code to make the component on component.html
look like the desired mockup below.
Mockup:
Note #1: You should use new CSS features and add classes as you need, but try not to change the HTML structure.
Note #2: We recommend you try using BEM.
Send us your answer for the following question:
What are the main HTTP verbs used in REST applications and what are they meant for?