carlosbarbosamexico/quantum2
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Quantum 2 by Carlos Barbosa Quantum it's a php framework built for ultra fast web development. It was built for php programmers who want to get things done fast and well done. It integrates PHP-Activerecord and Smarty, which make it super powerful. It features a command line tool for creating models, controllers & views: For building a controller: cd quantum/script ./teleport -c name=blog //Teleports a blog controller ./teleport -m name=post //teleports a post model ./teleport -v controller=blog action=index // teleport an index view Controllers are intended to expose the public functions only, so you can get away with: A full blog controller in 3 mins: class BlogController extends Quantum { function __construct() { $this->setTemplate('cms); } function index() { $posts = Post::all(); $this->set('posts', $posts); } function new() { $this->createPostHook(); } function post() { if isset($this->getData['id']) { $post = Post::find_by_id($this->getData['id']); if (empty($post)) { redirect_to('/blog'); } $this->set('post', $post); } } private function createPostHook() { if (isset($this->postData['title])) { $post = new Post(); $post->title = $this->postData['title]; $post->save(); $this->set('success' 1); } } } And in your view for example: (app/views/blog/index.tpl); {section name=posts loop=posts} {$posts[posts]->title} {$posts[posts]->title} {/section} While most of it is not documented, it has been working for years in many web apps, particularly facebook apps, which is suited for it nicely. *Full features:* * PHP-Activerecord * Smarty * Teleport command line tool * QLoader (javascript loader) * Quantum Javascript framework, a framework for building huge js apps, really nicely, it automatically compiles tons of js into one single file * Full featured Template system ($this->setTemplate('something')); just drop a header.tpl and footer.tpl into a directory inside the templates folder. * Multi sites, (work on staging, dev & production from a single codebase, no hacks required just set up your config/environment.php, works by detecting the current domain so you can work on yousite.dev yoursitestaging.com and yoursiteproduction.com and just git push somewhere) * Full MVC architecture. Installation: Clone the project into a dir. Point your website to the webroot folder. Configure your db in config/environment.php Development: Controllers go in: app/controllers Models go in: app/models Views go in: app/views Filters go in app/filters Templates to in app/templates Helpers go in app/helpers Point your browser to /tests so you can see what methods the controller will inherit after boot. index.php is a meta loader, the heavy loading, is done inside quantum.php, this file can be customized to your needs to boot quantum as you may seem fit, it is provided as an example. it features some stuff for building web apis ultra fast, stuff like Quantum\ApiException::resourceNotFound(), and Quantum\ApiOutput::adaptableOutput($array); I promise some day, if you guys show interest, will improve it and doc it.... Cheers, enjoy ultra fast, no compromises web development, now. Have comments, email them to carlosbarbosamexico@gmail.com
About
Quantum: A framework for ultra fast php development
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published