Archive for the ‘Web Programming’ Category

MVC: A Beginner’s Guide

Tuesday, December 29th, 2009

Introduction

So you want to learn about MVC? This article will hopefully clear some of your possible confusion when it comes to this three letter acronym that can strike fear into the hearts of many. Like most topics in web development, it’s always a little confusing when you first take a look at it, but after you read up on the topic, and try it for the first time, it’s as easy as pie! Read on, my friend!

What the heck does it stand for?

MVC stands for Model-View-Controller. It is an architectural pattern used when engineering software. Basically, it separates the three main parts of an application and makes them independent of each other, therefore they can be designed, tested, and worked on independently of each other.

In the world of web development, MVC is usually used with a framework such as CakePHP or CodeIgniter. For the purposes of this post, we won’t be focusing on any individual framework, more on the idea of what MVC really is and how it can be used. If you would like to delve into one framework as a beginner, though, I highly recommend CodeIgniter to get started. It is simple, yet powerful, and won’t confuse you when you’re getting started.

M

Models are very simple. They are the knowledge of your program, they represent it as either a single object, or a structure of multiple objects.

In the static web world, your model could be simply the HTML of your page. It is the skeleton of your content, how it will be structured, and of course, the content itself.

V

The view is a visual representation of a model. In a program, a view fetches the model’s data, and displays it. It can also update the model by collecting data.

A static example of this is plain old CSS. The CSS adds visual style to your model (the HTML), it is used as the “skin” to the skeleton of your content. We can switch from one style to another and not affect the model at all.

C

The controller is what puts it all together between the user and the system. It receives user’s input in the form of commands and data, then outputs the views that are to be presented.

An example of the Controller would be the browser. It takes the HTML, CSS and any other jargon and outputs a readable web page for the user to interact with. It can also accept user input in a sign up form for example.

Conclusion

Hopefully I haven’t confused you too badly, and you have at least a basic understanding of MVC now. It’s literally all around you, as I have shown in a simple HTML/CSS/Browser example. If you want to read more, the CodeIgniter documentation explains it in terms of their own framework. Take a look at those docs here. Thanks for reading!

Posted in PHP, Web Programming | 4 Comments »

5 Ways for Web Devs to Make Extra Side Income!

Monday, December 21st, 2009

Being a web developer is usually a pretty awesome, if not time consuming job. However, that doesn’t mean there aren’t things we can’t do in our free time to increase our income some. Let’s take a look at 5 legitimate ways a web developer can make some extra side cash in their free time. Note, all of these require some degree of work and dedication, but like all good things, it’s worth it in the end.

(more…)

Tags: ,
Posted in Web Dev. Links, Web Programming | 4 Comments »

What Makes a Great Web Developer? Twitter Developers Respond.

Wednesday, December 9th, 2009

twitter_great_developer

Recently, as I was reading some older articles on good programming characteristics, I got to thinking specifically about web developers. The role of a web developer is critical for any website project or application, so I turned my questions to Twitter to get some input. The responses I got were overwhelming and filled with different opinions and advice. I saw this as a great opportunity to discuss what the development community thinks makes a great web developer. Let’s take a look at the findings!

(more…)

Posted in Software, Web Dev. Links, Web Programming | 13 Comments »

Implementing paging using PHP and jQuery

Wednesday, December 2nd, 2009

preview

In this tutorial we are going to implement paging using php and jquery. We are going to create a paging widget and we will give it a cool UI using jquery UI. I have tried to explain paging in the most simplest way and it can be extended further easily to more advance form of paging.
(more…)

Posted in PHP, Web Programming | 1 Comment »

How to Create a Simple API with PHP and MySQL

Monday, November 30th, 2009

Introduction

Hello and welcome to my first article for the Brenelz Web Solutions blog! This article will cover how you can create a very simple API for any one of your projects. We are going to be using PHP and MySQL for the back end, and we will output our API data in two formats: XML or JSON.
(more…)

Posted in PHP, Web Programming | 7 Comments »

 
connect with me!