PHPackages                             pleonovich/simcore - 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. pleonovich/simcore

ActiveLibrary[Framework](/categories/framework)

pleonovich/simcore
==================

simCore Simple MVC Framework for PHP

2.0.6(5y ago)114Apache-2.0PHPPHP &gt;=5.0.0

Since Jan 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pleonovich/simcore)[ Packagist](https://packagist.org/packages/pleonovich/simcore)[ Docs](https://github.com/pleonovich/simcore)[ RSS](/packages/pleonovich-simcore/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

[![simcore](/images/simCore.gif)](/images/simCore.gif)

Simple MVC Framework for PHP

Requirements:
-------------

[](#requirements)

Configuration
-------------

[](#configuration)

App name and database connection settings in config file `/simcore/config/Config.class.php`

```
class Config
{
    // MAIN
    const APPID = 'simCore';
    const APPNAME = 'simCore';

    // DB CONNECTION
    const DB_HOST = 'localhost';
    const DB_USER = 'root';
    const DB_PASS = '';
    const DB_NAME = 'simCore';
    const DB_CHARSET = 'utf8';
    const DB_PORT = '3307';
    const DB_SOCKET = NULL;
}
```

Routing
-------

[](#routing)

Routes config settings in index file `index.php`

### For search engine friendly urls

[](#for-search-engine-friendly-urls)

Description:

```
Router get ( string $pattern, string $classmethod | Clousure $function [, array $aliases=null ] )
Router post ( string $pattern, string $classmethod | Clousure $function [, array $aliases=null ] )
Router put ( string $pattern, string $classmethod | Clousure $function [, array $aliases=null ] )
Router delete ( string $pattern, string $classmethod | Clousure $function [, array $aliases=null ] )
```

Example:

```
Router::factory()
->set('~^/$~', 'Index@index') // yourdomain.com
->post('~^/articles/$~', 'Index@addArticle') // yourdomain.com/id/7
->put('~^/articles/([0-9]+)$~', 'Index@updateArticle', array('id')) // yourdomain.com/id/7
->delete('~^/articles/([0-9]+)$~', 'Index@deleteArticle', array('id')) // yourdomain.com/id/7
->get('~^/func$~', function ($request, $response) {
	echo "Hello world!";
})
->run();
```

### For simple urls

[](#for-simple-urls)

Description:

```
SimpleRouter setDefault ( string $class, string $method )
SimpleRouter set ( string $mod, string $class, string $method )
```

Example:

```
SimpleRouter::factory()
->setDefault('Index', 'index') // yourdomain.com
->get('main', 'Index', 'index') // yourdomain.com?mod=main&id=7
->run();
```

Model
-----

[](#model)

All models live here `/src/models/` and must have prefix `.class`, example: `Model.class.php`

### Basic model example:

[](#basic-model-example)

```
class Userlist extends Model {

  protected static $table = 'userslist';

}
```

### Model migration example:

[](#model-migration-example)

Setup migration example:

```
class Userlist extends Model {

  protected static $table = 'userslist';

  protected static function schema($create) {
        $create
        ->id()
        ->varchar('user_name')
        ->varchar('user_login')
        ->varchar('email')
        ->text('secret')
        ->int('manager')
        ->int('moderator');
   }
}
```

Run migration example:

```
Userlist::migrate();
```

Insert data example:

```
class Userlist extends Model {

 protected static $table = 'userslist';

 protected static function insert($insert) {
        $insert
        ->set('user_name', 'Admin')
        ->set('user_login', 'admin')
        ->set('secret', '12345')
        ->set('manager', '1')
        ->set('moderator', '1');
	}
}
```

Run data insert:

```
Userlist::insertData();
```

### Work with model:

[](#work-with-model)

Description:

```
// returns all data from table
Array all ()
// returns only specific columns from table
Array getNames ( mix ... )
// returns one specific column
Array column ( string $name )
// return one specific row by id
Array getById ( int $id )
// return one row by id specific column and its value
Array getByValue ( string $name, string $value )
// return specific rows by id specific column and its value
Array namesByValue ( Array $names, string $name, string $value )
// updates data in db from POST, inserts if id not exist.
Boolean save ()
// removes data by id
Boolean remove ( string $name, string $value )
```

Example:

```
Model
class IndexController {

  public function Index () {
    $data = Pages::getById(7);
    print_r($data);
  }

}
```

View
----

[](#view)

All views live here `/src/views/` and must have prefix `.view`, example: `layout.view.php`

### Basic:

[](#basic)

```
// Set variables
{{var myvar='hello'}}
//The same as:

// Print variables
{{$title}}
//The same as:

// Arrays
{{$array[index]}}
//The same as:
var}}
// Or
{{$object.var}}
//The same as:
var?>

// Call static constants
{{Class::const}}
//The same as:

```

### Foreach loops

[](#foreach-loops)

```
{{foreach $array as $one}}
{{$one}}
{{/foreach}}

// The same as:

```

### For loops

[](#for-loops)

```
{{for ($a=1;$arender('accessdenied');
  }
  // PAGE FOR 404
  protected function action404 () {
    View::factory()->render('action404');
  }
  // LAYOUT VIEW
  protected function render () {
    View::factory()
    ->bind("title",$this->title)
    ->bind("content",$this->content)
    ->render('layout'); // view name without prefix
  }

}
```

Page controller example:

```
class IndexController extends Controller {

  public function Index () {
    $this->title = "Hello world!";
    $this->content = "Here is some text for our first page";
    // MAIN RENDER
    $this->render();
  }

}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Recently: every ~47 days

Total

6

Last Release

2135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6cedf1f24bd1ebfbe2d48ba65544bad385d9d1a83418d9c44474052df74b68b?d=identicon)[Pavel Leonovich](/maintainers/Pavel%20Leonovich)

---

Top Contributors

[![pleonovich](https://avatars.githubusercontent.com/u/12541362?v=4)](https://github.com/pleonovich "pleonovich (15 commits)")

---

Tags

mvcmvc-frameworkphpwebweb-frameworkphpframeworksimcore

### Embed Badge

![Health badge](/badges/pleonovich-simcore/health.svg)

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

PHPackages © 2026

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