├── .gitignore ├── .htaccess ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── index.php ├── style.css ├── tasks.sql └── template.twig /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | 4 | # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control 5 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 6 | # composer.lock 7 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteCond %{REQUEST_FILENAME} !-d 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^ index.php [QSA,L] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Hector Benitez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # php-database-crud -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "zendframework/zend-diactoros": "^1.8", 4 | "relay/relay": "2.x@dev", 5 | "middlewares/aura-router": "^1.1", 6 | "middlewares/request-handler": "^1.2", 7 | "twig/twig": "^2.5" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "f9a689829315d65c1f29daee6cf5977c", 8 | "packages": [ 9 | { 10 | "name": "aura/router", 11 | "version": "3.1.0", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/auraphp/Aura.Router.git", 15 | "reference": "52507bc813c92511dbcacc7463f163ef5149ad38" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/auraphp/Aura.Router/zipball/52507bc813c92511dbcacc7463f163ef5149ad38", 20 | "reference": "52507bc813c92511dbcacc7463f163ef5149ad38", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": ">=5.5.0", 25 | "psr/http-message": "~1.0", 26 | "psr/log": "~1.0" 27 | }, 28 | "require-dev": { 29 | "phpunit/phpunit": "~5.7 || ~4.8", 30 | "zendframework/zend-diactoros": "~1.0" 31 | }, 32 | "type": "library", 33 | "autoload": { 34 | "psr-4": { 35 | "Aura\\Router\\": "src/" 36 | } 37 | }, 38 | "notification-url": "https://packagist.org/downloads/", 39 | "license": [ 40 | "MIT" 41 | ], 42 | "authors": [ 43 | { 44 | "name": "Aura.Router Contributors", 45 | "homepage": "https://github.com/auraphp/Aura.Router/contributors" 46 | } 47 | ], 48 | "description": "Powerful, flexible web routing for PSR-7 requests.", 49 | "homepage": "https://github.com/auraphp/Aura.Router", 50 | "keywords": [ 51 | "psr-7", 52 | "route", 53 | "router", 54 | "routing" 55 | ], 56 | "time": "2017-03-02T16:34:47+00:00" 57 | }, 58 | { 59 | "name": "middlewares/aura-router", 60 | "version": "v1.1.0", 61 | "source": { 62 | "type": "git", 63 | "url": "https://github.com/middlewares/aura-router.git", 64 | "reference": "4e825a421a9857c1a344109bd41019dbb8280e76" 65 | }, 66 | "dist": { 67 | "type": "zip", 68 | "url": "https://api.github.com/repos/middlewares/aura-router/zipball/4e825a421a9857c1a344109bd41019dbb8280e76", 69 | "reference": "4e825a421a9857c1a344109bd41019dbb8280e76", 70 | "shasum": "" 71 | }, 72 | "require": { 73 | "aura/router": "^3.0", 74 | "middlewares/utils": "^2.1", 75 | "php": "^7.0", 76 | "psr/http-server-middleware": "^1.0" 77 | }, 78 | "require-dev": { 79 | "friendsofphp/php-cs-fixer": "^2.0", 80 | "guzzlehttp/psr7": "^1.4", 81 | "phpunit/phpunit": "^6.0|^7.0", 82 | "squizlabs/php_codesniffer": "^3.0", 83 | "zendframework/zend-diactoros": "^1.3" 84 | }, 85 | "type": "library", 86 | "autoload": { 87 | "psr-4": { 88 | "Middlewares\\": "src/" 89 | } 90 | }, 91 | "notification-url": "https://packagist.org/downloads/", 92 | "license": [ 93 | "MIT" 94 | ], 95 | "description": "Middleware to use Aura.Router", 96 | "homepage": "https://github.com/middlewares/aura-router", 97 | "keywords": [ 98 | "aura", 99 | "http", 100 | "middleware", 101 | "psr-15", 102 | "psr-7", 103 | "router", 104 | "server" 105 | ], 106 | "time": "2018-08-04T10:41:44+00:00" 107 | }, 108 | { 109 | "name": "middlewares/request-handler", 110 | "version": "v1.2.0", 111 | "source": { 112 | "type": "git", 113 | "url": "https://github.com/middlewares/request-handler.git", 114 | "reference": "bf93cb50fd9c7ccfb00a3e640ed922d26d5f6a78" 115 | }, 116 | "dist": { 117 | "type": "zip", 118 | "url": "https://api.github.com/repos/middlewares/request-handler/zipball/bf93cb50fd9c7ccfb00a3e640ed922d26d5f6a78", 119 | "reference": "bf93cb50fd9c7ccfb00a3e640ed922d26d5f6a78", 120 | "shasum": "" 121 | }, 122 | "require": { 123 | "middlewares/utils": "^2.1", 124 | "php": "^7.0", 125 | "psr/http-server-middleware": "^1.0" 126 | }, 127 | "require-dev": { 128 | "friendsofphp/php-cs-fixer": "^2.0", 129 | "phpunit/phpunit": "^6.0|^7.0", 130 | "psr/container": "^1.0", 131 | "squizlabs/php_codesniffer": "^3.0", 132 | "zendframework/zend-diactoros": "^1.3" 133 | }, 134 | "suggest": { 135 | "psr/container": "Can be used to resolve handlers automatically" 136 | }, 137 | "type": "library", 138 | "autoload": { 139 | "psr-4": { 140 | "Middlewares\\": "src/" 141 | } 142 | }, 143 | "notification-url": "https://packagist.org/downloads/", 144 | "license": [ 145 | "MIT" 146 | ], 147 | "description": "Middleware to execute request handlers", 148 | "homepage": "https://github.com/middlewares/request-handler", 149 | "keywords": [ 150 | "controller", 151 | "handler", 152 | "http", 153 | "invoke", 154 | "middleware", 155 | "psr-15", 156 | "psr-7", 157 | "request", 158 | "server" 159 | ], 160 | "time": "2018-08-04T10:41:54+00:00" 161 | }, 162 | { 163 | "name": "middlewares/utils", 164 | "version": "v2.1.1", 165 | "source": { 166 | "type": "git", 167 | "url": "https://github.com/middlewares/utils.git", 168 | "reference": "8e3f2720fa462443e1566c9e3ab78169adcb0468" 169 | }, 170 | "dist": { 171 | "type": "zip", 172 | "url": "https://api.github.com/repos/middlewares/utils/zipball/8e3f2720fa462443e1566c9e3ab78169adcb0468", 173 | "reference": "8e3f2720fa462443e1566c9e3ab78169adcb0468", 174 | "shasum": "" 175 | }, 176 | "require": { 177 | "php": "^7.0", 178 | "psr/container": "^1.0", 179 | "psr/http-factory": "^1.0", 180 | "psr/http-message": "^1.0", 181 | "psr/http-server-middleware": "^1.0" 182 | }, 183 | "require-dev": { 184 | "friendsofphp/php-cs-fixer": "^2.0", 185 | "guzzlehttp/psr7": "^1.3", 186 | "phpunit/phpunit": "^6.0|^7.0", 187 | "slim/slim": "^3.5", 188 | "squizlabs/php_codesniffer": "^3.0", 189 | "zendframework/zend-diactoros": "^1.3" 190 | }, 191 | "type": "library", 192 | "autoload": { 193 | "psr-4": { 194 | "Middlewares\\Utils\\": "src/" 195 | } 196 | }, 197 | "notification-url": "https://packagist.org/downloads/", 198 | "license": [ 199 | "MIT" 200 | ], 201 | "description": "Common utils to create PSR-15 middleware packages", 202 | "homepage": "https://github.com/middlewares/utils", 203 | "keywords": [ 204 | "PSR-11", 205 | "http", 206 | "middleware", 207 | "psr-15", 208 | "psr-17", 209 | "psr-7" 210 | ], 211 | "time": "2018-08-11T07:23:25+00:00" 212 | }, 213 | { 214 | "name": "psr/container", 215 | "version": "1.0.0", 216 | "source": { 217 | "type": "git", 218 | "url": "https://github.com/php-fig/container.git", 219 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 220 | }, 221 | "dist": { 222 | "type": "zip", 223 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 224 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 225 | "shasum": "" 226 | }, 227 | "require": { 228 | "php": ">=5.3.0" 229 | }, 230 | "type": "library", 231 | "extra": { 232 | "branch-alias": { 233 | "dev-master": "1.0.x-dev" 234 | } 235 | }, 236 | "autoload": { 237 | "psr-4": { 238 | "Psr\\Container\\": "src/" 239 | } 240 | }, 241 | "notification-url": "https://packagist.org/downloads/", 242 | "license": [ 243 | "MIT" 244 | ], 245 | "authors": [ 246 | { 247 | "name": "PHP-FIG", 248 | "homepage": "http://www.php-fig.org/" 249 | } 250 | ], 251 | "description": "Common Container Interface (PHP FIG PSR-11)", 252 | "homepage": "https://github.com/php-fig/container", 253 | "keywords": [ 254 | "PSR-11", 255 | "container", 256 | "container-interface", 257 | "container-interop", 258 | "psr" 259 | ], 260 | "time": "2017-02-14T16:28:37+00:00" 261 | }, 262 | { 263 | "name": "psr/http-factory", 264 | "version": "1.0.0", 265 | "source": { 266 | "type": "git", 267 | "url": "https://github.com/php-fig/http-factory.git", 268 | "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c" 269 | }, 270 | "dist": { 271 | "type": "zip", 272 | "url": "https://api.github.com/repos/php-fig/http-factory/zipball/378bfe27931ecc54ff824a20d6f6bfc303bbd04c", 273 | "reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c", 274 | "shasum": "" 275 | }, 276 | "require": { 277 | "php": ">=7.0.0", 278 | "psr/http-message": "^1.0" 279 | }, 280 | "type": "library", 281 | "extra": { 282 | "branch-alias": { 283 | "dev-master": "1.0.x-dev" 284 | } 285 | }, 286 | "autoload": { 287 | "psr-4": { 288 | "Psr\\Http\\Message\\": "src/" 289 | } 290 | }, 291 | "notification-url": "https://packagist.org/downloads/", 292 | "license": [ 293 | "MIT" 294 | ], 295 | "authors": [ 296 | { 297 | "name": "PHP-FIG", 298 | "homepage": "http://www.php-fig.org/" 299 | } 300 | ], 301 | "description": "Common interfaces for PSR-7 HTTP message factories", 302 | "keywords": [ 303 | "factory", 304 | "http", 305 | "message", 306 | "psr", 307 | "psr-17", 308 | "psr-7", 309 | "request", 310 | "response" 311 | ], 312 | "time": "2018-07-30T21:54:04+00:00" 313 | }, 314 | { 315 | "name": "psr/http-message", 316 | "version": "1.0.1", 317 | "source": { 318 | "type": "git", 319 | "url": "https://github.com/php-fig/http-message.git", 320 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 321 | }, 322 | "dist": { 323 | "type": "zip", 324 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 325 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 326 | "shasum": "" 327 | }, 328 | "require": { 329 | "php": ">=5.3.0" 330 | }, 331 | "type": "library", 332 | "extra": { 333 | "branch-alias": { 334 | "dev-master": "1.0.x-dev" 335 | } 336 | }, 337 | "autoload": { 338 | "psr-4": { 339 | "Psr\\Http\\Message\\": "src/" 340 | } 341 | }, 342 | "notification-url": "https://packagist.org/downloads/", 343 | "license": [ 344 | "MIT" 345 | ], 346 | "authors": [ 347 | { 348 | "name": "PHP-FIG", 349 | "homepage": "http://www.php-fig.org/" 350 | } 351 | ], 352 | "description": "Common interface for HTTP messages", 353 | "homepage": "https://github.com/php-fig/http-message", 354 | "keywords": [ 355 | "http", 356 | "http-message", 357 | "psr", 358 | "psr-7", 359 | "request", 360 | "response" 361 | ], 362 | "time": "2016-08-06T14:39:51+00:00" 363 | }, 364 | { 365 | "name": "psr/http-server-handler", 366 | "version": "1.0.0", 367 | "source": { 368 | "type": "git", 369 | "url": "https://github.com/php-fig/http-server-handler.git", 370 | "reference": "439d92054dc06097f2406ec074a2627839955a02" 371 | }, 372 | "dist": { 373 | "type": "zip", 374 | "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/439d92054dc06097f2406ec074a2627839955a02", 375 | "reference": "439d92054dc06097f2406ec074a2627839955a02", 376 | "shasum": "" 377 | }, 378 | "require": { 379 | "php": ">=7.0", 380 | "psr/http-message": "^1.0" 381 | }, 382 | "type": "library", 383 | "extra": { 384 | "branch-alias": { 385 | "dev-master": "1.0.x-dev" 386 | } 387 | }, 388 | "autoload": { 389 | "psr-4": { 390 | "Psr\\Http\\Server\\": "src/" 391 | } 392 | }, 393 | "notification-url": "https://packagist.org/downloads/", 394 | "license": [ 395 | "MIT" 396 | ], 397 | "authors": [ 398 | { 399 | "name": "PHP-FIG", 400 | "homepage": "http://www.php-fig.org/" 401 | } 402 | ], 403 | "description": "Common interface for HTTP server-side request handler", 404 | "keywords": [ 405 | "handler", 406 | "http", 407 | "http-interop", 408 | "psr", 409 | "psr-15", 410 | "psr-7", 411 | "request", 412 | "response", 413 | "server" 414 | ], 415 | "time": "2018-01-22T17:04:15+00:00" 416 | }, 417 | { 418 | "name": "psr/http-server-middleware", 419 | "version": "1.0.0", 420 | "source": { 421 | "type": "git", 422 | "url": "https://github.com/php-fig/http-server-middleware.git", 423 | "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5" 424 | }, 425 | "dist": { 426 | "type": "zip", 427 | "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", 428 | "reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5", 429 | "shasum": "" 430 | }, 431 | "require": { 432 | "php": ">=7.0", 433 | "psr/http-message": "^1.0", 434 | "psr/http-server-handler": "^1.0" 435 | }, 436 | "type": "library", 437 | "extra": { 438 | "branch-alias": { 439 | "dev-master": "1.0.x-dev" 440 | } 441 | }, 442 | "autoload": { 443 | "psr-4": { 444 | "Psr\\Http\\Server\\": "src/" 445 | } 446 | }, 447 | "notification-url": "https://packagist.org/downloads/", 448 | "license": [ 449 | "MIT" 450 | ], 451 | "authors": [ 452 | { 453 | "name": "PHP-FIG", 454 | "homepage": "http://www.php-fig.org/" 455 | } 456 | ], 457 | "description": "Common interface for HTTP server-side middleware", 458 | "keywords": [ 459 | "http", 460 | "http-interop", 461 | "middleware", 462 | "psr", 463 | "psr-15", 464 | "psr-7", 465 | "request", 466 | "response" 467 | ], 468 | "time": "2018-01-22T17:08:31+00:00" 469 | }, 470 | { 471 | "name": "psr/log", 472 | "version": "1.0.2", 473 | "source": { 474 | "type": "git", 475 | "url": "https://github.com/php-fig/log.git", 476 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" 477 | }, 478 | "dist": { 479 | "type": "zip", 480 | "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 481 | "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", 482 | "shasum": "" 483 | }, 484 | "require": { 485 | "php": ">=5.3.0" 486 | }, 487 | "type": "library", 488 | "extra": { 489 | "branch-alias": { 490 | "dev-master": "1.0.x-dev" 491 | } 492 | }, 493 | "autoload": { 494 | "psr-4": { 495 | "Psr\\Log\\": "Psr/Log/" 496 | } 497 | }, 498 | "notification-url": "https://packagist.org/downloads/", 499 | "license": [ 500 | "MIT" 501 | ], 502 | "authors": [ 503 | { 504 | "name": "PHP-FIG", 505 | "homepage": "http://www.php-fig.org/" 506 | } 507 | ], 508 | "description": "Common interface for logging libraries", 509 | "homepage": "https://github.com/php-fig/log", 510 | "keywords": [ 511 | "log", 512 | "psr", 513 | "psr-3" 514 | ], 515 | "time": "2016-10-10T12:19:37+00:00" 516 | }, 517 | { 518 | "name": "relay/relay", 519 | "version": "2.x-dev", 520 | "source": { 521 | "type": "git", 522 | "url": "https://github.com/relayphp/Relay.Relay.git", 523 | "reference": "da12328890800cd12107bc95a775e61993fb438f" 524 | }, 525 | "dist": { 526 | "type": "zip", 527 | "url": "https://api.github.com/repos/relayphp/Relay.Relay/zipball/da12328890800cd12107bc95a775e61993fb438f", 528 | "reference": "da12328890800cd12107bc95a775e61993fb438f", 529 | "shasum": "" 530 | }, 531 | "require": { 532 | "php": ">=7.1", 533 | "psr/http-message": "~1.0", 534 | "psr/http-server-handler": "~1.0" 535 | }, 536 | "require-dev": { 537 | "phpunit/phpunit": "~7.0", 538 | "psr/http-server-middleware": "~1.0", 539 | "zendframework/zend-diactoros": "~1.0" 540 | }, 541 | "type": "library", 542 | "autoload": { 543 | "psr-4": { 544 | "Relay\\": "src/" 545 | } 546 | }, 547 | "notification-url": "https://packagist.org/downloads/", 548 | "license": [ 549 | "MIT" 550 | ], 551 | "authors": [ 552 | { 553 | "name": "Relay.Relay Contributors", 554 | "homepage": "https://github.com/relayphp/Relay.Relay/contributors" 555 | } 556 | ], 557 | "description": "A PSR-7 middleware dispatcher.", 558 | "homepage": "https://github.com/relayphp/Relay.Relay", 559 | "keywords": [ 560 | "middleware", 561 | "psr-7" 562 | ], 563 | "time": "2018-02-13T21:34:17+00:00" 564 | }, 565 | { 566 | "name": "symfony/polyfill-ctype", 567 | "version": "v1.9.0", 568 | "source": { 569 | "type": "git", 570 | "url": "https://github.com/symfony/polyfill-ctype.git", 571 | "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" 572 | }, 573 | "dist": { 574 | "type": "zip", 575 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", 576 | "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", 577 | "shasum": "" 578 | }, 579 | "require": { 580 | "php": ">=5.3.3" 581 | }, 582 | "suggest": { 583 | "ext-ctype": "For best performance" 584 | }, 585 | "type": "library", 586 | "extra": { 587 | "branch-alias": { 588 | "dev-master": "1.9-dev" 589 | } 590 | }, 591 | "autoload": { 592 | "psr-4": { 593 | "Symfony\\Polyfill\\Ctype\\": "" 594 | }, 595 | "files": [ 596 | "bootstrap.php" 597 | ] 598 | }, 599 | "notification-url": "https://packagist.org/downloads/", 600 | "license": [ 601 | "MIT" 602 | ], 603 | "authors": [ 604 | { 605 | "name": "Symfony Community", 606 | "homepage": "https://symfony.com/contributors" 607 | }, 608 | { 609 | "name": "Gert de Pagter", 610 | "email": "BackEndTea@gmail.com" 611 | } 612 | ], 613 | "description": "Symfony polyfill for ctype functions", 614 | "homepage": "https://symfony.com", 615 | "keywords": [ 616 | "compatibility", 617 | "ctype", 618 | "polyfill", 619 | "portable" 620 | ], 621 | "time": "2018-08-06T14:22:27+00:00" 622 | }, 623 | { 624 | "name": "symfony/polyfill-mbstring", 625 | "version": "v1.9.0", 626 | "source": { 627 | "type": "git", 628 | "url": "https://github.com/symfony/polyfill-mbstring.git", 629 | "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" 630 | }, 631 | "dist": { 632 | "type": "zip", 633 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", 634 | "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", 635 | "shasum": "" 636 | }, 637 | "require": { 638 | "php": ">=5.3.3" 639 | }, 640 | "suggest": { 641 | "ext-mbstring": "For best performance" 642 | }, 643 | "type": "library", 644 | "extra": { 645 | "branch-alias": { 646 | "dev-master": "1.9-dev" 647 | } 648 | }, 649 | "autoload": { 650 | "psr-4": { 651 | "Symfony\\Polyfill\\Mbstring\\": "" 652 | }, 653 | "files": [ 654 | "bootstrap.php" 655 | ] 656 | }, 657 | "notification-url": "https://packagist.org/downloads/", 658 | "license": [ 659 | "MIT" 660 | ], 661 | "authors": [ 662 | { 663 | "name": "Nicolas Grekas", 664 | "email": "p@tchwork.com" 665 | }, 666 | { 667 | "name": "Symfony Community", 668 | "homepage": "https://symfony.com/contributors" 669 | } 670 | ], 671 | "description": "Symfony polyfill for the Mbstring extension", 672 | "homepage": "https://symfony.com", 673 | "keywords": [ 674 | "compatibility", 675 | "mbstring", 676 | "polyfill", 677 | "portable", 678 | "shim" 679 | ], 680 | "time": "2018-08-06T14:22:27+00:00" 681 | }, 682 | { 683 | "name": "twig/twig", 684 | "version": "v2.5.0", 685 | "source": { 686 | "type": "git", 687 | "url": "https://github.com/twigphp/Twig.git", 688 | "reference": "6a5f676b77a90823c2d4eaf76137b771adf31323" 689 | }, 690 | "dist": { 691 | "type": "zip", 692 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/6a5f676b77a90823c2d4eaf76137b771adf31323", 693 | "reference": "6a5f676b77a90823c2d4eaf76137b771adf31323", 694 | "shasum": "" 695 | }, 696 | "require": { 697 | "php": "^7.0", 698 | "symfony/polyfill-ctype": "^1.8", 699 | "symfony/polyfill-mbstring": "~1.0" 700 | }, 701 | "require-dev": { 702 | "psr/container": "^1.0", 703 | "symfony/debug": "^2.7", 704 | "symfony/phpunit-bridge": "^3.3" 705 | }, 706 | "type": "library", 707 | "extra": { 708 | "branch-alias": { 709 | "dev-master": "2.5-dev" 710 | } 711 | }, 712 | "autoload": { 713 | "psr-0": { 714 | "Twig_": "lib/" 715 | }, 716 | "psr-4": { 717 | "Twig\\": "src/" 718 | } 719 | }, 720 | "notification-url": "https://packagist.org/downloads/", 721 | "license": [ 722 | "BSD-3-Clause" 723 | ], 724 | "authors": [ 725 | { 726 | "name": "Fabien Potencier", 727 | "email": "fabien@symfony.com", 728 | "homepage": "http://fabien.potencier.org", 729 | "role": "Lead Developer" 730 | }, 731 | { 732 | "name": "Armin Ronacher", 733 | "email": "armin.ronacher@active-4.com", 734 | "role": "Project Founder" 735 | }, 736 | { 737 | "name": "Twig Team", 738 | "homepage": "https://twig.symfony.com/contributors", 739 | "role": "Contributors" 740 | } 741 | ], 742 | "description": "Twig, the flexible, fast, and secure template language for PHP", 743 | "homepage": "https://twig.symfony.com", 744 | "keywords": [ 745 | "templating" 746 | ], 747 | "time": "2018-07-13T07:18:09+00:00" 748 | }, 749 | { 750 | "name": "zendframework/zend-diactoros", 751 | "version": "1.8.5", 752 | "source": { 753 | "type": "git", 754 | "url": "https://github.com/zendframework/zend-diactoros.git", 755 | "reference": "3e4edb822c942f37ade0d09579cfbab11e2fee87" 756 | }, 757 | "dist": { 758 | "type": "zip", 759 | "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/3e4edb822c942f37ade0d09579cfbab11e2fee87", 760 | "reference": "3e4edb822c942f37ade0d09579cfbab11e2fee87", 761 | "shasum": "" 762 | }, 763 | "require": { 764 | "php": "^5.6 || ^7.0", 765 | "psr/http-message": "^1.0" 766 | }, 767 | "provide": { 768 | "psr/http-message-implementation": "1.0" 769 | }, 770 | "require-dev": { 771 | "ext-dom": "*", 772 | "ext-libxml": "*", 773 | "phpunit/phpunit": "^5.7.16 || ^6.0.8 || ^7.2.7", 774 | "zendframework/zend-coding-standard": "~1.0" 775 | }, 776 | "type": "library", 777 | "extra": { 778 | "branch-alias": { 779 | "dev-master": "1.8.x-dev", 780 | "dev-develop": "1.9.x-dev", 781 | "dev-release-2.0": "2.0.x-dev" 782 | } 783 | }, 784 | "autoload": { 785 | "files": [ 786 | "src/functions/create_uploaded_file.php", 787 | "src/functions/marshal_headers_from_sapi.php", 788 | "src/functions/marshal_method_from_sapi.php", 789 | "src/functions/marshal_protocol_version_from_sapi.php", 790 | "src/functions/marshal_uri_from_sapi.php", 791 | "src/functions/normalize_server.php", 792 | "src/functions/normalize_uploaded_files.php", 793 | "src/functions/parse_cookie_header.php" 794 | ], 795 | "psr-4": { 796 | "Zend\\Diactoros\\": "src/" 797 | } 798 | }, 799 | "notification-url": "https://packagist.org/downloads/", 800 | "license": [ 801 | "BSD-2-Clause" 802 | ], 803 | "description": "PSR HTTP Message implementations", 804 | "homepage": "https://github.com/zendframework/zend-diactoros", 805 | "keywords": [ 806 | "http", 807 | "psr", 808 | "psr-7" 809 | ], 810 | "time": "2018-08-10T14:16:32+00:00" 811 | } 812 | ], 813 | "packages-dev": [], 814 | "aliases": [], 815 | "minimum-stability": "stable", 816 | "stability-flags": { 817 | "relay/relay": 20 818 | }, 819 | "prefer-stable": false, 820 | "prefer-lowest": false, 821 | "platform": [], 822 | "platform-dev": [] 823 | } 824 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | true, 22 | 'cache' => false, 23 | )); 24 | 25 | $router = new Aura\Router\RouterContainer(); 26 | $map = $router->getMap(); 27 | $map->get('todo.list', '/', function ($request) use ($twig) { 28 | $tasks = [ 29 | [ 30 | 'id' => 1, 31 | 'description' => 'Aprender inglés', 32 | 'done' => false 33 | ], 34 | [ 35 | 'id' => 1, 36 | 'description' => 'Hacer la tarea', 37 | 'done' => true 38 | ], 39 | [ 40 | 'id' => 1, 41 | 'description' => 'Pasear al perro', 42 | 'done' => false 43 | ], 44 | [ 45 | 'id' => 1, 46 | 'description' => 'Ver el curso de introducción a PHP', 47 | 'done' => false 48 | ] 49 | ]; 50 | $response = new Zend\Diactoros\Response\HtmlResponse($twig->render('template.twig', [ 51 | 'tasks' => $tasks 52 | ])); 53 | return $response; 54 | }); 55 | 56 | $relay = new Relay([ 57 | new Middlewares\AuraRouter($router), 58 | new Middlewares\RequestHandler() 59 | ]); 60 | 61 | $response = $relay->handle($request); 62 | 63 | foreach ($response->getHeaders() as $name => $values) { 64 | foreach ($values as $value) { 65 | header(sprintf('%s: %s', $name, $value), false); 66 | } 67 | } 68 | echo $response->getBody(); -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 20px; 3 | } 4 | 5 | .header { 6 | text-align: center; 7 | margin-bottom: 20px; 8 | } -------------------------------------------------------------------------------- /tasks.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.8.2 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Servidor: localhost 6 | -- Tiempo de generación: 16-08-2018 a las 19:34:15 7 | -- Versión del servidor: 10.1.34-MariaDB 8 | -- Versión de PHP: 7.2.8 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET AUTOCOMMIT = 0; 12 | START TRANSACTION; 13 | SET time_zone = "+00:00"; 14 | 15 | 16 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 17 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 18 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 19 | /*!40101 SET NAMES utf8mb4 */; 20 | 21 | -- 22 | -- Base de datos: `todo` 23 | -- 24 | 25 | -- -------------------------------------------------------- 26 | 27 | -- 28 | -- Estructura de tabla para la tabla `tasks` 29 | -- 30 | 31 | CREATE TABLE `tasks` ( 32 | `id` int(11) NOT NULL, 33 | `description` text NOT NULL, 34 | `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 35 | `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', 36 | `done` tinyint(1) NOT NULL 37 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 38 | 39 | -- 40 | -- Índices para tablas volcadas 41 | -- 42 | 43 | -- 44 | -- Indices de la tabla `tasks` 45 | -- 46 | ALTER TABLE `tasks` 47 | ADD PRIMARY KEY (`id`); 48 | 49 | -- 50 | -- AUTO_INCREMENT de las tablas volcadas 51 | -- 52 | 53 | -- 54 | -- AUTO_INCREMENT de la tabla `tasks` 55 | -- 56 | ALTER TABLE `tasks` 57 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; 58 | COMMIT; 59 | 60 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 61 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 62 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 63 | -------------------------------------------------------------------------------- /template.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Todo List 14 | 15 | 16 |
17 |
18 |
19 |

Todo List

20 |
21 | 22 |
23 | 24 |
25 |
26 |
27 | 28 | 47 |
48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | --------------------------------------------------------------------------------