Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2014-10-06 | 3.6 kB | |
zedek_framework_3.tar.gz | 2014-10-06 | 4.9 MB | |
zedek_framework_3.zip | 2014-10-06 | 4.7 MB | |
Totals: 3 Items | 9.7 MB | 0 |
Zedek 3
Zedek Web Development Framework version 3
This is a PHP web development framework.
The features include:
- Model-View-Controller
- Object Oriented
- Encourages Agile development
- Has an Object Relational Mapper (ORM) built in called ZORM
- Has a templating engine accessed from a class called ZView
- Templating engines allows some logic in the html view file such as looping through an array with the option of including raw php in the markup
- URL rewriting allowing for clean urls, and sub folder installation
- Tested with apache, and currently being tested on lighttpd
- Works on Unix, unix-like and Windows Operating Systems
Requirements
- Apache
- PHP5.3+
- Knowledge of PHP
- Knowledge of Object Oriented Programming (OOP)
- PHPUnit and understanding of Test Driven Development (TDD) in PHP - Simpletest library has been included to take care of web presentation of tests
Creating your first application follow these steps:
- Download this repo and extract so you have a folder named "zedek" or what ever else you want to call it in a non web accessible folder (one of the security features of Zedek Framework).
- In your web accessible folder (web root) you will require 3 files and a folder being a ".htaccess" file, a router file named as you desire such as "router.php", a "favicon.ico" file and a folder named themes for your publicly accessible files. To get these you may copy them out of the /zedek/public folder or make this folder your web folder by creating a virtual host for this folder
-
The contents of the .htaccess file should redirect all traffic to the router file while excluding the public folder(s) contents and any other folders you define.
-
You may also copy the contents of the /zedek/public/ folder into your web root or create a virtual host that points to that folder.
.htaccess contents
RewriteEngine On
RewriteCond %{REQUEST_URI} !/themes/.*$
RewriteCond %{REQUEST_URI} !/favicon\.ico$
RewriteRule ^(.*)$ router.php
*Ensure you have mod_rewrite enabled and properly configured
router.php contents
<?php
require_once "/path/to/zedek/anchor.php";
?>
and you are about done with the web parts.
on a windows machine it would look like this:
<?php
require_once "drive:\\path\\to\\anchor.php";
?>
initializer.php
Within the anchor file on line 24 set the web path physical path leading to the zedek app ending with a trailing slash
const zweb="/path/to/web/folder/";
Once done you should see your app on your website with a successful install message. * if installing in a sub folder also include the web sub folder path from web root on line 30
Hello World!
Zedek 3 is built to map urls to engine directories and methods of the class CController (for current controller) in a style:
http://mysite.com/controller/method/id/?arg1=val1&arg2=val2...$argn=valn
(this mapping is handled primarily by a class named URLMaper)
the MVC is made literal within the engine folder.
- To create a new app named foo create a folder with the name foo within the engines folder.
- within this create a class file "controller.php".
-
within the controller file enter the following code inside your php tags
<?php namespace zf; class CController extends ZController{ function bar(){ print "Hello World"; } }
-
Browse to http://mysite.com/foo/bar
and you should see your hello world message!
Congratulations!