Download the PHP package dinhthibc/feazy without Composer
On this page you can find all versions of the php package dinhthibc/feazy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dinhthibc/feazy
More information about dinhthibc/feazy
Files in dinhthibc/feazy
Package feazy
Short Description A simple PHP framework
License Apache-2.0
Homepage https://www.github.com/dinhthibc/feazy
Informations about the package feazy
Feazy Framework
A simple & lightweight PHP framework to build Web application & RESTful API
Installation
Simple app
Add simple index.php
file:
Then run server
Open localhost:8000
in web browser
Simple app with controllers
Add folder
Add UserController
class to controller folder
And index.php
file
Then run server
Open localhost:8000/users
or localhost:8000/users/1
in web browser
Router
This section will help you to under stand how to configure your router
Install new router
You can use basic route like this:
Route | Controller |
---|---|
/ |
Application/Controller/IndexController@index |
/user |
Application/Controller/UserController@index |
/user/edit/1 |
Application/Controller/UserController@edit with first parameter is 1 |
Or define your own routes like this
Route | Controller |
---|---|
/users |
Application/Controller/UserController@index |
/users/get/1 |
Application/Controller/UserController@get with first parameter is 1 |
/api/users |
Application/API/UserController@index |
View
Render layout
This section will help you to structure your view files with 1 layout file Let's have files structure like this
Name | Description |
---|---|
index.php |
Main application |
IndexController.php |
Controller for homepage |
layout/layout.phtml |
Layout file |
index/index.phtml |
Child page file |
Put content for each file with following code: index.php
IndexController.php
layout.phtml
index.phtml
When you run website on browser, you will get this result
Render view section
Manage your common section in multiple child pages Now we have some extra files in directories
Update index.phtml code
component1.phtml
component2.phtml
View variables
Help us to expose a variable from Controller to View
In view child page just call block below to get $myVariable
value
.... to be continued