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

ActiveLibrary[Framework](/categories/framework)

codemini/framework
==================

Mini framework PHP for small applications - Create fastly website or system with standard MVC structure

v1.4.0(5y ago)5241MITPHPPHP &gt;= 5.4

Since Jan 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/fabriciopolito/Codemini)[ Packagist](https://packagist.org/packages/codemini/framework)[ Docs](https://github.com/fabriciopolito/Codemini)[ RSS](/packages/codemini-framework/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

[![Codemini](https://camo.githubusercontent.com/f964deb3f4cd76b520852fd6375c32def0b2cccb02a864561e378730ccec8e5b/68747470733a2f2f692e6962622e636f2f44705a70426a422f636f64656d696e692e706e67)](https://camo.githubusercontent.com/f964deb3f4cd76b520852fd6375c32def0b2cccb02a864561e378730ccec8e5b/68747470733a2f2f692e6962622e636f2f44705a70426a422f636f64656d696e692e706e67)

Codemini
========

[](#codemini)

Mini PHP framework - Create quickly application with standard MVC structure.

*Leia na versão em português (pt-BR): [Português pt-BR](README.pt-br.md)*

**Why use Codemini?**

If you don't want to use a complex structure due to any reasons and don't want being tied down it, so Codemini is option for you.

Codemini is very simple to use, you can run your projet in `public` folder like Laravel, CodeIgniter 4 or if you are using shared host, just copy `index.php` and `.htaccess` from public folder into root folder and all things going to work well.

You can use easily other packages from Packagist.org into your project, just run `composer require /` and Codemini will understanding all packages that you have installed.

**Third party tools like WAMP or XAMPP**

As i sad above, if you are using shared host or using tools like WAMP or XAMPP, just copy `index.php` and `.htaccess` from public folder into root folder and all things going to work well.

**Example:**

1. Copy your project folder into `www` or `htdocs`
2. Copy `index.php` and `.htaccess` from public folder into root folder

> **Note:** Remove public folder if you want

**Why do it?**

Because when you are using tools like WAMP or XAMPP, the DocumentRoot of Apache is point to root folder www (WAMP) or htdocs (XAMPP) and not to public folder of framework.

This rule is valid not only for Codemini but CodeIgniter 4, Laravel etc. It is the way the frameworks works.

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

[](#requirements)

- Codemini works with PHP 5.4+. ✔️

Project structure
-----------------

[](#project-structure)

- cli-tools
- codemini\_tests.sql
- composer.json
- LICENSE
- **app/**
    - Controllers/
    - Models/
    - Views/
    - Config.php
    - Constants.php
    - Connection.php
    - Init.php
- **public/**
    - .htaccess
    - index.php
- **src/**
    - Core/
        - Bootstrap.php
        - Common.php
        - Controller.php
        - Model.php
        - Request.php
    - Libraries/
        - Input.php
        - Redirect.php
        - Session.php
        - Validator.php

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

[](#installation)

#### With Composer Creating Project

[](#with-composer-creating-project)

**1 -** If you want to install as composer project, run: `composer create-project --prefer-dist codemini/framework name-folder-of-you-project`

**2 -** Open terminal and run cli-tools: `php cli-tools serve`

**Optional:** Run with PHP built-in server, go to `public` folder and run: `php -S localhost:8080`

> **Note:** In this case it is not necessary to run composer install because the composer create-project already do it for you.

#### With Github

[](#with-github)

**1 -** If you want to install with **Git clone**, run: `git clone https://github.com/fabriciopolito/Codemini.git` or download "Download ZIP" and extract files.

**2 -** Run **Composer (required)** in root project folder where contain **composer.json** to create **autoload files**.

- If you have installed Composer globally: `composer install`
- If you have composer.phar: `php composer.phar install`

**3 -** Open terminal and run cli-tools: `php cli-tools serve`

**Optional:** Run with PHP built-in server, go to `public` folder and run: `php -S localhost:8080`

---

Your index.php should looks like this:

```
`
- `&getInstance()` return controller object instance

Libraries
---------

[](#libraries)

**How to use librarie in Controller?**

It is very simple! Just load it with `use` instruction and the librarie will be available for you.

Example:

```
