Archive for category Programming

Get all objects that you need with Zend_Registry by simple method

Frameworks always learn to developer to use the better and quickest way. The lovely class of Zend Framework is Zend_Registry, that you can set and get your object any scope of your application.

In most of PHP application you may have many of object that you must use is any part of your application.

Set the objects

	// set objects
	$myObject_1 = "I love Zend Framework.";
	Zend_Registry::set('myObject_1', $myObject_1);

	$myObject_2 = new My_Foo();
	Zend_Registry::set('myObject_2', $myObject_2);

	$myObject_3 = Zend_Db::factory($config);
	Zend_Registry::set('myObject_3', $myObject_3);

Get the objects one by one

	// get objects
	$myObject_1 = Zend_Registry::get('myObject_1');
	$myObject_2 = Zend_Registry::get('myObject_2');
	$myObject_2 = Zend_Registry::get('myObject_2');

You can see you must call a get method of Zend_Registry for each object. But you can easily load every object that you need in your scope just with call a simple method and use list.

Read the rest of this entry »

, , , , ,

No Comments

Zend Config tree solution

The best part of my favorite PHP framework, Zend framework is Zend_Config. With Zend Config you can run you web application with more power full configuration that any one can change your application setting for use.

Read more information about Zend Config at Zend framework manual for Zend Config.

But in most web application you may have many configuration file with special format such as INI, XML or PHP. Also some of configuration is for one part of your application and may you put in special folders.

My Zend framework folder structure

So this is my default Zend framework folder structure that you have see more configuration file.
My Zend framework folder structure

Default solution

In default solution you need to define a Zend Config object for each file to access file data.
But with this solution you can globally access all files in any format in each folder.
Read the rest of this entry »

, , , , ,

9 Comments

Chart in web pages

In many web application we need to show the users the result of processed data in graphical charts. It will be help you to have a good application that can serve data to user, friendly.

Web based charts

Read the rest of this entry »

, ,

5 Comments