PHPackages                             hillzacky/rute-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. hillzacky/rute-php

ActiveLibrary[Framework](/categories/framework)

hillzacky/rute-php
==================

A simple PHP routing library with middleware, rate limiting, authentication, and static file handling.

00PHP

Since Mar 16Pushed 6d ago1 watchersCompare

[ Source](https://github.com/Hillzacky/rute-php)[ Packagist](https://packagist.org/packages/hillzacky/rute-php)[ RSS](/packages/hillzacky-rute-php/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

rute-php
========

[](#rute-php)

A simple PHP routing library with middleware, rate limiting, authentication, and static file handling. Library ini adalah implementasi sederhana dari sebuah router dan sistem tampilan (view) untuk aplikasi PHP. Didesain untuk memudahkan pengelolaan rute HTTP dan rendering tampilan menggunakan layout dan fragment. Dengan pendekatan berbasis statis, library ini menyediakan cara yang fleksibel dan sederhana untuk menangani rute dan tampilan.

🚀 Fitur Utama
-------------

[](#-fitur-utama)

- **Routing Sederhana**: Mendukung metode GET, POST, PUT, DELETE dengan dukungan middleware.
- **View Engine**: Sistem templating dengan dukungan layout dan fragment (header/footer).
- **Middleware Built-in**: Log request, Rate Limiting, dan Autentikasi dasar.
- **Static File Handler**: Memudahkan penyajian aset seperti CSS, JS, dan Gambar.
- **PSR-4 Compliant**: Mudah diintegrasi dengan Composer.

📦 Instalasi
-----------

[](#-instalasi)

Instal library ini melalui Composer:

```
composer require hillzacky/rute-php
```

Struktur Folder Rekomendasi
---------------------------

[](#struktur-folder-rekomendasi)

```
your-project/
├── public/
│   └── index.php
├── views/
│   ├── layouts/
│   ├── fragments/
│   └── home.php
├── vendor/
└── composer.json
└── index.php

```

Penggunaan
----------

[](#penggunaan)

### Menyiapkan Route

[](#menyiapkan-route)

Untuk menggunakan rute, pertama-tama Anda harus mendefinisikan rute HTTP yang dapat diproses:

```
use Hillzacky\Route;
use Hillzacky\View;
use Hillzacky\Utils;

Route::use([Utils::class, 'logReq']);  // Middleware global
Route::use([Utils::class, 'auth']);    // Middleware untuk autentikasi

Route::get('/home', function() {
    $data = [
        'title' => 'Halaman Utama',
        'body' => 'Selamat datang di halaman utama kami!'
    ];

    // Render tampilan dengan layout
    View::render('home', $data)->layout('default');
});
```

### Menambahkan Middleware

[](#menambahkan-middleware)

Middleware digunakan untuk memfilter request, baik secara global ataupun per route.

```
// Middleware Global
Route::use([Utils::class, 'logReq']);  // Logging request
Route::use([Utils::class, 'rateLim']); // Pembatasan permintaan

// Middleware untuk Route Tertentu
Route::get('/admin', function() {
    // Route admin hanya bisa diakses oleh pengguna yang sudah login
    Route::use([Utils::class, 'authz'], 'admin');

    // Render tampilan
    $data = ['message' => 'Selamat datang di dashboard admin!'];
    View::render('admin_dashboard', $data)->layout('admin');
});
```

### Fungsi Utama

[](#fungsi-utama)

Route::get(): Menangani permintaan HTTP GET.

Route::post(): Menangani permintaan HTTP POST.

Route::put(): Menangani permintaan HTTP PUT.

Route::delete(): Menangani permintaan HTTP DELETE.

Route::patch(): Menangani permintaan HTTP PATCH.

Route::head(): Menangani permintaan HTTP HEAD.

Route::options(): Menangani permintaan HTTP OPTIONS.

### Lisensi

[](#lisensi)

Distribusi ini dilisensikan di bawah lisensi MIT. Lihat file LICENSE untuk informasi lebih lanjut.

###  Health Score

20

↑

LowBetter than 16% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd9262e64e1695fe615b3d00827868fd3868d21af0b5b61dd7f22f72ba2b4c5b?d=identicon)[Hillzacky](/maintainers/Hillzacky)

---

Top Contributors

[![Hillzacky](https://avatars.githubusercontent.com/u/13527080?v=4)](https://github.com/Hillzacky "Hillzacky (13 commits)")

### Embed Badge

![Health badge](/badges/hillzacky-rute-php/health.svg)

```
[![Health](https://phpackages.com/badges/hillzacky-rute-php/health.svg)](https://phpackages.com/packages/hillzacky-rute-php)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k65.4M157](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k11.6M75](/packages/spiral-roadrunner)[composer/installers

A multi-framework Composer library installer

1.4k133.5M5.5k](/packages/composer-installers)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k35.9M224](/packages/laravel-dusk)[laravel/fortify

Backend controllers and scaffolding for Laravel authentication.

1.7k38.8M191](/packages/laravel-fortify)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.0M102](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
