PHPackages                             arforayejibd/oneweb - 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. arforayejibd/oneweb

ActiveProject

arforayejibd/oneweb
===================

An HTML-first template engine and micro-framework in PHP

v1.0.6(today)022↑2900%MITHTMLPHP &gt;=8.0

Since Aug 24Pushed todayCompare

[ Source](https://github.com/arforayejibd/oneweb)[ Packagist](https://packagist.org/packages/arforayejibd/oneweb)[ RSS](/packages/arforayejibd-oneweb/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (8)Used By (0)

OneWeb - HTML-First PHP Template Engine &amp; Micro-Framework (v1.0.6)
======================================================================

[](#oneweb---html-first-php-template-engine--micro-framework-v106)

[![Version](https://camo.githubusercontent.com/8b83a61d6b738e6199769a0118e02a241162fced50670b5ad46cf149520a5df6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d76312e302e362d626c75652e737667)](https://github.com/arforayejibd/oneweb)[![Latest Stable Version](https://camo.githubusercontent.com/4c676df09c33896f2e2fdc3ceeca855134c0585fc2b4bdf1828cc8239c8a1d7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6172666f726179656a6962642f6f6e657765622e737667)](https://packagist.org/packages/arforayejibd/oneweb)[![Total Downloads](https://camo.githubusercontent.com/88c0d2b5ff38aafe4f2b6b78a3ea257d195ab234284ba7b5aea480ce55ce8dd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6172666f726179656a6962642f6f6e657765622e737667)](https://packagist.org/packages/arforayejibd/oneweb)[![License](https://camo.githubusercontent.com/abac222f468d3a59ab406d5cad6aead527cecd44ac85bdab53f4e853ecfe6e1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6172666f726179656a6962642f6f6e657765622e737667)](https://packagist.org/packages/arforayejibd/oneweb)

**OneWeb** is a lightweight, HTML-first template engine and micro-framework for PHP. It enables building dynamic web applications with declarative HTML, auto-escaping, direct database query blocks, zero-boilerplate forms, nested layouts, and a built-in modern UI component system.

---

Features
--------

[](#features)

- **HTML-First Syntax**: Keep templates clean and declarative. No more messy PHP tag soup.
- **Auto-XSS Protection**: Automatic HTML escaping on all variable interpolations (`{{ var }}`).
- **Declarative Database Queries**: Fetch data directly inside templates with `@query`.
- **Zero-Boilerplate Forms**: Execute database inserts, updates, and deletes directly from `` attributes with automatic validation and CSRF checks.
- **File-Based Routing**: Routing resolved automatically based on the directory hierarchy in your `public/` folder.
- **Built-in UI Component System**: Ready-to-use `` component tags for grids, badges, cards, alerts, and inputs styled with modern Tailwind CSS layouts.
- **Nested Layouts &amp; Sections**: Build clean page structures using `@layout`, `@section`, and `@yield`.

---

Installation
------------

[](#installation)

### 1. Create a New Project

[](#1-create-a-new-project)

Run the following command to download the framework skeleton and set up your project in the current directory:

```
composer create-project arforayejibd/oneweb ./
```

### 2. Start the Local Server

[](#2-start-the-local-server)

Start the local development server using one of the following commands:

**Cross-platform (recommended):**

```
composer run one
```

*(Or `composer start`)*

**Or using shortcuts:**

- **Windows:** `start one` or `run one`
- **macOS/Linux:** `./start one` or `./run one` *(Make sure to run `chmod +x start run` first)*

This command will automatically:

- Start the server at **`http://localhost:8000`**
- Create a `public/` directory with a default `index.one` homepage if it doesn't exist.
- Configure `.vscode/settings.json` to enable HTML syntax highlighting for `*.one` templates in VS Code.
- Generate your database configuration `config.one` and the SQLite database `oneweb.sqlite` in the project root.

### 3. Update the Framework

[](#3-update-the-framework)

To easily update the core framework files (engine and CLI runners) to the latest version, run one of the following commands:

**Cross-platform (recommended):**

```
composer run one update
```

**Or using shortcuts:**

- **Windows:** `run one update` (or `start one update`)
- **macOS/Linux:** `./run one update` (or `./start one update`)

---

Directory Structure
-------------------

[](#directory-structure)

A typical OneWeb application structure:

```
├── public/                 # Your public web root (routing resolves here)
│   ├── index.one           # Home page (resolves to /)
│   ├── test.one            # Test page (resolves to /test)
│   └── header.one          # Shared partials
├── config.one              # Database and application configuration
├── oneweb.sqlite        # Database file (if using SQLite)
└── vendor/                 # Composer dependencies

```

---

Quick Start
-----------

[](#quick-start)

### 1. Database Configuration (`config.one`)

[](#1-database-configuration-configone)

Define your database configuration in a `config.one` file in your root folder:

```
@db
    driver = "sqlite"
    database = "oneweb.sqlite"
@enddb
```

Or for MySQL:

```
@db
    driver = "mysql"
    host = "127.0.0.1"
    port = 3306
    dbname = "mywebsite"
    username = "root"
    password = "password"
    charset = "utf8mb4"
@enddb
```

### 2. Variable Interpolation

[](#2-variable-interpolation)

```

Hello, {{ user.name }}!

{!! post.content !!}
```

### 3. Conditionals &amp; Loops

[](#3-conditionals--loops)

```
@if user.balance > 0
    Available Balance: ৳{{ user.balance }}
@else
    No balance
@endif

@foreach products as product

        {{ loop.index }}. {{ product.name }}

@endforeach
```

### 4. Database Queries (`@query`)

[](#4-database-queries-query)

Fetch data directly inside your templates:

```
@query products from products where status = "active" order by id desc limit 10
@endquery

@foreach products as product
    {{ product.name }} - ৳{{ product.price }}
@endforeach
```

To fetch a single record:

```
@query user from users where id = {{ route.id }} first
@endquery

{{ user.name }}
```

### 5. Declarative Forms (`@insert`, `@update`, `@delete`)

[](#5-declarative-forms-insert-update-delete)

Perform safe database CRUD operations with zero server-side handler code:

```

    Add Product

    Update

    Delete

```

### 6. Layouts &amp; Partials (`@layout`, `@section`, `@yield`, `@include`)

[](#6-layouts--partials-layout-section-yield-include)

#### Layout file (`layouts/main.one`):

[](#layout-file-layoutsmainone)

```
>

    OneWeb Application

    @include "header"

        @yield "content"

```

#### Page file (`dashboard.one`):

[](#page-file-dashboardone)

```
@layout "main"

@section "content"
    Welcome to the Dashboard
@endsection
```

---

Built-in UI Components (``)
----------------------------------

[](#built-in-ui-components-one-)

OneWeb ships with a modern, modular UI component registry that generates standard CSS-styled layout elements:

- **``**: Wraps content in a responsive, centered container.
- **``**: Sets up a responsive flex/grid structure.
- **``**: Modern cards with content slots.
- **``**: Styled buttons (`primary`, `secondary`, `success`, `danger`, `outline`).
- **``**: Custom badges (`purple`, `success`, `warning`, `danger`, `info`). Includes a pulse animation dot.
- **``**: Standard alerts.
- **``**: Form inputs with label styling.

Example component composition:

```

    Page Overview
    Dashboard

            Your storefront traffic statistics.
            View Details

```

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT License](LICENSE).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance100

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100864029?v=4)[arforayejibd](/maintainers/arforayejibd)[@arforayejibd](https://github.com/arforayejibd)

---

Top Contributors

[![arforayejibd](https://avatars.githubusercontent.com/u/100864029?v=4)](https://github.com/arforayejibd "arforayejibd (25 commits)")

### Embed Badge

![Health badge](/badges/arforayejibd-oneweb/health.svg)

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

PHPackages © 2026

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