This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .clearfix::after { | |
| content: ""; | |
| clear: both; | |
| display: block; | |
| visibility: hidden; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $colorRed: red; | |
| #header { | |
| margin: 0; | |
| border: 1px solid $colorRed; | |
| p { | |
| color: $colorRed; | |
| font: { | |
| size: 12px; | |
| weight: bold; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt){ | |
| grunt.initConfig({ | |
| fileCheck: { | |
| src: 'target.txt', | |
| text: 'Test' | |
| } | |
| }); | |
| grunt.registerTask('checkFile', function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php include __DIR__ . "/../layout/header.php"; ?> | |
| <h1>Blog</h1> | |
| <ul> | |
| <?php foreach ($posts as $post): ?> | |
| <li> | |
| <a href="post.php?id=<?php echo $post['id']; ?>"> | |
| <?php echo $post['title']; ?> | |
| </a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Class PostController | |
| namespace App\Post; | |
| use App\Core\AbstractController; | |
| class PostController extends AbstractController | |
| { | |
| public function __construct(PostsRepository $postsRepository){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Class Container | |
| namespace App\Core; | |
| use PDO; | |
| use PDOException; | |
| use App\Post\PostController; | |
| use App\Post\PostsRepository; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Class PostRepository | |
| namespace App\Post; | |
| use App\Core\AbstractRepository; | |
| class PostsRepository extends AbstractRepository { | |
| public function getTableName(){ | |
| return "posts"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // PostModel Class | |
| namespace App\Post; | |
| use App\Core\AbstractModel; | |
| class PostModel extends AbstractModel { | |
| public $id; | |
| public $title; | |
| public $content; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include("../init.php"); | |
| $pathInfo = $_SERVER['PATH_INFO']; | |
| $routes = [ | |
| '/index' => [ | |
| 'controller' => 'postController', | |
| 'method' => 'index' | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function autoload($className){ | |
| $prefix = "app"; | |
| $dir = "classes"; | |
| $clss = substr($className, strlen($prefix)); | |
| $clss = str_replace("\\", "/", $clss); | |
| if (file_exists("{$dir}{$clss}.php")) { | |
| require_once("{$dir}{$clss}.php"); |
NewerOlder