View all courses
This Course is designed for the aspiring Web Designers and Developers with a need to understand the HTML in enough detail along with its simple overview, and practical examples.
CSS is used to control the style of a web document in a simple and easy way.This tutorial will help both students as well as professionals who want to make their websites.
This tutorial is designed for software programmers who wants to learn the basics of jQuery and its programming concepts in simple and easy ways. This tutorial will give you enough understanding on components of jQuery with suitable examples.
AJAX, is a web development technique for creating interactive web applications.
HTML5 is the latest and most enhanced version of HTML.Technically, HTML is not a programming language, but rather a mark up language.This tutorial has been designed for beginners in HTML5 providing the basic to advanced concepts of the subject.
PHP (Hypertext Preprocessor), it is extensively used by developers for programming and development. PHP has lots of benefits and easy to learn so it is the first choice of developers and programmer.
Many PHP programming courses cover the basics or a specific concept. Our Advanced PHP Development course gives you the concepts, features, tools, and practical advice to use them together to build performant, secure, scalable, and reliable web applications.
In this tutorial we will provide you with detailed instructions on how to use WordPress to create and manage your site. WordPress can be used for both simple and complex websites. In our WordPress tutorial we have tried to cover all the basics and few advanced topics.
This tutorial has been prepared for developers who would like to learn the art of developing websites using CodeIgniter. It provides a complete understanding of this framework.
Zend Framework 1 is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 1 uses 100% object-oriented code and utilises most of the new features of PHP 5.3.
Zend Framework 2 is an open source Module based framework for developing web applications and services using PHP 5.5+. Zend Framework 1 uses 100% object-oriented code and utilises most of the new features of PHP 5.5
The Language Which does not need any prior knowledge of Programming and Easy to learn .Python is Object-oriented ,interpreted and Server side Scripting language .
In Advance concept After learning Core Python We will use Python to create Desktop Application, Web Application, Sockets Programming , Multithread Programming. Since its An Open source Language its free of Cost
Ruby is server side, dynamic, reflective, object-oriented, general-purpose programming language. Ruby is "an interpreted scripting language for quick and easy object-oriented programming"
Ruby on Rails, or simply Rails, is a web application frameworkwritten in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web pages.
If you have any confusion then you can ask our experts.Our experts will guide you properly.
We are looking you if you are looking guidance for web design and development. Apply online.
1.1. Create the module directory structure and necessary preliminary files
At first we are going to create the Album module structure, it’s similar to the ‘Helloworld’ module.
The directory structure is shown below.
Now first of all we know that the module manager will first look for the Module.php file and look
for the class Module, so we will now open Module.php and insert these below codes.
public function getAutoloaderConfig()
return array('Zend\Loader\StandardAutoloader' =>
array('namespaces' =>array(__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,),),);
public function getConfig()
return include __DIR__ . '/config/module.config.php';
I already discussed these in previous, though a little discussion here for those directly comes here.
We define the namespace name of the module and then we create the class Module and create two
common methods which are automatically got by the ZF2 when Module Manager is initiates. We
describe this into the ‘Hello world’ module already in details. If you didn’t read or watch the video
of the ‘Hello World’ module application, I recommended you to read or watch that first (link). In
short, I can say that when ZF2 starts then if the module namespace is configured into the
application.config.php then the module manager automatically activates all the modules. When
a module initialize then it checks for the Module.php file and see the Module class, if there is any
methods named getAutoloaderConfig() or getConfig() then these two methods also initialize
automatically. These two methods basically say’s about the module configuration. Into the getConfig()
method we returning the module config array that has defined into the module.config.php file, ZF2
merge these module configuration with the whole application configuration. And into the
getAutoloaderConfig() method we shows the path of our module class files where we will write our all
the controllers and models, we want these classes initializes when the module initiates.
Details visit this blog if you want to know more details.
1.2. Define view_manager in module.config.php
So now we had written some codes into the Module.php file, now we will configure the module
configuration file. Open the /config/module.config.php file, and write these codes.
return array('view_manager' => array('template_path_stack' => array(__DIR__ . '/../view'),),);
We here just define the view manager and shows where is our template paths for the views for this
We will add more configurations keys into this file later as we go forward. Normally the controllers,
routes, service managers, factories are all configured into this file.
1.3. Create the Controller named ‘AlbumController’
Now we need to create a controller. We are naming it Album. So create a file named
AlbumController.php under the /Controller/
As you see each controller are named by append of Controller into it, it’s the naming convention
of the ZF2.
Add these codes into it.
class AlbumController extends AbstractActionController
public function indexAction()
return new ViewModel(array('album' => 'Album Home Page'));
So here we define the namespace name; then we create the AlbumController class which
extends the AbstractionActionController of the Zend\Mvc\Controller. Also we create an
action method named indexAction. We want that our controller and view works good at
first like the hello world program, so we will create the view and route first after that we
will add the functionality into the controller later. So we just provide a view model array
with a key name album and give it a value Album Home Page for now.
Now that we have a controller so we will immediately add and configure it to the
Open the /config/module.config.php file and add these codes into it.
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
// <----- Module Controller
So here we create a controllers key and into the invokables we name this controller as
’Album\Controller\Album’ and gives the path of the controller.
For your information, this controller is now can be accessible from any other modules in
the application. That is why we named our controller as ’Album\Controller\Album’ so
that it will be unique.
So up to now we create the controller and we defined it into the module configuration
and now we will create the index view as we create a indexAction method under the
So let’s create a view first.
Create a file named index.phtml under /view/album/album/
See here we create the view file under the view/then the module name/ then the controller
name, this is the convention of the ZF2.
And into the index.phtml file write these codes
Here we are just printing the album key value from the AlbumController of indexAction
methods, see there we defined the album key a value ‘Album Home Page’.
1.4. Create routes for Album Module
We will now create the route for this view.
Again open the module.config.php file and write these lines of codes at the end.
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album/album[/:action][/:id]',
// <---- url format module/action/id
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
'defaults' => array(
'controller' => 'Album\Controller\Album',
// <--- Defined as the module controller
'action' => 'index',
// <---- Default action
So here we create a route name album which is a segment type route. And we defined
some of the options here. We are checking when this route will be activated? We write it
like this ‘/album/album/[:/action][:/id]’ I like to active my controller like the module name /
then the controller name/ then the action name and / later the id. I also defined some
regular expression for the action name so that action and id follows these validation rules.
Then we defined the default controller name as our AlbumController and action as
indexAction() method for it.
1.5. Now active the module.
Open the application.config.php file and add this module namespace name at the last
Here we inform our application that a new module has been added to the system.
Now try to visit: http://www.zf2-tutorial-video.loc/album/album
You supposed to see the message text “Album Home Page”
If you are having problem please write it into the comment section, write what it is showing
on the error.We can also see that what controller, action and id are requesting and working
behind the requested url.Open the AlbumController.php file and changed the codes of the
return new ViewModel(array(
'namespace' => __NAMESPACE__,
'controller' => $this->params('controller'),
'action' => $this->params('action'),
'id' => $this->params('id'),
So here we defined the name of the module.
Then we get the controller name by calling the params(‘controller’) and action and id
So now print this values into the index.phtml file.
echo "Module Name: ".$this->namespace;
echo "<br />";
echo "Controller Name: ".$this->controller;
echo "<br />";
echo "Action Name: ".$this->action;
echo "<br />";
echo "ID: ".$this->id;
Now if we type into the url this : http://localhost/album/album/index/5
It will show us this informations:
Module Name: Album Module
Controller Name: Album\Controller\Album
Action Name: index
< How to use multiple TableGateway In single Module