{"id":17774124,"url":"https://github.com/zenithphp-framework/full-zenith-framework","last_synced_at":"2026-02-18T05:01:09.809Z","repository":{"id":259262905,"uuid":"877438326","full_name":"ZenithPHP-Framework/full-zenith-framework","owner":"ZenithPHP-Framework","description":"A simple and lightweight PHP framework designed to streamline web application development","archived":false,"fork":false,"pushed_at":"2024-11-03T17:39:45.000Z","size":614,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T13:44:07.838Z","etag":null,"topics":["framework","mvc","mvc-framework","php","php8","zenithphp","zenithphp-framework"],"latest_commit_sha":null,"homepage":"https://zenithphp-framework.github.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZenithPHP-Framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-23T16:43:52.000Z","updated_at":"2025-01-18T07:32:37.000Z","dependencies_parsed_at":"2024-12-14T09:10:20.833Z","dependency_job_id":"3245592f-7a70-4597-b9ff-b506f48388d8","html_url":"https://github.com/ZenithPHP-Framework/full-zenith-framework","commit_stats":null,"previous_names":["zenithphp-framework/full-zenith-framework"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ZenithPHP-Framework/full-zenith-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithPHP-Framework%2Ffull-zenith-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithPHP-Framework%2Ffull-zenith-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithPHP-Framework%2Ffull-zenith-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithPHP-Framework%2Ffull-zenith-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZenithPHP-Framework","download_url":"https://codeload.github.com/ZenithPHP-Framework/full-zenith-framework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithPHP-Framework%2Ffull-zenith-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29569853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","mvc","mvc-framework","php","php8","zenithphp","zenithphp-framework"],"created_at":"2024-10-26T21:49:48.684Z","updated_at":"2026-02-18T05:01:09.781Z","avatar_url":"https://github.com/ZenithPHP-Framework.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/ab329545-9c44-4e85-aabe-6f4dc0f0512c\" alt=\"icon-192\" width=\"192\" height=\"192\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eZenithPHP\u003c/h1\u003e\n\nWelcome 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.\n\n## Official Documentation\nYou 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.\n\n## Features\n\n- **MVC Architecture**: Keeps code organized by separating the business logic, presentation, and data layers.\n- **Custom Routing**: Define clean and flexible routes for your application with ease.\n- **Simple Namespacing**: Eliminate the need for `require_once` with proper namespacing.\n- **Security Built-in**: Features like password hashing and input validation to keep your app secure.\n- **Easy to Extend**: Customize the framework to suit your application’s needs with minimal effort.\n- **Pluto Template Engine**: Simplifies view rendering with a clean syntax and powerful directives.\n\n## Installation\n\nTo get started with ZenithPHP, follow the instructions below:\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/ZenithPHP-Framework/full-zenith-framework.git\n    ```\n\n2. Navigate to the project directory:\n    ```bash\n    cd full-zenith-framework\n    ```\n\n3. Install dependencies using Composer:\n    ```bash\n    composer install\n    ```\n\n4. Configure your environment:\n    - Create a copy of the `.env.example` file and rename it to `.env`.\n    - Set your database credentials and other necessary configurations.\n\n5. Start your local development server:\n    ```bash\n    php cli run\n    ```\n\n6. Visit `http://localhost:8000` in your browser to see the landing page.\n\n## Folder Structure\n\n- **App/**: Contains the core application files.\n- **Config/**: Configuration files like CORS for the application.\n- **Core/**: The framework's core classes and functions.\n- **View/**: Contains all view files (HTML/PHP templates).\n- **Public/**: The main entry point for the application and assets (JS, CSS, images).\n- **.env**: Environment variables for the application.\n- **.env.example**: Example environment variables file.\n- **composer.json**: Composer dependencies file.\n- **cli**: Command-line interface for running the application and creating models and controllers.\n\n## How to Get Started\n\nTo create your first route:\n\n1. Open `App/routes.php` and define your route:\n    ```php\n    use ZenithPHP\\Core\\Http\\Router;\n    Router::get('/hello', 'WelcomeController', 'index');\n    ```\n\n2. Create a new controller (*WelcomeController.php*) inside `App/Controllers/`:\n    ```php\n    use ZenithPHP\\Core\\Controller\\Controller;\n\n    class WelcomeController extends Controller\n    {\n        public function index()\n        {\n            $this-\u003eview('welcome');\n        }\n    }\n    ```\n\n3. Now, create a new view file inside `View/welcome.php`:\n    ```html\n    \u003ch1\u003eWelcome to ZenithPHP\u003c/h1\u003e\n    ```\n\n4. Visit `http://localhost:8000/welcome` to see the result.\n\n## Working with APIs\n\nNow you can create APIs with ZenithPHP. Here's how you can create a simple API:\n\n1. First, create a new route in `App/routes.php`:\n    ```php\n    use ZenithPHP\\Core\\Http\\Router;\n    Router::get('/api/users', 'UserController', 'index');\n    ```\n\n2. Create a new model using the CLI tool:\n    ```bash\n    php cli make:model User\n    ```\n\n3. Implement the model method to fetch data from the database:\n    ```php\n    use ZenithPHP\\Core\\Model\\Model;\n\n    class User extends Model\n    {\n        protected string $table_name = 'users';\n    }\n    ```\n\n4. Create a new controller. For that, you can use the CLI tool:\n    ```bash\n    php cli make:controller UserController\n    ```\n\n5. Implement the controller method to return JSON data:\n    ```php\n    use ZenithPHP\\Core\\Controller\\Controller;\n    use ZenithPHP\\Core\\Http\\Response;\n    use ZenithPHP\\Core\\Http\\Request;\n    use ZenithPHP\\App\\Models\\User;\n\n    class UserController extends Controller\n    {\n        public function index(Request $request, Response $response)\n        {\n            $user = new User($this-\u003epdo);\n            $allUsers = $user-\u003egetAll();\n            $response-\u003ejson(['status' =\u003e 'success', 'data' =\u003e $allUsers]);\n        }\n    }\n    ```\n\n6. Visit `http://localhost:8000/api/users` to see the JSON response.\n\n\n## Pluto Template Engine\n\nThe **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:\n\n### Pluto Syntax\n\n- **Variable Output**: Use `\u003c\u003c $variable \u003e\u003e` to output PHP variables in the view.\n- **Conditional Statements**: Pluto offers `@if`, `@elseif`, `@else`, and `@endif` directives for conditional rendering.\n- **Looping**: Use `@foreach` and `@endforeach` to iterate over collections.\n- **Comments**: Use `\u003c\u003c// \u003e\u003e` to add comments in your templates.\n- **Yielding Sections**: Use `@yield` to define a section that will be replaced with content from child templates.\n- **Section Definition**: Use `@section` to define a section that can be filled in child templates.\n\n### Example Syntax\n`HomeController.php`\n```php\nclass HomeController extends Controller \n{\n    public function index(Request $request, Response $response)\n    {\n        return view('home', [\n            'username' =\u003e 'John Doe',\n            'userRole' =\u003e 'admin',\n            'items' =\u003e [\n                (object) ['name' =\u003e 'Laptop', 'price' =\u003e '$999'],\n                (object) ['name' =\u003e 'Smartphone', 'price' =\u003e '$499'],\n            ]\n        ]);\n    }\n}\n```\n`home.pluto.php`\n```php\n\u003c!-- Displaying a variable --\u003e\n\u003c\u003c $username \u003e\u003e\n\n\u003c!-- Conditional Statement --\u003e\n@if ($userRole == 'admin')\n  \u003cp\u003eWelcome, Admin!\u003c/p\u003e\n@elseif ($userRole == 'member')\n  \u003cp\u003eWelcome, Member!\u003c/p\u003e\n@else\n  \u003cp\u003eWelcome, Guest!\u003c/p\u003e\n@endif\n\n\u003c!-- Looping Through Data --\u003e\n@foreach ($items as $item)\n  \u003cp\u003e\u003c\u003c $item-\u003ename \u003e\u003e - \u003c\u003c $item-\u003eprice \u003e\u003e\u003c/p\u003e\n@endforeach\n```\n\n## Security Features\n\n- **Password Hashing**: Built-in password hashing methods for user authentication.\n- **Input Validation**: Functions to validate and sanitize user inputs.\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature/bugfix.\n3. Submit a pull request with a clear description of your changes.\n\n## License\n\nZenithPHP is open-source and licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n---\n\nBuilt with ❤️ by [Dasun Nethsara](https://techsaralk.epizy.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithphp-framework%2Ffull-zenith-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenithphp-framework%2Ffull-zenith-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithphp-framework%2Ffull-zenith-framework/lists"}