Skip to main content


JSON Tutorials : Getting Started

JSON is widely accepted text formatted structured data. JSON stands for " JavaScript Object Notation ". In general JSON can represent 1. Object of database record. 2. Object to represent a list of HTML elements. 3. Result of search query. 4. Response of an Ajax call. Here you can see JSON is used in many different areas and for many different scenarios. This means it has simple data structure. most of programming languages adopt it and it can flow easily from one connection to another. You can find JSON office definition here JSON Official Site . JSON is represented by two structural types, which includes two primitive types. Structural types Array : A sequential list of primitive data types between square brackets [ ] Object : Collection of key, value pair stored inside curly braces { }, where value would be primitive data type Primitive types : There are two primitive types key and value. " key " should be string and " value (data type)

Doctrine 2 Tutorials: Installation and Configuration

This tutorial post will help you to install Doctrine2 inside your PHP project and configure it so that you can use it's features in plain PHP project. This post illustrates installation of Doctrine2 using Composer. Installation First create your project directory mkdir zainabed cd zainabed now create composer.json vi composer.json then add following repository information. { "require" : { "doctrine/orm" : "*" } } Now you are ready to install it via composer, but first we need to install composer into you machine. curl -sS | php Then initiate following command to install Doctrine2 php composer.phar install composer creates " autoload.php " file which helps you to autoload all PHP classes of Doctrine2 ORM project. Configuration First create configuration file configuration.php  for Doctrine2 and include autoload.php inside i

Twig Tutorials: Install and Configure

In this tutorial we will see how to install Twig inside your PHP project and then configure it so that we can create use Twig template inside our PHP web application. later we see a simple Twig template example which will display "Welcome to Twig template" message. lets see each step one by one. Install we can install Twig template via Composer, Git or from PEAR. in this tutorial post we will install Twig using Composer. for that we need to create "composer.json" file. { "require": { "twig/twig": "1.*" } } the from console run following command.   php composer.phar install    this command will install Twig library. Configuration To use Twig template we need configure it first, for that we will create index.php file which will setup Twig autoloader and generate the Twig environment. using this Twig environment we will render Twig template include __DIR__ . "/vendor/twig/twig/l

How to create SSH Key for GitHub and Bitbucket

This  post  demonstrate how to  generate  SSH private and  public   key  with fundamental steps and  assist   you  to  add   public   key  inside your  GitHub  and Bitbucket account. But first why we  need  this SSH  public   key ? Whether you are working in the team or an individual and you want make any operations on secure GIT repository like clone or push your latest changes then you require to provide your credentials to help GIT to authenticate you and approve those operations. But when  you  do so,  you  are  asked  to  provide  your username &  password ,  each   time  on  each   operation . It looks  simple  earlier, but later  becomes  a  headache . SSH  connection   helps   us  to  authenticate  using public and private keys, that  we  generate only once, later  we  don’t need to  authenticate ,  SSH  will  do  this behalf of  us . But how does it  work ? SSH   authenticate  you  using  an  identity , your  identity  and this  identity   comprise   combination  of p

Symfony Tutorials: Event Dispatcher

Symfony EventDispatcher is object which interacts with different set of objects when certain event happens. To illustrate Event Dispatcher definition let’s consider the online shopping website example. suppose  you want to purchase a mobile f rom online shopping website , but unfortunately that mobile is out of stock. Then you subscribe into online shopping website for this mobile availability. When mobile comes in stock, online shopping website notifies you about mobile phone’s availability via email. In above scenario you are the Event Listener / Event Subscriber mobile availability is Event online shopping website is Event Dispatcher . Symfony EventDispatcher works in same manner.for example, whenever there is HTTP request, Kernel creates a request object and it dispatches an event kernel.request . Whoever subscribes to kernel.request event gets notified. So here you might be having few questions in my mind. What is Event?

Drupal 8 Tutorials : Custom Module

Custom Module development in Drupal 8 is very simple. It may looks very difficult for developer who has Drupal 7 experience or nothing at all. This tutorial will show easy steps and helps you to create custom module within few minutes. Note: Content or example of this tutorial may change according to Drupal 8 version and its release. This tutorial is divided into three small sections. In first section of this tutorial we will see what directory structure we need to create for a custom module. In second section we will see what type files we need to create. And in last section we will see what code we need to write in those files and configure them in Drupal 8. 1 Directory Structure All custom module in Drupal 8 reside under “module” directory of Drupal 8 project. To create a custom module we will create a new directory named “document” under custom folder. Following is directory structure. 2 Configuration files Secon

JAX-RS Tutorilas: Hello World Example

Following is simple  JAX-RS  tutorial, which sends “Hello World” text as response string using JAX-RS API and Jersey implementation. Technologies and Tools used in this article: 1.    JDK  2.     Eclipse  3.    Tomcat 4.    Maven  5.     Jersey 1.8 Create Maven Web Project Create a Maven web project and name it "helloworld" . File -> New -> Other -> Maven Project -> Next Select  maven-archetype-webapp Select  Next Type  Group Id,   Artifact Id  and  Package  name And select  Finish Add Project Dependencies Add Jersey repository using Maven. Use following URL to get appropriate repository. Now update pom.xml file. File : pom.xml <project ...  > ...         ... <dependencies>                 ...                 ... <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server&