01 Dec
Posted by Ganesh H S , Bangalore, India as zend framework
In php programming we always used global or $_GLOBALS to refer to the global variable.
For example consider below -
Db.php
<?php
// connect to mysql server
$mysqlLink = mysql_connect(”mysql_server”, “mysql_user”, “mysql_password”);
?>
index.php
<?php
require_once “Db.php”;
function displayTables()
{
global $mysqlLink;
$sql = “SHOW TABLES”;
//use global variable mysqlLink, and perform query execution
mysql_query($sql, $mysqlLink);
?>
In zend framework, zend registry is an mechanism to using global storage. The registry […]