27 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
When i started to develop a web application using zend framework, i couldn’t get much of articles related to how to access form data, zend framework form handling classes are very good approach in handling form, most of them were still under proposal state.
What i really wanted was to access the form data, which i […]
25 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
Zend debug is used for debugging purpose. The static method Zend_Debug::dump() prints or returns information about an expression, which is much similar of using var_dump.
Syntax is as below -
<?php
// $var argument specifies the expression or variable
// $label argument is a string to be prepended to the output
// $echo argument specifies whether the output […]
25 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
As in other object oriented programming languages, zend framework supports try catch, all exceptions thrown by Zend Framework classes should throw an exception that derives from the base class Zend_Exception.
Example 1:
In this example, code require_once “Zend_Loader.php”; is commented, so error is thrown when we are trying to access Zend_Loader.
<?php
//require_once “Zend_Loader.php”;
try
{
Zend_Loader::loadClass(’Zend_Session’);
}
catch (Zend_Exception $e) {
echo “Error message: […]
25 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
In the previous post about setting project environment setting http://ganeshhs.com/php/php-configuring-project-environment-using-ini-file , zend config plays a vital role in initializing the environment variables and by default, configuration data made available through Zend_Config are read-only.
Lets write the ini configuration file application/config.ini
[staging]
db.adapter = PDO_MYSQL
db.config.host = localhost
db.config.username = mysql_user
db.config.password […]
25 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
Zend loader is much similar to require_once, best usage is if we have to load a file based on the variable value.
<?php
require_once “Zend/Loader.php”;
Zend_Loader::loadClass(’Zend_Session’);
Zend_Session::start();
?>
The above example, illustrates loading the zend session class and starting the session.
Here i am not going to discuss complete usage of zend loader, i will be explaining zend framework concepts to quick […]
22 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
In this zend framework tutorial, we will learn how to create the file/directory layout when developing any project using zend framework.
application - business logic files, no access for website users
library […]
22 Nov
Posted by Ganesh H S , Bangalore, India as zend framework
To completely understand the bootstrap files, you need to read all the tutorials of zend framework. I will cover all this topics in upcoming tutorials.
Lets start writing the bootstrap file public/index.php -
<?php
/**
* Bootstrap file for zend framework
*
* Set the environment settings of zend framework
*
* PHP versions 5.1.4+
*
*
* @category zend framework tutorials
* @author Ganesh H S […]
15 Nov
Posted by Ganesh H S , Bangalore, India as Search Engine Optimization
Sitemap consists of lists of URLs of a site with metadata (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) about each URL, which helps informing search engines about site pages that are available for crawling, so that search engines can […]
Web Robots (Crawlers, or Spiders) are programs that traverse the Web automatically. Search engines use them to index the web content.
Whenever search engine robotos wants to crawl the website, it looks for robots.txt which is the file where we write the instructions to the robots/crawlers about what it should crawl and […]
I always used retrieving the Operating system environment, and then get all current include path and then set the include path
<?php
$delim = (PHP_OS == “WIN32″ || PHP_OS == “WINNT”) ? ‘;’: ‘:’;
ini_set(’include_path’, “.”);
ini_set(’include_path’, ini_get(’include_path’) . “my_library”);
ini_set(’include_path’, ini_get(’include_path’) . “my_library/include”);
?>
Here is the code, which simplifies the above logic of detecting OS environment and then to get […]