Welcome to the documentation for the Ryxo Framework. Ryxo is a lightweight PHP framework designed to provide a simple yet powerful foundation for building web applications.
To install Ryxo, follow these steps:
- Clone the repository:
git clone https://github.com/gyanendra-baghel/ryxo.git
- Install dependencies:
composer install
- Autoloading: Ryxo follows the PSR-4 autoloading standard. Make sure the
App
namespace points to yourapp/
directory.
"autoload": {
"psr-4": {
"App\\": "app/"
}
}
Define routes in the routes.php
file:
// routes.php
$app->get('/', [SiteController::class,'index');
$app->get('/blogs/{id}',function($req, $res, $params){
// ...
});
Ryxo includes a basic templating engine. Views are located in the app/views
directory.
Run the built-in PHP server:
php -S localhost:8000 -t public
Visit http://localhost:8000 in your browser.
Ryxo provides a simple routing system to handle HTTP requests. Define routes in the routes.php
file using the get
and post
methods.
$app->get('/path', Controller::class,'method');
The included templating engine allows you to render views easily. Use the render
method in your controllers.
// Inside a controller method
return $this->response->render('viewName', ['data' => $data]);
Create controllers in the app/Controllers
directory. Controllers handle the logic for specific routes.
// Example HomeController
namespace App\Controllers;
use Ryxo\Controller;
class HomeController extends Controller
{
public function index()
{
return $this->response->render('home');
}
}
We welcome contributions to Ryxo! Follow the guidelines in the CONTRIBUTING.md file.
Ryxo is open-source software licensed under the MIT License.
For support, please open an issue on the GitHub repository.