Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahmdadl/base

an no-framework mvc tutrial using
https://github.com/ahmdadl/base

Last synced: about 1 month ago
JSON representation

an no-framework mvc tutrial using

Awesome Lists containing this project

README

        

# PHP Simple Framework
#### Learning PHP OOP

### Features:
* [Fast Route](https://github.com/nikic/fast-route)
* [Symfony Dependency Injection](https://github.com/symfony/dependency-injection)
* [Plates - Template System](https://github.com/league/plates)
* [Validation](https://github.com/respect/validation)
* [Testing- PhpUnit](https://github.com/phpunit/phpunit)

### Examples:
File: routes/web.php
```php
$r->get('/', ['HomeController@index']);
$r->post(
'/',
[
'PostController@store',
'middlewares' => ['CsrfVerify']
]
);
```
File: src/Controllers/HomeController.php
```php
view = $view;
$this->session = $session;
$this->session->sessStart();
}
}

public function index(array $param = [])
{
return $this->view->render('[view_name]', [
'data' => ModelData::all()
]);
}
```
File: resources/views/home.php
```html
layout('layout', ['title' => 'Home Page']);?>



  • =$this->e($row->name)?>


=$this->_method('put')?>
=$this->csrf()?>



```

### Composer Scripts

* tsc
> compile typescripts files to public/js/
* composer asset
> compile app.scss to public/app.css
* composer test
> run phpunit tests
* composer test-log
> create phpunit log
* composer test-coverage
> create phpunit coverage