Articles and Posts with the tag "Apache"
Custom PHP MVC Tutorial: Part 1, introduction
If you code your web sites/apps in ASP.NET or Ruby and you're in the market for a MVC framework, you don't have to look very far - ASP.NET MVC comes with the latest Visual Studio, and Ruby's resurgence in the land of web dev can largely be attributed to the trendy Ruby on Rails MVC framework. What about good ol' PHP, though? True to its open nature, PHP has a bunch of popular MVC frameworks to choose from, each with their own assortment of positives and negatives to consider. However, before you go off on an epic Googling quest to pick one, have you considered writing your own?
Custom PHP MVC Tutorial: Part 2, URL mapping and index.php
One of the universal characteristics seen in MVC frameworks across platforms and languages is the structure of the URLs that the site/app works on - http://domain/controller/action/id - which is what we'll roll with here too. To do this for our custom PHP MVC framework, we'll need to utilize .htaccess URL re-writing with Apache.
Custom PHP MVC Tutorial: Part 3, Controllers
The controller classes in our custom MVC framework are the directors of our show. They get content from our models (writers?), and instruct our views (actors?) what to display. Even directors have orders to follow from above, however, and so do the controller classes in our MVC framework, in the form of a BaseController class they extend/inherit from.
Custom PHP MVC Tutorial: Part 4, Models
In part 3, we discussed creating the controller classes, and the example used (the Home controller) to show how a controller class might look didn't seem to reference a model at all. Technically, the model in that example was inbuilt into the method of the controller - not ideal. In this part 4, I'll cover how you may go about improving on that design with a concept sometimes referred to as Skinny Controller, Fat Model.
Custom PHP MVC Tutorial: Part 5, Views
When I first started to code websites in PHP, my understanding of separating PHP code from HTML consisted of complex string concatenation and a scary amount of character escaping. When I first started using MVC frameworks a little while back, it was like chocolate mud cake started to fall (safely) from the sky - my HTML finally looked like HTML, and not HTML murdered by server side coding syntax.
Custom PHP MVC Tutorial: Part 6, Where to now
Through Parts 1 to 5 of this series of articles, I covered what MVC means at a basic level, why you may want to create your own MVC framework in PHP, how a basic framework might look from a design point of view, and then how this basic framework does look and work in more detailed breakdowns of all major components. In this Part 6, the final member of the series, I'll discuss how you might progress with this framework from some guy's Internet ramblings to something you put to practical use.