Zend - Framework 1.11 - Using Zend_Controller

Let’s explain, with this tutorial, how this Zend_Controller works. I added some examples in addition of the official documentation, even if most of my text is taking from the Zend documentation. Zend_Controller_Front is the heart of this MVC framework. It intercepts all requests and dispatches them to all adequate controllers. Each controller has one or several action methods and each action has a view script. It means that if we have a MenuController with a method named firstAction(), we will have the template /view/scripts/menu/first.phtml to display content of the firstAction() method. ...

June 21, 2011

Objective-C - Design pattern - Delegation

Delegation principle is that an object sends messages to its delegate to ask or to notify it that something is occuring. The main example is the Application that sends messages to its delegate to tell it that the routines are ready and the custom configuration can start.

April 6, 2011

Objective-C - Design pattern - Model-View-Controller - MVC

The MVC pattern is certainly the most famous one. It allows to dispatch the work in 3 concepts: The Model, the View and the Controller. This concept exists in all programming languages. So it’s easy, when you understood it, to apply your knowledge with all others languages. That’s why this design pattern is really important for a good developer, and I am sure you are one of them. Let’s beginning by the Controller. ...

April 6, 2011

PHP 5 - array() - Using is_array()

How to know if a variable is an array() or not? Easy with the is_array() function. Let’s see an example of the is_array() function: php $my = array(); if (is_array($my)) echo "This is an array()."; else echo "This is not an array()."; ? Result: This is an array().

February 22, 2011

Zend - Framework 1.11 - Create a new project

Dowload the Zend framework To easily create a new project with Zend framework we have to go until the bin/ directory of the framework package. 2) Once downloaded from the official website, go until this directory: ZendFramework-1.11.3/bin/ In this directory we have the binaries for UNIX like and Windows OS, named respectively zf.sh and zf.bat. 3) Open a shell (this black screen you like so much) and write this: $ zf.sh create project "/home/login/www/test" or ...

February 19, 2011

Ruby on Rails 3 - Console options - Create a project

To create a project in Ruby on Rails 3 with a console you have to go until the parent folder of your future project. The command line is: rails new myProject For example, if you are in this path: $ C:/ror3/ And you want to create a project named site1. Write this: $ C:/ror3/ rails new site1 All files will be created.

February 14, 2011

Ruby on Rails 3 - Console options - Display version

To know the version of your Ruby just write on your console: $ ruby -v

February 14, 2011

Ruby on Rails 3 - Server - Start the (native) Webrick server

To start the native server of Ruby on Rails, WEBrick, you have to open a shell and go until the path of your website and write “rails server” to start it. Example on Windows: $ C:/rubyOnRails/site1> rails server Same for GNU/Linux: $ home/name/rubyOnRails/site1> rails server You will see the server start and show all what is happening when there is activity on your website. To display something on your server, just go on http://localhost/3000/ and some information will be displayed.

January 19, 2011

MySQL - Commands - Pager

There is a way on GNU/Linux to change the display of the result of the SQL query. Just type: $ pager less -i -n -S Now make a command and look this new display!

January 13, 2011