PHPackages                             strifejeyz/framework - 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. strifejeyz/framework

ActiveProject[Framework](/categories/framework)

strifejeyz/framework
====================

A Fast and Lightweight PHP MVC Framework.

1.5(1y ago)461[2 issues](https://github.com/strifejeyz/framework/issues)MITPHPPHP &gt;= 7.0

Since Oct 25Pushed 1y ago5 watchersCompare

[ Source](https://github.com/strifejeyz/framework)[ Packagist](https://packagist.org/packages/strifejeyz/framework)[ RSS](/packages/strifejeyz-framework/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (1)Versions (7)Used By (0)

Strife PHP Framework Documentation
==================================

[](#strife-php-framework-documentation)

Introduction
------------

[](#introduction)

Strife is a fast and lightweight PHP MVC framework designed to simplify web application development. It provides powerful tools and features for building robust and maintainable applications.

Features
--------

[](#features)

- **Smart Routing**: Flexible and intuitive routing for handling HTTP requests.
- **Multi-Database Support**: Compatible with various database systems.
- **Query Builder**: Simplifies database interactions.
- **Form Builder**: Easy generation and validation of forms.
- **Migration Management**: Manage database schema changes effortlessly.
- **Encryption &amp; Caching**: Built-in tools for secure and optimized applications.
- **Built-in CLI**: Command-line tools for rapid development.
- **Template Engine**: For clean and maintainable HTML views.

Requirements
------------

[](#requirements)

- PHP 7.0 or higher
- A web server (e.g., Apache or Nginx)
- Composer (for dependency management)

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

[](#installation)

1. Clone the repository: ```
    git clone https://github.com/strifejeyz/framework.git
    ```
2. Navigate to the project directory: ```
    cd framework
    ```
3. Install dependencies: ```
    composer install
    ```

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

[](#directory-structure)

```
/
├── app/
├── kernel/
├── storage/
├── vendor/
├── .gitignore
├── .htaccess
├── composer.json
├── composer.lock
├── favicon.ico
├── index.php
├── LICENSE
├── readme.md
└── yamato

```

Usage
-----

[](#usage)

### Routing

[](#routing)

Define routes in `app/routes.php`:

```
get('/users', 'UsersController@index');
post('/store', 'UsersController@store');
```

- `'/users'`: The route endpoint.
- `UsersController@index`: The class name and method to call.

You can use either `get()` or `post()` when defining routes.

To assign a name to a route, use the following syntax:

```
get('users-list -> /users', 'UsersController@index');
```

If **File-based routing** is enabled, the `app/routes.php` file is ignored. Instead, you can directly call a class and method. For example, if `UsersController` is the class name and `index` is the method, you can invoke the endpoint `/users/index`. This accommodates any HTTP request method.

### Controllers

[](#controllers)

Create controllers in the `app/controllers` directory:

```
use App\Models\User;

class HomeController
{
    public function index()
    {
        $title = "Home Page";
        $users =  User::get();
        return render('index', compact('title','users'));
    }
}
```

### Models

[](#models)

Define models in the `app/models` directory:

```
use Kernel\Database\QueryBuilder as Model;

class User extends Model
{
    protected static $table = "users";
}
```

### Views

[](#views)

Place your templates in `app/views`:

```
>

    {{ $title }}

   {{foreach($users as $user)}}
   {{$user->firstname}}
   {{endforeach}}

```

### Template Engine

[](#template-engine)

The Strife PHP Framework includes a powerful template engine for building clean and maintainable views.

#### Extending and Rendering Templates

[](#extending-and-rendering-templates)

- **`@extend('template_name')`**: Extends a base template.
- **`@render('template_name')`**: Renders a specified template.

#### Section Management

[](#section-management)

- **`@stop()`**: Marks the end of an extended layout/template.
- **`@get('section_name')`**: Similar behavior to include().

### Importing and Conditionals

[](#importing-and-conditionals)

- **`@import('app\models\Users')`**: Imports a class
- **`{{if(condition)}} ... {{endif}}`**: Executes the enclosed code block if the condition is true.
- **`{{elseif(condition)}} ... {{endelseif}}`**: Checks an alternative condition.
- **`{{else}}`**: Runs an alternative block if the `if` condition fails.
- **`{{endif}}`**: Marks the end of an `if` block.

#### Loops and Iterations

[](#loops-and-iterations)

- **`{{for(condition)}} ... {{endfor}}`**: Runs a block of code a specified number of times.
- **`{{do(condition)}} ... {{enddo}}`**: Executes the enclosed block once.
- **`{{while(condition)}} ... {{endwhile}}`**: Loops while the condition is true.
- **`{{foreach(condition)}} ... {{endforeach}}`**: Iterates over an array or object.

### Example Usage

[](#example-usage)

#### Extending a Template

[](#extending-a-template)

```
@extend('layouts/frontend')

Welcome back, user!

@stop
```

#### Conditional Rendering

[](#conditional-rendering)

```
{{if($userIsLoggedIn)}}
    Welcome back, user!
{{else}}
    Please log in.
{{endif}}
```

#### Loop Example

[](#loop-example)

```
{{foreach($items as $item)}}
    {{ $item }}
{{endforeach}}
```

Use these functions to build flexible and dynamic views efficiently.

### Query Builder

[](#query-builder)

This guide explains how to use the most common methods in the Query Builder class for running queries.

#### `where`

[](#where)

Filters results based on a condition.

```
$query = Users::where('column_name', '=', 'value');
```

- **Parameters**:
    - `field`: The column to filter.
    - `a`: The comparison operator (e.g., `=`).
    - `b`: The value to compare against.

#### `join`

[](#join)

Performs an inner join with another table.

```
$query = Users::join('another_table')->on('table.id = another_table.foreign_id');
```

- **Parameters**:
    - `table`: The table to join.
- **Chaining**:
    - Use `on` to specify the join condition.

#### `get`

[](#get)

Fetches the results of the query.

```
$results = Users::get();
```

- **Parameters**:
    - `fetchMode` (optional): Defaults to `PDO::FETCH_OBJ`.

#### `select`

[](#select)

Specifies the columns to retrieve.

```
$query = Users::select(['column1', 'column2']);
```

- **Parameters**:
    - `selection`: An array of column names to select.

#### `order`

[](#order)

Sorts the results.

```
$query = Users::order('column_name', 'ASC');
```

- **Parameters**:
    - `field`: The column to sort by.
    - `order`: `ASC` for ascending or `DESC` for descending.

#### `limit`

[](#limit)

Limits the number of results.

```
$query = Users::limit(10, 5);
```

- **Parameters**:
    - `number`: The maximum number of results.
    - `offset` (optional): The starting point for the results.

#### `first`

[](#first)

Fetches the first result of the query.

```
$firstResult = Users::first();
```

#### `count`

[](#count)

Counts the number of results.

```
$total = Users::count();
```

#### Example Usage

[](#example-usage-1)

Here is an example combining some of these methods:

```
$results = Users::select(['id', 'name'])
    ->where('status', '=', 'active')
    ->order('created_at', 'DESC')
    ->limit(10)
    ->get();
```

### Database Migrations

[](#database-migrations)

Generate a migration:

```
php yamato create:migration create_users_table
```

Edit the migration file and run:

```
php yamato db:migrate
```

Command-Line Interface (CLI)
----------------------------

[](#command-line-interface-cli)

Use Yamato CLI for various tasks:

```
php yamato
```

### Common Commands

[](#common-commands)

#### Cleanup

[](#cleanup)

- `php yamato clear:logs`: Clear logs directory.
- `php yamato clear:cache`: Clear cached pages.
- `php yamato clear:all`: Clear all backups, logs, and cache.

#### Generators

[](#generators)

- `php yamato create:model [name] [table=null]`: Create a model class.
- `php yamato create:controller [name] [empty=bool]`: Create a controller class.
- `php yamato create:migration [name] [table]`: Create a migration class.
- `php yamato create:request [name]`: Create a request class.
- `php yamato create:key`: Generate an application key.

#### Database

[](#database)

- `php yamato db:migrate`: Install all migrations.
- `php yamato db:rollback`: Rollback all migrations.
- `php yamato db:backup`: Backup table data into a JSON file.
- `php yamato db:restore`: Restore the last made backup.
- `php yamato db:seed`: Perform database seeding.

#### Security

[](#security)

- `php yamato hash:encode [string]`: Returns the hash of a given string.
- `php yamato encryption:encode [string] [level=1]`: Encrypt a string.
- `php yamato encryption:decode [string] [level=1]`: Decrypt a string.

Contributing
------------

[](#contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Submit a pull request with a detailed description of your changes.

License
-------

[](#license)

Strife is open-source software licensed under the [MIT License](LICENSE).

Support
-------

[](#support)

For questions or support, please open an issue on [GitHub](https://github.com/strifejeyz/framework/issues).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.5% 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 ~589 days

Total

4

Last Release

521d ago

PHP version history (2 changes)1.3.x-devPHP &gt;=5.6.14

1.5PHP &gt;= 7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d0669d01c4c5b4b5d0e2804b8d84839d92a9b364c28e6a3f561e24c86a9da54?d=identicon)[strifejeyz](/maintainers/strifejeyz)

---

Top Contributors

[![strifejeyz](https://avatars.githubusercontent.com/u/28667850?v=4)](https://github.com/strifejeyz "strifejeyz (224 commits)")[![jesse-frc](https://avatars.githubusercontent.com/u/68064275?v=4)](https://github.com/jesse-frc "jesse-frc (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

mvc-architecturemvc-frameworkoopphpphp-7pretty-urlsstrifestrife-frameworktemplate-engineframeworkmvcradOOPstrife

### Embed Badge

![Health badge](/badges/strifejeyz-framework/health.svg)

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

PHPackages © 2026

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