In this blog post we'll create a simple PHP MVC Framework from scratch. This simple framework can be used as a tool for learning the basic plot behing MVC or you can modify it and make it grow into something bigger and much more useful.
MVC stands for "Model View Controller". MVC is a concept that enables us to separate our business logic from the presentation. One of the biggest advantages is the code reusability. There are other benefits, such as: We can let the designers edit the Views, without worrying that they will screw up database access logic.
In this blog post we'll talk about URL Rewriting and how it can be done using Microsoft's IIS. Why IIS? Because there are not that many tutorials that cover that stuff. Also, some very experienced PHP developers don't know how to rewrite URLs if their page is hosted on IIS.
URL Rewriting basically means: altering the URL's apperance without affecting behaviour of your site. But why would someone alter the apperance of an URL?
Well, there are couple of great reasons. First, of course is Search Engine Optimization (SEO). For example, compare the following URL:
With this one:
What are the advantages of URL number two? It's friendlier to both users and search engines. Users can immediately tell what the blog post is about and it also helps your site to get better search engine rankings.
Responsive Web Design is basically a design done with CSS3 Media Queries that changes according to the environment a visitor uses. In other words, the design "responds" to changes.
It may sound science-fictiony, but that's what happens. And it's not complicated like it sounds. It's actually easy to create a basic Responsive design. All you need to do is play a little with CSS3 Media Queries and setting different widths for container elements.
We'll make a simple "City guide to Zagreb", meaning we'll select interesting locations from the database, display them on a map, show some info about them and show directions from user's current position to a location of his/her choice.
What you'll need
- PHP/MySQL Development Environment
- Some free time
As you can see it's really easy to get started. So, let's do it!
In this blog post we'll create a simple registration using Facebook registration plugin. We'll also create a simple login system that enables registered users to login to our site.
About Facebook Registration plugin
Facebook registration plugin enables users to register for a website regardless if they have Facebook account or not. However, if they have a Facebook account the registration form will be automatically filled with the user information from their Facebook account.