In Part One, we built a basic "Hello Watson" web app using Composer and Silex. In this installment, we're going to add an upload form and a way to view the uploaded images.
In Part One, we built a basic "Hello Watson" web app using Composer and Silex. In this installment, we're going to add an upload form and a way to view the uploaded images.
Composer is a dependency management utility for PHP projects. What that means is: you can save time on your projects by importing libraries that other developers have written.
For this series of examples, I plan to build a basic image uploading script using the Silex PHP microframework. I want to try uploading images from my iPhone using Mobile Safari, because I have heard of some real-world limitations in that situation that I want to explore. Part One will deal with the basic setup and a slightly different approach to the standard "Hello World".
Today I wanted to try out the StackPHP project to see how it could benefit me at work or in my side projects. However, I faced a roadblock: I only had access to PHP 5.3.8, and several of the StackPHP examples require PHP 5.4! What was I to do?
As it turns out, I already knew the answer, but I'd never tried it. A fellow developer, Juan Treminio, recently launched a project that can assist in this sort of scenario: PuPHPet, the online tool for generating vagrant+puppet virtual machine configurations.
So, while preparing a BBQ dinner, I decided to give it a go.
One feature that bloggers like is the ability to add an "excerpt" or automatically cut off text after a certain number of words. This is often used in RSS feeds as a sneaky way to increase hits, or more legitimately as a consistent way to place a "Read More »" link in listings of posts.
I'm going to demonstrate three methods for doing this, because each of the three methods reveals something useful about Sculpin and its templating system, Twig.