WordCamp Tokyo 2108 PHPフレームワークから学ぶWordPress運用改善

ryo terai
September 15, 2018
300

WordCamp Tokyo 2108 PHPフレームワークから学ぶWordPress運用改善

ryo terai

September 15, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

45 slides
  1. MVC

  2. MVC

  3. MVC

  4. MVC functions.php Controller & Model xxxxxController.php View Elements helpers AppHelper.php

    header.php このheader.phpは本体では無く
 get_template_part()で呼び出す部品 Autoload.phpなんかを置いて includeの制御をしてもいい
  5. 命名規則とコーディング規約 $ phpcs /path/to/code FILE: /path/to/code/myfile.php -------------------------------------------------------------------------------- FOUND 5 ERROR(S)

    AFFECTING 5 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Missing file doc comment 20 | ERROR | PHP keywords must be lowercase; expected "false" but found "FALSE" 47 | ERROR | Line not indented correctly; expected 4 spaces but found 1 51 | ERROR | Missing function doc comment 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6 -------------------------------------------------------------------------------- FILE: /path/to/code/yourfile.php -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 21 | ERROR | PHP keywords must be lowercase; expected "false" but found | | "FALSE" 21 | WARNING | Equals sign not aligned with surrounding assignments --------------------------------------------------------------------------------