Sunday 7 January 2018

Zend Framework 2 Create modules tutorial with example

Here are example of Zend Framework 2.5 module.
To run this example you must have already installed Zend Framework 2 in system.
Download the code and put unzipped folder in "modules" folder , then run SQL queries and access with /album/index


Add New Record 
URL: http://example.com/album/add
Add New Record




Listing of Records
URL: http://example.com/album
Listing of Records




Edit the record
URL: http://example.com/album/edit/4

Edit the record




Delete the record
URL: http://example.com/album/album/delete/1

Delete the record




Question: You need following SQL Query?
CREATE TABLE album (
   id int(11) NOT NULL auto_increment,
   artist varchar(100) NOT NULL,
   title varchar(100) NOT NULL,
   PRIMARY KEY (id)
 );
 INSERT INTO album (artist, title)
     VALUES  ('The  Military  Wives',  'In  My  Dreams');
 INSERT INTO album (artist, title)
     VALUES  ('Adele',  '21');
 INSERT INTO album (artist, title)
     VALUES  ('Bruce  Springsteen',  'Wrecking Ball (Deluxe)');
 INSERT INTO album (artist, title)
     VALUES  ('Lana  Del  Rey',  'Born  To  Die');
 INSERT INTO album (artist, title)
     VALUES  ('Gotye',  'Making  Mirrors');



Click below to download the module.
Download the Module