Download the PHP package arforayejibd/oneweb without Composer
On this page you can find all versions of the php package arforayejibd/oneweb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arforayejibd/oneweb
More information about arforayejibd/oneweb
Files in arforayejibd/oneweb
Package oneweb
Short Description An HTML-first template engine and micro-framework in PHP
License MIT
Informations about the package oneweb
OneWeb - HTML-First PHP Template Engine & Micro-Framework (v1.0.7)
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
- 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
<form>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
<one-*>component tags for grids, badges, cards, alerts, and inputs styled with modern Tailwind CSS layouts. - Nested Layouts & Sections: Build clean page structures using
@layout,@section, and@yield.
Installation
1. Create a New Project
Run the following command to download the framework skeleton and set up your project in the current directory:
2. Start the Local Server
Start the local development server using one of the following commands:
Cross-platform (recommended):
(Or composer start)
Or using shortcuts:
- Windows:
start oneorrun one - macOS/Linux:
./start oneor./run one(Make sure to runchmod +x start runfirst)
This command will automatically:
- Start the server at
http://localhost:8000 - Create a
public/directory with a defaultindex.onehomepage if it doesn't exist. - Configure
.vscode/settings.jsonto enable HTML syntax highlighting for*.onetemplates in VS Code. - Generate your database configuration
config.oneand the SQLite databaseoneweb.sqlitein the project root.
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):
Or using shortcuts:
- Windows:
run one update(orstart one update) - macOS/Linux:
./run one update(or./start one update)
Directory Structure
A typical OneWeb application structure:
Quick Start
1. Database Configuration (config.one)
Define your database configuration in a config.one file in your root folder:
Or for MySQL:
2. Variable Interpolation
3. Conditionals & Loops
4. Database Queries (@query)
Fetch data directly inside your templates:
To fetch a single record:
5. Declarative Forms (@insert, @update, @delete)
Perform safe database CRUD operations with zero server-side handler code:
6. Declarative Authentication (@login, @logout, @auth, @guest)
Authenticate users securely on the server with zero boilerplate. Define a database table containing username (or email) and a password column (which can contain a plain password or a password_hash()).
Conditional Authentication Checks:
Show/hide UI elements using @auth and @guest blocks:
Declarative Authentication Forms:
Use the @login and @logout attributes inside forms to manage server sessions:
7. Layouts & Partials (@layout, @section, @yield, @include)
Layout file (layouts/main.one):
Page file (dashboard.one):
Built-in UI Components (<one-*>)
OneWeb ships with a modern, modular UI component registry that generates standard CSS-styled layout elements:
<one-container max-width="7xl">: Wraps content in a responsive, centered container.<one-grid cols="3" gap="6">: Sets up a responsive flex/grid structure.<one-card title="..." price="..." badge="..." badge-variant="...">: Modern cards with content slots.<one-button type="..." href="...">: Styled buttons (primary,secondary,success,danger,outline).<one-badge variant="...">: Custom badges (purple,success,warning,danger,info). Includes a pulse animation dot.<one-alert type="...">: Standard alerts.<one-input name="..." label="..." type="..." placeholder="...">: Form inputs with label styling.
Example component composition:
License
This package is open-sourced software licensed under the MIT License.