PHPackages                             chromehive/yflite - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. chromehive/yflite

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chromehive/yflite
=================

YFlite - Faster PHP development for newbies

1.4.0(5mo ago)026MITPHPPHP &gt;=7.4

Since Nov 11Pushed 5mo agoCompare

[ Source](https://github.com/chromehive/yflite)[ Packagist](https://packagist.org/packages/chromehive/yflite)[ Docs](https://github.com/chromehive/yflite)[ RSS](/packages/chromehive-yflite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

YFlite CLI
==========

[](#yflite-cli)

A PHP scaffolding tool for rapid application development using YFlite, a lightweight PHP microframework.

Features
--------

[](#features)

- Generate pages with layout support
- CRUD scaffolding with model, controller and views
- Form field generation with validation
- Route management
- Models with basic database operations

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

[](#installation)

You can install it globally on your computer if you have the PHP environment with composer installed.

```
composer global require chromehive/yflite
```

Developer Quickstart
--------------------

[](#developer-quickstart)

After installing via Composer, run the command below to see if YFlite installed properly

```
yflite -v
```

Does it show you the version number? Then, YFlite is available to you? Now, let's open or create a fresh directory and run this code in the terminal for that directory once to set up your development project.

```
yflite new
```

If you want to have the project initialise in a fresh project directory and run:

```
yflite new
```

For example: `yflite new fire-app-project`

Usage
-----

[](#usage)

Start the development server using:

```
yflite start
```

If you used `yflite new ` to initialise your project, then you need to switch to that directory first.

```
cd
yflite start
```

To compile your production-ready build:

```
yflite build --dest=
```

To compile your production-ready build in zip format:

```
yflite build --dest= --zip
```

If the name of the build folder is omitted along with the `--dest` flag, the default `/dist` folder or `dist.zip` will be created automatically in the project root directory.

Typical Folder/File Structure
-----------------------------

[](#typical-folderfile-structure)

```
/
├── app/
│   ├── _core/
│   ├── configs/
│   │   ├── index.php  # Modifiable Configurations File
│   │   └── route_aliases.php
│   ├── controllers/
│   │   └── public.php  # Controls some non-dashboard pages
│   ├── helpers/
│   ├── middlewares/
│   ├── models/
│   ├── routes/
│   └── views/
│       ├── components/
│       ├── layouts/
│       │   ├── dashboard.php
│       │   └── main.php
│       └── pages/
│           ├── 404.php
│           └── home.php
├── vendor/
├── public/
│   ├── assets/
│   │   ├── css/
│   │   └── js/
│   ├── index.php    # Server entry point
│   ├── robots.txt
│   └── sitemap.txt
├── storage/
│   ├── cache/
│   └── logs/
├── tests/
├── composer.json
├── path.php    # Modifiable Path Constants File
└── README.md
```

The YFlite CLI provides several generators:

### Generate Pages

[](#generate-pages)

```
# Single page
yflite make:page dashboard

# Multiple pages
yflite make:page home about contact

# Nested page (creates folders+files)
yflite make:page policies settings/profile settings/notifications
```

### Generate CRUD

[](#generate-crud)

```
# Basic CRUD
yflite make:crud Product

# CRUD with fields
yflite make:crud Product --fields="title:string,price:decimal,description:text"
```

### Generate Model

[](#generate-model)

```
# Basic model
yflite make:model User

# Model with custom table
yflite make:model User --table=users
```

### Add Route

[](#add-route)

```
yflite make:route GET /api/data api:data
```

Route Regex Examples for URI Parameters
---------------------------------------

[](#route-regex-examples-for-uri-parameters)

Here are a few essential regex patterns and their aliases you may need if you wish to validate URI parameters from client. Feel free to make your own patterns if necessary. You can also add custom aliases by define your patterns as accurately as possible in the `/configs/route_aliases.php`.

Use CaseAliasPatternExample URINumber or Numeric ID:id or :int`(\d+)``/users/42`Slug:slug`([a-zA-Z0-9-_]+)``/posts/hello-world`Username:username`([a-zA-Z0-9_]+)``/profile/hello123_`UUID:uuid`([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})``/chat/123e4567-e89b-12d3-a456-426614174000`Y-m-D Date:date`([0-9]{4}-[0-9]{2}-[0-9]{2})``/orders/2025-11-09`Alpha word:alpha`([A-Za-z]+)``/category/books`Alphanumeric:alphanum`([A-Za-z0-9]+)``/category/101Books`Catch-all (no slash):any`([^/]+)``/anything/value`Example Use of Default Regex Patterns or Aliases Available.

```
return [
    ['GET', '/posts/:slug', 'blog:post_view'],
    ['GET', '/@([a-zA-Z0-9_]+)', 'user:profile'],
];
```

Normal route format:

```
    ['METHOD', '/route', 'ctrlrfile:function'],
```

Routes with middleware(s):

```
    ['METHOD', '/route', 'ctrlrfile:function', 'mwfile1:mwfunc1, mwfile2:mwfunc2'],
```

Only In Versions &gt;= v1.4.0
-----------------------------

[](#only-in-versions--v140)

Our YUI component library is available to you. Just call the yui() php function, pass the name of the component with props in `[]` and full blocks of components will get rendered from the `components/yui` views folder to aid your fast development. See the examples below. Note that the default props are `slot` (the children entities), `class` (the default parent classes which you can overwrite) and `extras` (which is any attributes you want placed to the parent component).

```
