When your site has multiple functionality, like user services and administration, you may want to break them into separate modules. This way you can have library/books/list and admin/book/edit or generally speaking module/controller/action. Addition of module to the URI can be a challenge as modules are outside of the general MVC. Instead, each module has its own independent MVC. In this video I show how to set up such modular structure as well as applying familiar concepts, such as layout and ACL, to this new paradigm.
P.S. I had a real hard time uploading this video and I am still not sure if it came out correctly. It suppose to be 48 minutes long. Please report if its broken.
P.P.S By request, here's the SQL for the database. Its very small so i'll just include it here:
-- phpMyAdmin SQL Dump
-- version 3.2.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 14, 2009 at 11:42 AM
-- Server version: 5.1.37
-- PHP Version: 5.2.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `zftutorial`
--
-- --------------------------------------------------------
--
-- Table structure for table `books`
--
CREATE TABLE IF NOT EXISTS `books` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) COLLATE latin1_general_ci NOT NULL,
`author` varchar(100) COLLATE latin1_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=5 ;
--
-- Dumping data for table `books`
--
INSERT INTO `books` (`id`, `title`, `author`) VALUES
(1, 'Core PHP Programming', 'Leon Atkinson'),
(2, 'Programming in Python 3', 'Mark Summerfield '),
(3, 'Core Java', 'Cay S. Horstmann and Gary Cornell'),
(4, 'AJAX and PHP: Building Responsive Web Applications', 'Bogdan Brinzarea, Cristian Darie, Filip Chereches-Tosa, Mihai Bucica ');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) COLLATE latin1_general_ci NOT NULL,
`password` varchar(50) COLLATE latin1_general_ci NOT NULL,
`role` varchar(50) COLLATE latin1_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `role`) VALUES
(1, 'john', 'pass1', 'users'),
(2, 'rob', 'pass2', 'admins');
| < Prev | Next > |
|---|
