Skip to content

This is the development of the new version of the Ofir, a simple php framework.

Notifications You must be signed in to change notification settings

valdiney/Ofir_Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ofir Framework

Description

Welcome to Ofir. This is a Project Development of the PHP Framework. Developed by student to students. What do you think about contribute with this project?

The Ofir is very easy to use. You just need install and run in your server.
Ofir uses the Model-View-Controller approach, which allows great separation between logic and presentation.

Instalation

To get help in initializing you can see our documentation for install.
For example, you can work with nginx or apache.

We are using composer to load some packages and our classes (especially).
Get help to install composer in your machine (installing composer).

Copy the file .env.sample to .env and configure it, we writed a step-by-step then you can see about the enviroment. Then configure your development environment.

I think that you are ready!

What I need at this moment?

I need to create a powerful class to work with SQL query. My objective is abstracting the SQL language in the Application.

If you can help us, go to our issues (#41) and send a pull request.


Some examples

Example of the Model class:

use \Illuminate\Database\Eloquent\Model;
class User extends Model
{
    protected $table = 'user';
}

Example of the Controller class:

class UserController extends Controller 
{
    protected $users;

    public function __construct()
    {
        $this->users = new Users();
    }

    public function index()
    {
        $title = 'All users';
        $users = $this->users->all();
        return $this->view('home.index', compact('title', 'users'));
    }
}

Example of the View:

<?php foreach ($users as $user): ?>
    <b>Name:</b> <?php $user->name;?>
    <b>Email:</b> <?php $user->email;?>
<?php endforeach; ?>

then...

Accessing the url http://[site.example]/users/, you will see the all users from you database.

Ofir CLI

You can use Ofir in your command line interface (CLI). It's a beta functionallity ;) Send a pull request and help us!

Creating controller from Ofir CLI

# display cli help
php ofir help

# display create help
php ofir create help

# create a Ofir controller
php ofir create controller [ControllerName]

# create a Ofir service
php ofir create service [ServiceName]

# create a Ofir model
php ofir create model [modelname]

About

This is the development of the new version of the Ofir, a simple php framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages