This is a simple Silex app. We would like you to extend and fix it.
You can optionally use Vagrant or your own PHP environment to set up this project.
This project is setup with Vagrant. See the instructions on how to install vagrant to get started.
Once you have it installed in the project root run "vagrant up". This will provision your box, install Composer and then install your vendors.
You need to be running PHP5.3.3>, a webserver (Apache/Nginx) and the PHP extension sqlite. You should point your webserver to the /public
directory in this project.
Composer is used to install Silex and the required vendors.
Install Composer:
curl -s http://getcomposer.org/installer | php
Install the vendors:
php composer.phar install
We have created a very hacky way of getting data into the app. In the project you will find a route called "setup". So the first thing you need to do is visit this route in your browser.
http://192.168.33.10/setup
This should respond with a "done"
You should be able to visit http://192.168.33.10/1 to view article 1.
- Create a new route matching "/", the home route.
- Load in the latest 10 articles in the database
- Display them in a list to the user displaying title and short description.
- Give the user a link to click to view the full article.
- Modify the article view route to display the article, rather than the simple test that is currently there.
- Install Twig Via Composer as per these instructions
- Rather than responding inline with some html, use Twig templates for the home and article routes.
- Use twitter bootstrap for your templates
If you'd like to go the extra mile then maybe do some of the following
- Add tests
- Come up with a better solution to the setup route for setting up.
- Add paging with Pagerfanta
- The database structure is a bit basic, add some more fields suitable for a news site
- Doctrine ORM to manage articles, installed with composer?
- Anything else you'd like to show us or fix