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.
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!
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.
use \Illuminate\Database\Eloquent\Model;
class User extends Model
{
protected $table = 'user';
}
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'));
}
}
<?php foreach ($users as $user): ?>
<b>Name:</b> <?php $user->name;?>
<b>Email:</b> <?php $user->email;?>
<?php endforeach; ?>
Accessing the url http://[site.example]/users/
, you will see the all users from you database.
You can use Ofir
in your command line interface (CLI). It's a beta functionallity ;)
Send a pull request and help us!
# 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]