Download the PHP package bombkiml/phpbeech without Composer
On this page you can find all versions of the php package bombkiml/phpbeech. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bombkiml/phpbeech
More information about bombkiml/phpbeech
Files in bombkiml/phpbeech
Informations about the package phpbeech
PHP Beech framework (LTS)
Make it by yourself
Environment Requirements
PHP >= 7.1.11
#
Installing Beech
The Beech use to manage its dependencies. So, before using make sure you have Composer installed on your machine.
$ composer create-project bombkiml/phpbeech hello-world
#
Local development server
If you have PHP installed locally and you would like to use PHP's built-in development server to your application,
You may use the serve
command. This command will start a development server at http://localhost:8000
$ php beech serve
#
Defining Controllers
Below is an example of a basic controller class. Note that the controller
extends the base controller
class.
The controller are stored in the modules/controllers/ directory. A simple controller might look something like this:
#
Passing data to views
You may use the $this->view->yourVariable
and assign data this one for passing the data to . A simple passing the data might look something like this:
#
Creating Views
Below is an simple of a basic views contain the HTML served, The are stored in the directory. A simple view might look something like this:
#
Accessing the data passed from controller
You may use the $this
for accessing the data passed to views. A simple accessing the data passed might look something like this:
#
Defining Models
Below is an example of a basic create an class. Note that the model
extends the base model
class.
The are stored in the modules/models/
directory. A simple model modules/models/Fruits.php
might look something like this:
#
Database
The Beech database (MySQL supported) using by it's query builder provides a convenient, fluent interface to creating and running database queries. It can be used to perform most database operations in your application. #
Retrieving Results
You may use the method on the facade to begin a query. The method returns a object query builder instance for the given table, allowing you to using sql statements for query by the method then finally get the results using the method. So, 3 step easy usage you may retrieving results by use the methods like this:
-
One: Specify statements, First you must specify your sql statements for get something by using Then prepare function will return new object for call next actions, So following basic for get data something like this:
-
Two: Execute statements, After specify statements you must execute your sql statements by using object as above:
- Finalize: Response data, Response data using by object for return your result data. So, Have a response are available for using:
:grey_question: Tips: You can show your sql statements before execute: |
---|
#
Database transactions
You may use the transaction method provided by facade to run a set of operations within a database transaction. If an exception is thrown within the transaction closure, the transaction will automatically be rolled back. If the closure executes successfully, the transaction will automatically be committed. You don't need to worry about manually rolling back or committing while using the transaction method:
#
Controller calling The Database
-
The automatic connect when you make under rules "same file name". So if you make Controller name is "" you must be make Model name is "" same.
- You may use the
$this->model
for calling all the methods in model. A simple calling the method might look something like this:
#
Inserts
The query builder also provides an method for inserting records into the database table. The insert method accepts an array of column names and values:
#
Updates
The query builder can also update existing records using the method. The method accepts an array of column and new value pairs containing the columns to be updated. You may constrain the update query using where clauses:
#
Deletes
The query builder may also be used to records from the table via the delete method. You may constrain the query using where clauses:
#
Using with beech-cli
command (recommended)
Document PHP beech command line interface (CLI) #
Development
Want to contribute or join for Great Job!. You can contact to me via
- GitHub: bombkiml/phpbeech - issues
- E-mail: [email protected]
- Facebook: https://www.facebook.com/bombkiml
#
License
PHP Beech framework is open-sourced software licensed under the MIT license.
All versions of phpbeech with dependencies
bombkiml/beech-cli Version ^2.0
components/font-awesome Version dev-master
twbs/bootstrap Version ^5.1.0