Showing posts with label php frameworks. Show all posts
Showing posts with label php frameworks. Show all posts

Tuesday, December 22, 2009

Introduction To KohanaPHP - Article for packtpub UK

Recently I was contacted by one of the editors at www.packtpub.com, to come up with an article on programming with Kohana PHP Framework www.kohanaphp.com. I was happy getting such an offer and also happy because I will get to see how good my technology writing skills are ;), to me its some sort of a test. I came up with the article after a couple of days and for my first time, I say I am impressed because my first draft was approved and was said to be ok for publishing.
Oh well personally I was thinking I will have to do a second and third draft before it gets approved.
below is a preview of the article followed by a link to packtpub.com where the article is published... check it out and tell me what you think....merci.

Overview

Kohana PHP Framework is an open source PHP software development framework that helps php developers to build web applications faster, and also, more effectively by providing them with a set of built-in objects/classes. It also enforces highly organized coding standards.

The Kohana PHP Framework is just like Ruby on Rails; it implements the well known software engineering design pattern—Model View Controller(MVC). The Model View Controller software design pattern guides engineers to design their software codes into three separate parts which includes:

  • Models: The objects that manipulate data sources and data stores.
  • Views: The html and css files with inline php codes that present the user interface and controls to the application users.
  • Controllers: Objects in charge of the business logic, displaying the page(views), and routing the click actions from the views to the model and back to the views....

Monday, June 08, 2009

I Love Kohana PHP Framework – My New Found Love

Kohana is not only my new found love when building applications with php, its also rock solid MVC (Model View Controller) Object Oriented Framework for php developers.
Just like the .NET Framework and Java SDK, Kohana can be referred to as some sort of SDK for php developers, it brings a lot of order into php codes which have been referred to as spaghetti codes for years .
With Kohana php or other php frameworks like Codeigniter, you can build your application with objects just like in Java and any other developer who knows how to use the framework will easily follow your code without asking you questions. if you ever wanted to use php in a team environment, I will ask you to consider Kohana due to the following reasons:

True Object Oriented:
Everything in Kohana SDK is an object, the helpers are objects with static methods, the libraries are all objects and you can create your own classes/objects, the views are objects (which is strange but programming wise very interesting), and of course the controllers and Models are all objects.
In other frameworks, I had never wanted to create controllers and extend them but in Kohana I realized that sometimes I have to build some ABSTRACT CONTROLLERS (I feel am back in Java), and then extends these controllers in the various sections of my website. For instance there is a Template Controller that helps developers using Kohana easily create master templates for their pages.

Best ORM in PHP:
ORM or object relational mapping is a technology where in you can map your database tables and their relationships in objects (Models) and then instantiate those models and call functions to get the data without writing SQL. In Kohana, I find ORM very easy to use and fun. Before ORM in Kohana, I tried ORM in Cakephp and Codeigniter but they all proved to be buggy or were too difficult to comprehend.

Templating made easy:
Templating is something most web developers in Africa will have to consider, it makes your life easy as a developer and makes the life of designers you work with super easy. In Kohana you create a single template.php file which can constitute the site's logo, navigation, sidebar and footer. Then fit in some variables that will change from control function to control function. This way my web apps all have one master template and just small view files that I set as variables. It makes my life easy to edit and also to change the design of the whole site in minutes. Check out the templating in Kohana at www.kohanaphp.com and you will be amazed

I8n aka internationalization:
Before Kohana I had to figure out how to hack Codeigniter to do internationalization but with Kohana, everything that appears on the screen as text you can use the i8n folder found in application/i8n and make sure you have text in every language possible. Coming from Cameroon, just like Canada we have french and english as official languages which means most of my apps have to be internationalized from day one.

PHPDOC and Code Hints, Code Completion:
In Kohana, since everything is an object, it simple means using phpdoc very well and a good IDE like Netbeans 6.5, you will get code hints and completion for both in build Kohana libraries, helpers, other classes and your own built classes. I use Netbeans 6.5 and when I code, I get a lot of speed reading the code hints and getting code completion for the functions in every helper or object I want to use. It makes my life easy and I just feel I am coding using .NET C# or Java. But other than Visual Studio, and like Eclipse, Netbeans is free and its light weight (in terms of memory consumption) and easy to install and configure to coding with php.

Those are some of the reasons I think I will go with Kohana.
Another question is:
why use php at all?
Well php is cheap for me and the server I have bought runs only php and most of my clients don't care which technology we use so we go with php. Hey with php I get to train and employ talents in the space of 6months, something I cant do with .NET or Java.

What do you think about Kohana php ?

Thursday, March 19, 2009

THIS IS AN UNBELIEVABLE BLOG POST FROM FOUNDER OF PHP HIMSELF

reading this blog post I was totally shocked. How come Rasmus of php.net writes something like this to the public. If its for traffic generation then I am totally disappointed. read the post below

http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

My comments about his post:

How can he prefer his own framework to other frameworks that make the work easy for us. Its like me telling him I will never use php because it wraps everything together in one language rather I will build my own server scripting engine that will let me support .net, java and php where necessary. HOW DUMB IS THAT ??.

These frameworks might be bad but the overall success is the fact that they are documented for teams to work together and also ask questions to community on one common platform. For instance the codeigniter framework has documentation and if I am building my application and somewhere I get called for something else, I can outsource it to any php developer and tell him my code base is on codeigniter.com. This way any developer can update my codes by learning codeigniter and then working from where I stopped given the specifications and UML diagrams. But using his so called no framework framework. How is he going to explain things to other developers when he gets stuck along the way. THIS ONLY SHOWS HE IS NOT A TEAM PLAYER OR HE HAS A LOT OF TIME TO TRAIN GUYS TO UNDERSTAND HIS NO FRAMEWORK FRAMEWORK AND WORK ON PROJECTS WITH HIM.

Men Frameworks like the .NET framework is what php has been lacking for years and no true programmer will lean more to procedural and individualistic ways of doing things than a team way of doing things.

I don't have the time to create my own framework, before building my application, then spend time writing documentation for my team members to learn and then start developing. I want to use a framework that has done a lot of stuff for me and can also help me outsource work to others and still be able to modify their codes even if they are thousands of miles away from me. I don't need to send them mails or get conference calls with them just to ask what they use to validate codes or connect to the google api. I will just follow the programming principles in the framework and understand their codes and they too will understand mine.

Men Rasmus, that your toy post was a total mess and please try to upgrade and follow the current trend of things