raeen / bamboo
Bamboo is a php api framework
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- bramus/router: ~1.5
- vlucas/phpdotenv: ^5.3
README
Bamboo
Bamboo is a php api framework . Very easy , simple and lightMade by Raeen Ahani in 2021 in Gorgan, Iran
Install
composer create-project raeen/bamboo
Documentation
Database
To connect to the mysql database, refer to the .env
Router
We use bramus/router for the router, of course we customized it so that by default in the controller the function of the sent method is executed
Method
The method sent to the controllers is stored in the $method
( $this->method
) variable
Path
The page address is stored in the $path
( $this->path
) variable on the controllers
Data
The data sent to the api is stored in the controllers in the $data
( $this->data
) variable
File
The information of the files is stored in the $files
( $this->files
) variable in the controllers
The files are downloaded in the archive folder. To download, use the download(key of file , save File name = null)
function in the controllers.
Use the sendFile(file name)
function on the controllers to send the file
Authenticate
For the http authorization header, use the auth(username, password)
function in the controllers
Api Key
Use the apikey(length = 20)
function in the controller to create the api key
Query
Use the DB::query(sql query, parameters ...)
function for SQL query on controllers. This function uses pdo
, example :
$query = DB::query("SELECT * FROM user WHERE name=?", $name); $result = $query->fetch(PDO::FETCH_OBJ);
Render
Use render(int $code, array | object $data = null, $status = null, $message = null)
on the controllers to send the result as jason. Messages and statuses are completed by code by default