dsh / bastard

A really bad PHP framework.

Dave: 077d629a40 Toyed with the idea of using other dependencies, decided against it. 5 months ago
controllers Demo controller method names now make sense. 5 months ago
docs Added to the documentation. 5 months ago
images Took demo screen shots. Every one wants to see screen shots. 5 months ago
layout Now the styles are dynamically loaded. 5 months ago
libs Dynamically adds the stylesheet every time now. 5 months ago
models Repurposing the models directory. 5 months ago
views Toyed with the idea of using other dependencies, decided against it. 5 months ago
LICENSE Init commit 5 months ago
index.php Now the styles are dynamically loaded. 5 months ago
lib.php Toyed with the idea of using other dependencies, decided against it. 5 months ago
readme.md Now the styles are dynamically loaded. 5 months ago

readme.md

Bastard

We are version 0.2 and we still don't care.

This is a PHP web framework. It is extremely, loosely MVC in nature. Basically understand how the URL is parsed, and design your application. We don't care how you do it.

Requirements

  • PHP 5.4

That's it.

Abstract

Everything is passed through the URL. With this idea, we think of the MVC and disect a URL.

localhost:8080/views/params

The index.php file is designed to associate what ever the view may be with the appropriate file in the /views directory. Let's imagine that we have products that are being sold. This product obviously has a name, and absolutely would have a SKU associated with it. Let's see an example of using each to display a specific product on a web page.

localhost:8080/products/hammer

And with a SKU:

localhost:8080/products/888493004

This would look for the /views/products.php file which will contain all of the code necessary to use the corresponding Products controller. This controller, in turn, will call to the database and perform what ever task is needed of it.

This is a really extensible, flexible, light, and open framework. Its really ugly and people are going to hate it. It will work, but it will be dirty. It's a bastard.

Demonstration

Start the PHP server in the root directory and check out the demo page.

$ php -S localhost:8080

Now we can direct our browser to http://localhost:8080/demo and start passing parameters. Neat.