PHPackages                             dasunnethsara/zenithphp - 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. dasunnethsara/zenithphp

AbandonedArchivedProject[Framework](/categories/framework)

dasunnethsara/zenithphp
=======================

ZenithPHP is a lightweight PHP framework for MVC architecture, streamlining modern PHP web development.

v2.0.5(1y ago)181MITPHPPHP ^8.0

Since Oct 21Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ZenithPHP-Framework/framework)[ Packagist](https://packagist.org/packages/dasunnethsara/zenithphp)[ RSS](/packages/dasunnethsara-zenithphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (8)Used By (0)

 [![icon-192](https://private-user-images.githubusercontent.com/99202052/378293413-ab329545-9c44-4e85-aabe-6f4dc0f0512c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MDY0ODMsIm5iZiI6MTc3NTUwNjE4MywicGF0aCI6Ii85OTIwMjA1Mi8zNzgyOTM0MTMtYWIzMjk1NDUtOWM0NC00ZTg1LWFhYmUtNmY0ZGMwZjA1MTJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDIwMDk0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiMTU5MmIwMjk3NjY4MThlYTBhOTdlNDgzNWNlNWQ2OWZjNzcxY2NkMDRlOTk3MGNiMzM1OTFiZjliZDI0YzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UeAQMbcwvAzKnxX2FrKc0dD2hpp0BTbd-8P7jOqj-jM)](https://private-user-images.githubusercontent.com/99202052/378293413-ab329545-9c44-4e85-aabe-6f4dc0f0512c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MDY0ODMsIm5iZiI6MTc3NTUwNjE4MywicGF0aCI6Ii85OTIwMjA1Mi8zNzgyOTM0MTMtYWIzMjk1NDUtOWM0NC00ZTg1LWFhYmUtNmY0ZGMwZjA1MTJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA2VDIwMDk0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiMTU5MmIwMjk3NjY4MThlYTBhOTdlNDgzNWNlNWQ2OWZjNzcxY2NkMDRlOTk3MGNiMzM1OTFiZjliZDI0YzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UeAQMbcwvAzKnxX2FrKc0dD2hpp0BTbd-8P7jOqj-jM)

ZenithPHP
=========

[](#zenithphp)

Welcome to **ZenithPHP**, a simple and lightweight PHP framework designed to streamline web application development. ZenithPHP follows the MVC (Model-View-Controller) architecture and provides developers with a clean and flexible foundation to build modern PHP applications with ease.

Official Documentation
----------------------

[](#official-documentation)

You can find the official documentation for ZenithPHP at [ZenithPHP Documentation](https://zenithphp-framework.github.io/start.html). The documentation provides detailed information on how to get started with ZenithPHP, including installation instructions, routing, controllers, models, views, and more.

Features
--------

[](#features)

- **MVC Architecture**: Keeps code organized by separating the business logic, presentation, and data layers.
- **Custom Routing**: Define clean and flexible routes for your application with ease.
- **Simple Namespacing**: Eliminate the need for `require_once` with proper namespacing.
- **Security Built-in**: Features like password hashing and input validation to keep your app secure.
- **Easy to Extend**: Customize the framework to suit your application’s needs with minimal effort.
- **Pluto Template Engine**: Simplifies view rendering with a clean syntax and powerful directives.

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

[](#installation)

To get started with ZenithPHP, follow the instructions below:

1. Clone the repository:

    ```
    git clone https://github.com/ZenithPHP-Framework/full-zenith-framework.git
    ```
2. Navigate to the project directory:

    ```
    cd full-zenith-framework
    ```
3. Install dependencies using Composer:

    ```
    composer install
    ```
4. Configure your environment:

    - Create a copy of the `.env.example` file and rename it to `.env`.
    - Set your database credentials and other necessary configurations.
5. Start your local development server:

    ```
    php cli run
    ```
6. Visit `http://localhost:8000` in your browser to see the landing page.

Folder Structure
----------------

[](#folder-structure)

- **App/**: Contains the core application files.
- **Config/**: Configuration files like CORS for the application.
- **Core/**: The framework's core classes and functions.
- **View/**: Contains all view files (HTML/PHP templates).
- **Public/**: The main entry point for the application and assets (JS, CSS, images).
- **.env**: Environment variables for the application.
- **.env.example**: Example environment variables file.
- **composer.json**: Composer dependencies file.
- **cli**: Command-line interface for running the application and creating models and controllers.

How to Get Started
------------------

[](#how-to-get-started)

To create your first route:

1. Open `App/routes.php` and define your route:

    ```
    use ZenithPHP\Core\Http\Router;
    Router::get('/hello', 'WelcomeController', 'index');
    ```
2. Create a new controller (*WelcomeController.php*) inside `App/Controllers/`:

    ```
    use ZenithPHP\Core\Controller\Controller;

    class WelcomeController extends Controller
    {
        public function index()
        {
            $this->view('welcome');
        }
    }
    ```
3. Now, create a new view file inside `View/welcome.php`:

    ```
    Welcome to ZenithPHP
    ```
4. Visit `http://localhost:8000/welcome` to see the result.

Working with APIs
-----------------

[](#working-with-apis)

Now you can create APIs with ZenithPHP. Here's how you can create a simple API:

1. First, create a new route in `App/routes.php`:

    ```
    use ZenithPHP\Core\Http\Router;
    Router::get('/api/users', 'UserController', 'index');
    ```
2. Create a new model using the CLI tool:

    ```
    php cli make:model User
    ```
3. Implement the model method to fetch data from the database:

    ```
    use ZenithPHP\Core\Model\Model;

    class User extends Model
    {
        protected string $table_name = 'users';
    }
    ```
4. Create a new controller. For that, you can use the CLI tool:

    ```
    php cli make:controller UserController
    ```
5. Implement the controller method to return JSON data:

    ```
    use ZenithPHP\Core\Controller\Controller;
    use ZenithPHP\Core\Http\Response;
    use ZenithPHP\Core\Http\Request;
    use ZenithPHP\App\Models\User;

    class UserController extends Controller
    {
        public function index(Request $request, Response $response)
        {
            $user = new User($this->pdo);
            $allUsers = $user->getAll();
            $response->json(['status' => 'success', 'data' => $allUsers]);
        }
    }
    ```
6. Visit `http://localhost:8000/api/users` to see the JSON response.

Pluto Template Engine
---------------------

[](#pluto-template-engine)

The **Pluto** template engine in ZenithPHP allows you to easily build dynamic views with clean and readable syntax. Here’s a quick overview of its directives:

### Pluto Syntax

[](#pluto-syntax)

- **Variable Output**: Use `>` to output PHP variables in the view.
- **Conditional Statements**: Pluto offers `@if`, `@elseif`, `@else`, and `@endif` directives for conditional rendering.
- **Looping**: Use `@foreach` and `@endforeach` to iterate over collections.
- **Comments**: Use `>` to add comments in your templates.
- **Yielding Sections**: Use `@yield` to define a section that will be replaced with content from child templates.
- **Section Definition**: Use `@section` to define a section that can be filled in child templates.

### Example Syntax

[](#example-syntax)

`HomeController.php`

```
class HomeController extends Controller
{
    public function index(Request $request, Response $response)
    {
        return view('home', [
            'username' => 'John Doe',
            'userRole' => 'admin',
            'items' => [
                (object) ['name' => 'Laptop', 'price' => '$999'],
                (object) ['name' => 'Smartphone', 'price' => '$499'],
            ]
        ]);
    }
}
```

`home.pluto.php`

```

>

@if ($userRole == 'admin')
  Welcome, Admin!
@elseif ($userRole == 'member')
  Welcome, Member!
@else
  Welcome, Guest!
@endif

@foreach ($items as $item)
  name >> - price >>
@endforeach
```

Security Features
-----------------

[](#security-features)

- **Password Hashing**: Built-in password hashing methods for user authentication.
- **Input Validation**: Functions to validate and sanitize user inputs.

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

[](#contributing)

Contributions are welcome! To contribute:

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

License
-------

[](#license)

ZenithPHP is open-source and licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

---

Built with ❤️ by [Dasun Nethsara](https://techsaralk.epizy.com)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

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 ~4 days

Total

7

Last Release

549d ago

Major Versions

v1.0.1 → v2.0.02024-11-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/746bc0e165561a044f2df00816c909b3a46640be96dfa0c40789db0802eb191d?d=identicon)[DasunNethsara](/maintainers/DasunNethsara)

---

Top Contributors

[![DasunNethsara-04](https://avatars.githubusercontent.com/u/99202052?v=4)](https://github.com/DasunNethsara-04 "DasunNethsara-04 (50 commits)")

---

Tags

frameworkmvcmvc-frameworkphp8zenithphp

### Embed Badge

![Health badge](/badges/dasunnethsara-zenithphp/health.svg)

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

###  Alternatives

[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

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