Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Saturday, 16 June 2012

Learning the MVC principles with Zend

Getting to grips with MVC using Zend

As I mentioned in a previous post, I could neither get to grips with or understand the positive aspects of programming using the MVC principles.

It was recommended to me that I follow the Zend Framework quickstart guide. Apparently it gives a good basic understanding of the MVC principles and will take around a day to work your way through it.

I started setting up the Zend Framework on my computer a few weeks ago, but got stuck and frustrated several time and could not force myself to go back and try again. It is not the simplest thing to set up if you're not used to configuring system files such as PHP's .ini file. But I have finally got there!

The quickstart guide navigation is not all that friendly I found and so I will put some links at the bottom of this post.

There were several places that I got stuck while setting up the framework. The last and most frustrating is when I actually visited my local version of the quickstart site to be greeted with the error 'Warning require_once(Zend/Application.php)[function.require-once]: failed to open stream: No such file or directory in /home/michael/Projects/quickstart/public/index.php on line 18'. I'm still convinced that I must not have followed the setup guide correctly, I followed it through twice after to make sure I had done everything and set up any symbolic links I needed to.Google didn't seem to help. I finally gave up and started messing around the the set_include_path call on the index.php and added under the realpath bit '/home/michael/Zend/ZendFramework-1.11.11/library' it finally worked! So if you get that problem, just put that bodge in.

I am now greeted with the following image. Boring, but satisfying.
I imagine my next post will be when I have completed the guide. (Probably in a few months)


Zend Quickstart links:

Download Zend and then follow install.txt

Tuesday, 15 May 2012

The beginning

The first post:


The point of this blog is for me to chronicle my attempts set up some websites from scratch. As part of this I hope to build my own PHP based MVC framework (engine).

About me:

I left uni in 2009 with a degree in Robotics. I returned to my home town and found it extremely hard to find a job. Eventually a web agency called Switchplane hired me even though I had never done any PHP. The two bosses, Tom & Joel, trained me up in PHP and MySQL. Tom and Joel had created their own framework which at the time I was impressed with but wouldn't truly come to realise it's awesomeness until I left and worked with other frameworks.

When I left the company, I left the comfort of framework I learnt to code in and realise that I didn't actually know the basics of PHP, how some HTML actually works and Apache, among other things.

In my new job I deal with a new framework and the other parts of L.A.M.P. development Linux and Apache. This prompted me to learn every stage of creating a website so that I can perform better in my job, in the future and hopefully help some others learn with me (or correct me) along the way.

My aims:


  • A PHP MVC framework
  • Object oriented
  • For the 95% (eg. won't try to hard to support IE6 etc...)
  • Up-to-date (HTML5 + CSS3)

Priorities:


  1. Google Friendlyness (Speed, W3C validation,Blind user accessibility,semantic web)
  2. Neat code
  3. End user usability
  4. Support for older hardware,software


The idea of this framework is that you never need to edit the framework, you will extend it or copy parts to a separate project.

Upcoming posts should be about the hardware and Linux.