sponsor

Wednesday, January 30, 2008

Introduction CakePHP

Introduction to CakePHP
Section 1
What is CakePHP?

CakePHP is a free open-source rapid development framework for PHP. Its a structure of libraries, classes and run-time infrastructure for programmers creating web applications originally inspired by the Ruby on Rails framework. Our primary goal is to enable you to work in a structured and rapid manner - without loss of flexibility.
Section 2
Why CakePHP?

CakePHP has several features that make it a great choice as a framework for developing applications swiftly and with the least amount of hassle. Here are a few in no particular order:

1.

Active, friendly community
2.

Flexible Licensing
3.

Compatibility with PHP4 and PHP5
4.

Integrated CRUD for database interaction and simplified queries
5.

Application Scaffolding
6.

Model View Controller (MVC) Architecture
7.

Request dispatcher with good looking, custom URLs
8.

Built-in Validation
9.

Fast and flexible templating (PHP syntax, with helpers)
10.

View Helpers for AJAX, Javascript, HTML Forms and more
11.

Security, Session, and Request Handling Components
12.

Flexible access control lists
13.

Data Sanitization
14.

Flexible View Caching
15.

Works from any web site subdirectory, with little to no Apache configuration involved

Section 3
History of CakePHP

In 2005, Michal Tatarynowicz wrote a minimal version of a Rapid Application Framework in PHP. He found that it was the start of a very good framework. Michal published the framework under the MIT license, dubbing it Cake, and opened it up to a community of developers, who now maintain Cake under the name CakePHP.
print chapter

source : http://manual.cakephp.org/chapter/intro, ajax

Monday, January 28, 2008

CodeIgniter

Welcome to CodeIgniter

CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task.

Please read the Introduction section of the User Guide to learn the broad concepts behind CodeIgniter, then read the Getting Started page.
Who is CodeIgniter For?

CodeIgniter is right for you if:

* You want a framework with a small footprint.
* You need exceptional performance.
* You need broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
* You want a framework that requires nearly zero configuration.
* You want a framework that does not require you to use the command line.
* You want a framework that does not require you to adhere to restrictive coding rules.
* You are not interested in large-scale monolithic libraries like PEAR.
* You do not want to be forced to learn a templating language (although a template parser is optionally available if you desire one).
* You eschew complexity, favoring simple solutions.
* You need clear, thorough documentation.

http://codeigniter.com/user_guide/

Monday, January 7, 2008

Getting Started with jQuery

This guide is an introduction to the jQuery library. Basic knowledge of JavaScript and the document object model (DOM) is required. It starts from ground up and tries to explain details where necessary. It covers a simple hello world example, selector and event basics, AJAX, FX and usage and authoring of plugins.

This guide contains no "click me" examples. The intention of providing only "copy me" code is to invite you to try it for yourself. Copy an example, see what it does, and modify it.

Setup

To start, we need a copy of the jQuery library, which we can get from the main download page. The jQuery Starterkit provides some markup and CSS to work with. After downloading and extracting its content we put jquery.js into the same directory and open starterkit.html and custom.js with our favorite editor and starterkit.html with a browser.

Now we have everything to start with the notorious "Hello world" example.

Hello jQuery

We start with an empty html page:

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
// we will add our javascript code here
</script>
</head>
<body>
<--- we will add our HTML content here -->
<body>
<html>

This page just loads the jquery.js library (make sure the URL points to where you stored your copy of jquery! This example assumes that you store it in the same directory as this example file). Two comments indicate where we will expand this template with code.

As almost everything we do when using jQuery reads or manipulates the document object model (DOM), we need to make sure that we start adding events etc. as soon as the DOM is ready.

To do this, we register a ready event for the document.

$(document).ready(function() {
// do stuff when DOM is ready
});

Putting an alert into that function does not make much sense, as an alert does not require the DOM to be loaded. So lets try something a little more sophisticated: Show an alert when clicking the link.

$(document).ready(function() {
$("a").click(function() {
alert("Hello world!");
});
});

This should show the alert as soon as you click on the link.

Lets have a look at what we are doing: $("a") is a jQuery selector, in this case, it selects all a elements. $ itself is an alias for the jQuery "class", therefore $() constructs a new jQuery object. The click() function we call next is a method of the jQuery object. It binds a click event to all selected elements (in this case, a single anchor element) and executes the provided function when the event occurs.

This is similar to the following code:

Link

The difference is quite obvious: We don't need to write an onclick for every single element. We have a clean separation of structure (HTML) and behavior (JS), just as we separate structure and presentation by using CSS.

With this in mind, we explore selectors and events a little further.