{@../head.html}
{@../navigation.html}Bright was designed to be simple and flexible. Let's check it out.
The easiest way to create web site with front and and backend is following. I'm giving instructions for Mac platform with GIT as version control system.
First of al you need folder for your project. Please create directory:
mkdir mysite cd ./mysite
create new git repository for your project and clone Bright repository:
git init git clone https://github.com/jagermesh/bright.git bright
generate web site code:
cd ./bright/tools php -f init.php web
That's it. You have your new web site ready. If you created your project under apache document root folder you must be able to open it via http://localhost/mysite/
Same as before first of al you need folder for your project. Please create directory:
mkdir mysite cd ./mysite
create new git repository for your project and clone Bright repository:
git init git clone https://github.com/jagermesh/bright.git bright
Like many others frameworks Bright expect some predefeind folders structure of your project. But comparing to other player it's not that complex:
File/Path | Description |
---|---|
/.htaccess |
Typical "rewriter" RewriteEngine On RewriteRule [.](gif|css|jpg|jpeg|js|swf|png|ico|avi|htc|flv|wmv|xml)$ - [L] RewriteRule .* index.php |
/index.php |
Just include Bright main file require_once(__DIR__.'/bright/Bright.php'); Honestly saying - that's all we need. You can start creating your application right after this line. require_once(__DIR__.'/bright/Bright.php'); // here we can put our application code But we suggest you to put your application code into /app folder. If this folder exists - Bright will look into following file: |
/app/index.php |
Default main application entry point |
/config.php |
Configuration file. Optional, but almost every application have some settings. br()->config()->set('someOption', 'someValue')); More about config object check here. |
That's all. We all set. If you put
echo('Hello World');into your
/app/index.php
you will see your first Bright application.
If you don't need Bright as framework but still want to use it's awesome features and helpers you can include it into your script:
require_once('/bright/Br.php');
And use magic br() function to access Bright helpers.