PHPackages                             bar/babarcode - 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. bar/babarcode

ActiveLibrary[Framework](/categories/framework)

bar/babarcode
=============

BabarCode adalah super micro framework yang dapat membantu Anda membuat aplikasi web dan API dengan mudah dan cepat. Hanya dengan beberapa langkah mudah, aplikasi Anda dapat berjalan!

011[1 PRs](https://github.com/jyat182/BabarCode/pulls)PHP

Since Feb 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jyat182/BabarCode)[ Packagist](https://packagist.org/packages/bar/babarcode)[ RSS](/packages/bar-babarcode/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

BabarCode beta 1.1
==================

[](#babarcode-beta-11)

BabarCode adalah super micro framework yang dapat membantu Anda membuat aplikasi web dan API dengan mudah dan cepat. Hanya dengan beberapa langkah mudah, aplikasi Anda dapat berjalan!

**1. Load Framework**

```
require 'system/babar.php';
use system\Babar;
```

**2. Daftarkan Route**

```
Babar::route('/',function(){
   echo 'Hello World!';
});
Babar::route('/test',function(){
   echo 'This is test page!';
});

```

**3. Jalankan Aplikasi**

```
Babar::run();
```

**4. .htaccess**

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
```

Buka halaman `localhost/babarcode` dari browser. Voila!

**Via Composer**

```
composer require bar/babarcode dev-master
```

**Request Helper**

Load Request Helper ```
use system\helper\Request;
```

GET Parameter

```
// Check if request is GET or not
Request::is_get(); // true or false

 // All GET Parameters (Array)
Request::get();

// Spesific GET Parameter
// Ex: domain.com/whatever?id=123
Request::get('id'); // result => 123
```

POST Parameter

```
// Check if request is POST or not
Request::is_post(); // true or false

 // All POST Parameters (Array)
Request::post();

// Spesific POST Parameter
Request::post('id');
```

SERVER Variable

```
// All SERVER Parameters (Array)
Request::server();

// Spesific SERVER Parameter
Request::server('SERVER_NAME');
```

HEADER Variable

```
// All HEADER Parameters (Array)
Request::header();

// Spesific HEADER Parameter
Request::header('User-Agent');
```

URI Segment

```
// All URI Segements (Array)
Request::uri_segment();

// Spesific URI Segment
// Ex: domain.com/articles/2017/02/whatever-articles-title
Request::uri_segment(2); // return => 2017
```

**JSON Helper**

Load JSON Helper ```
use system\helper\Json;
```

Encode Decode

```
// Encode
Json::encode('your text or array here');

// Decode
Json::decode('your text or array json encoded here');
```

**View Helper**

Load View Helper ```
use system\helper\View;
```

Set View Path

```
// Ex: ```
view/
``` is your view path
View::set_path('view/');
```

Render View

```
// Render view without passing parameter
// Ex: ```
sampleview.php
``` is your view
View::render('sampleview');

// Render view with passing parameter
// Ex: ```
sampleview.php
``` is your view
$data['product_id'] = 15;
$data['product_title'] = 'Whatever Product';
View::render('sampleview',$data);

// Accessing Parameter in view
 // return => 15
 // return => Whatever Product
```

**Database**

Database Support: MySQL &amp; SQL Server Database Driver:
MYSQL =&gt; `mysql`
SQL Server =&gt; `sqlsrv`

Load DB Class

```
use system\db\DB;
```

Setup Config

```
// Set Default DB Config
$config['database']['default'] = array(
  'host' => 'localhost',
  'db' => 'test',
  'user' => 'root',
  'password' => 'root',
  'port' => 3306,
  'driver' => 'mysql'
);

// Set another DB Config
$config['database']['second'] = array(
  'host' => 'localhost',
  'db' => 'test',
  'user' => 'sa',
  'password' => 'sa123',
  'driver' => 'sqlsrv'
);
```

Register Config

```
Babar::reg_config($config);
```

Read Config

```
$cfg = Babar::read_config('database');
```

Database Initialize

```
DB::init($cfg['default']); // Initialize For default
DB::init($cfg['second']); // Initialize For second
```

Fetch Data

```
// Fetch First Row of Data
$single = DB::query('SELECT * FROM user')->first();
// OR
$single = DB::query('SELECT * FROM user ORDER BY id DESC')->first();

// Fetch Multiple Rows Data
$list = DB::query('select * from user')->fetchAll();
```

Insert / Update / Delete Data

```
return => 0 / 1
$ok = DB::query("INSERT INTO user (nama) VALUES ('Fulana')")->result();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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/e549efdee39e6aff41d49cab07648eceab50465f73d1dd6e0e0020b08599c41a?d=identicon)[babarcode](/maintainers/babarcode)

---

Top Contributors

[![babarcode](https://avatars.githubusercontent.com/u/1808752?v=4)](https://github.com/babarcode "babarcode (15 commits)")

### Embed Badge

![Health badge](/badges/bar-babarcode/health.svg)

```
[![Health](https://phpackages.com/badges/bar-babarcode/health.svg)](https://phpackages.com/packages/bar-babarcode)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

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

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

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

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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