├── composer.phar ├── public ├── favicon.ico ├── assets │ ├── css │ │ └── style.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── js │ │ ├── bootstrap.min.js │ │ └── jquery.min.js ├── index.php └── .htaccess ├── Fluxograma-Microframework.pdf ├── storage └── database │ └── database.db ├── app ├── Views │ ├── posts │ │ ├── show.phtml │ │ ├── index.phtml │ │ ├── create.phtml │ │ └── edit.phtml │ ├── alerts │ │ ├── _errors.phtml │ │ └── _success.phtml │ ├── home │ │ └── index.phtml │ ├── layout.phtml │ ├── user │ │ ├── login.phtml │ │ └── create.phtml │ ├── menu.phtml │ └── 404.phtml ├── Controllers │ ├── HomeController.php │ ├── UserController.php │ └── PostsController.php ├── Models │ ├── Category.php │ ├── Post.php │ └── User.php ├── database.php └── routes.php ├── core ├── bootstrap.php ├── BaseModelEloquent.php ├── Redirect.php ├── Session.php ├── Container.php ├── Auth.php ├── bootstrap_eloquent.php ├── Authenticate.php ├── DataBase.php ├── BaseController.php ├── Route.php ├── BaseModel.php └── Validator.php ├── composer.json ├── readme.md └── composer.lock /composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-micro-framework/HEAD/composer.phar -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-micro-framework/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /Fluxograma-Microframework.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-micro-framework/HEAD/Fluxograma-Microframework.pdf -------------------------------------------------------------------------------- /public/assets/css/style.css: -------------------------------------------------------------------------------- 1 | @import "bootstrap.min.css"; 2 | 3 | /* custum style */ 4 | .row-bottom-20{margin-top: 20px} -------------------------------------------------------------------------------- /storage/database/database.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-micro-framework/HEAD/storage/database/database.db -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 2 |
view->post->content; ?>
4 | -------------------------------------------------------------------------------- /core/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | RewriteEngine On 4 | 5 | RewriteRule ^(.*)/$ /$1 [L,R=301] 6 | 7 | RewriteCond %{REQUEST_FILENAME} !-d 8 | RewriteCond %{REQUEST_FILENAME} !-f 9 | RewriteRule ^ index.php [L] 10 | 11 | -------------------------------------------------------------------------------- /app/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | setPageTitle('Home'); 11 | $this->renderView('home/index', 'layout'); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /core/Redirect.php: -------------------------------------------------------------------------------- 1 | 0) 11 | foreach ($with as $key => $value) 12 | Session::set($key, $value); 13 | return header("location:$url"); 14 | } 15 | } -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | belongsToMany(Post::class); 19 | } 20 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tjg/microframework", 3 | "Description": "Micro Framewrok MVC", 4 | "license": "MIT", 5 | "type": "project", 6 | "authors": [ 7 | {"name": "Talles Gazel", "email": "tjgazel@gmail.com"} 8 | ], 9 | "autoload":{ 10 | "psr-4":{ 11 | "App\\": "app/", 12 | "Core\\": "core/" 13 | } 14 | }, 15 | "require":{ 16 | "php": ">=5.6.4", 17 | "illuminate/database": "^5.4" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/database.php: -------------------------------------------------------------------------------- 1 | 'sqlite', 7 | 8 | 'sqlite' => [ 9 | 'database' => 'database.db' 10 | ], 11 | 12 | 'mysql' => [ 13 | 'host' => 'localhost', 14 | 'database' => 'curso_microframework', 15 | 'user' => 'root', 16 | 'pass' => '123', 17 | 'charset' => 'utf8', 18 | 'collation' => 'utf8_unicode_ci' 19 | ] 20 | ]; -------------------------------------------------------------------------------- /app/Views/alerts/_errors.phtml: -------------------------------------------------------------------------------- 1 | errors): ?> 2 |8 | 9 |
8 | 9 |
13 | Este é um micro framework MVC em PHP, construído como execício do conteúdo didático do curso "Micro Framework do Zero" disponibilizado através do Youtube no canal TJG Web. 14 |
15 |16 | O intúito do curso é dar uma base mais sólida e exclarecer os conceitos e o funcionamento do ciclo de vida de uma aplicação web seguindo padrões MVC. Depois deste curso, o aluno entenderá melhor o conteúdo de outros cursos oferecidos na internet de frameworks como Laravel, Zend, CakePHP, etc. 17 |
18 |content; ?>
19 |
20 | Autor: user->name; ?>
21 | Categorias:
22 | category as $cat){
23 | echo $cat->name . " ";
24 | } ?>
25 |
26 | auth->check() && $post->user->id == $this->auth->id()) : ?>
27 |
28 |
29 |
30 |
31 |
33 |
34 |
35 |
36 |
37 |
Por favor, verifique se a URL digitada está correta.
49 |