Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

of

CraftCMS 3.x Deep Dive Slide 1 CraftCMS 3.x Deep Dive Slide 2 CraftCMS 3.x Deep Dive Slide 3 CraftCMS 3.x Deep Dive Slide 4 CraftCMS 3.x Deep Dive Slide 5 CraftCMS 3.x Deep Dive Slide 6 CraftCMS 3.x Deep Dive Slide 7 CraftCMS 3.x Deep Dive Slide 8 CraftCMS 3.x Deep Dive Slide 9 CraftCMS 3.x Deep Dive Slide 10 CraftCMS 3.x Deep Dive Slide 11 CraftCMS 3.x Deep Dive Slide 12 CraftCMS 3.x Deep Dive Slide 13 CraftCMS 3.x Deep Dive Slide 14 CraftCMS 3.x Deep Dive Slide 15 CraftCMS 3.x Deep Dive Slide 16 CraftCMS 3.x Deep Dive Slide 17 CraftCMS 3.x Deep Dive Slide 18 CraftCMS 3.x Deep Dive Slide 19 CraftCMS 3.x Deep Dive Slide 20 CraftCMS 3.x Deep Dive Slide 21 CraftCMS 3.x Deep Dive Slide 22 CraftCMS 3.x Deep Dive Slide 23 CraftCMS 3.x Deep Dive Slide 24 CraftCMS 3.x Deep Dive Slide 25 CraftCMS 3.x Deep Dive Slide 26 CraftCMS 3.x Deep Dive Slide 27 CraftCMS 3.x Deep Dive Slide 28 CraftCMS 3.x Deep Dive Slide 29 CraftCMS 3.x Deep Dive Slide 30 CraftCMS 3.x Deep Dive Slide 31 CraftCMS 3.x Deep Dive Slide 32 CraftCMS 3.x Deep Dive Slide 33 CraftCMS 3.x Deep Dive Slide 34 CraftCMS 3.x Deep Dive Slide 35 CraftCMS 3.x Deep Dive Slide 36 CraftCMS 3.x Deep Dive Slide 37 CraftCMS 3.x Deep Dive Slide 38 CraftCMS 3.x Deep Dive Slide 39 CraftCMS 3.x Deep Dive Slide 40 CraftCMS 3.x Deep Dive Slide 41 CraftCMS 3.x Deep Dive Slide 42 CraftCMS 3.x Deep Dive Slide 43 CraftCMS 3.x Deep Dive Slide 44 CraftCMS 3.x Deep Dive Slide 45 CraftCMS 3.x Deep Dive Slide 46 CraftCMS 3.x Deep Dive Slide 47 CraftCMS 3.x Deep Dive Slide 48 CraftCMS 3.x Deep Dive Slide 49 CraftCMS 3.x Deep Dive Slide 50 CraftCMS 3.x Deep Dive Slide 51 CraftCMS 3.x Deep Dive Slide 52 CraftCMS 3.x Deep Dive Slide 53 CraftCMS 3.x Deep Dive Slide 54 CraftCMS 3.x Deep Dive Slide 55 CraftCMS 3.x Deep Dive Slide 56 CraftCMS 3.x Deep Dive Slide 57 CraftCMS 3.x Deep Dive Slide 58 CraftCMS 3.x Deep Dive Slide 59
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0 Likes

Share

Download to read offline

CraftCMS 3.x Deep Dive

Download to read offline

A deep dive through CraftCMS. Yii, routing, data structures, plugins, modules, and more.

https://www.digitalsurgeons.com/craftcms

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

CraftCMS 3.x Deep Dive

  1. 1. deep dive
  2. 2. deep dive[0] Introduction $presentation = array( 'Introduction', 'Yii', 'Request Handling', 'Data Structure', 'Module & Plugin Overview', 'Q&A' );
  3. 3. deep dive[1] Yii
  4. 4. deep dive[1] Yii Yii is an object-oriented
 model-view-controller
 framework for PHP.
  5. 5. deep dive[1] Yii
  6. 6. deep dive[1] Yii }
  7. 7. deep dive[1] Yii Yii provides a way for namespaces applications to interact with each other.
  8. 8. deep dive[1] Yii Yii provides routing.
  9. 9. deep dive[1] Yii Yii provides twig.
  10. 10. deep dive[1] Yii Yii provides error handling.
  11. 11. deep dive[1] Yii Yii provides events.
  12. 12. deep dive[1] Yii provides it's own routing. 🖕🖕
  13. 13. deep dive[1] Yii provides its own twig. 🖕🖕
  14. 14. deep dive[1] Yii doesn't provide it's own error handling. 👍 👍
  15. 15. deep dive[1] Yii doesn't provide it's own events. 👍 👍
  16. 16. deep dive[1] Elements use craftservicesElements;
  17. 17. deep dive[1] Elements In Craft almost everything is an element.
  18. 18. deep dive[2] Request Handling Let's look at an incoming Craft request.
  19. 19. deep dive 0.
 The request will only go to craft if the server routes it to the index.php file. [2] Request Handling
  20. 20. deep dive 1. Is it an action?
 If the URL begins with actions/ it gets routed to a controller. [2] Request Handling
  21. 21. deep dive 1. Is it an action?
 The controller is either built-in, or provided by a module or plugin. [2] Request Handling
  22. 22. deep dive namespace craftcontrollers; use Craft; class UsersController extends Controller { public function actionLogin() { if (!Craft::$app->getUser()->getIsGuest()) { // Too easy. return $this->_handleSuccessfulLogin(false); } } } 1. Is it an action?
 The controller is either built-in, or provided by a module or plugin. GET /actions/users/active POST /
 <input type="hidden" name="action" value="users/save-user"> [2] Request Handling
  23. 23. deep dive 2. Is it an element?
 Does it match an element's URI? [2] Request Handling
  24. 24. deep dive element:
 a thing that can hold data craftelementsAsset craftelementsCategory craftelementsEntry craftelementsGlobalSet craftelementsMatrixBlock craftelementsTag craftelementsUser verbbsupertableelementsSuperTableBlockElement [2] Request Handling
  25. 25. deep dive craft_elements id 28 fieldLayoutId 31 type craftelementsEntry enabled 1 craft_elements_sites id 32 elementId 28 siteId 1 slug about-us uri company/about-us [2] Request Handling
  26. 26. deep dive craft_elements id 28 fieldLayoutId 31 type craftelementsEntry enabled 1 [2] Request Handling
  27. 27. deep dive craft_elements id 28 fieldLayoutId 31 type craftelementsEntry enabled 1 craft_elements_sites id 32 elementId 28 siteId 1 slug about-us uri company/about-us routing uri [2] Request Handling
  28. 28. deep dive 3. Does the URI match a route or URI rule? return [ // Route blog/archive/YYYY to a controller action 'blog/archive/<year:d{4}>' => 'controller/action/path', // Route blog/archive/YYYY to a template 'blog/archive/<year:d{4}>' => ['template' => 'blog/_archive'], ]; config/routes.php <h1>Blog Entries from {{ year }}</h1> [2] Request Handling
  29. 29. deep dive 4. Does the URI match a template? @webroot/templates/single.twig [2] Request Handling
  30. 30. deep dive 4. Does the URI match a template? @webroot/templates/single.twig Yii alias [2] Request Handling
  31. 31. deep dive 5.Well I guess we'll just 404. [2] Request Handling
  32. 32. deep dive[3] Data Structure Let's visualize the CraftCMS DB Structure
  33. 33. deep dive Ok maybe let's not do that. [3] Data Structure
  34. 34. deep dive Let's look at the Wordpress schema. [3] Data Structure
  35. 35. deep dive[4] Module & Plugin Overview Not suited for the complex content architecture we require.
  36. 36. deep dive[4] Module & Plugin Overview Let's talk about plugins.
  37. 37. deep dive Plugins and modules are basically justYii modules (sort of like Craft is!) [4] Module & Plugin Overview
  38. 38. deep dive Plugins: Installed through Composer,
 can be turned on and off in admin.
 (Usually) site-agnostic functionality Modules: Hardcoded into composer andYii configs. Cannot be turned off in admin.
 (Usually) site-specific functionality [4] Module & Plugin Overview
  39. 39. deep dive[4] Module & Plugin Overview
  40. 40. deep dive This is meta because Craft implements all of these things on its own. [4] Module & Plugin Overview
  41. 41. deep dive CSS, JS, and Images needed in the Admin side of Craft [4] Module & Plugin Overview
  42. 42. deep dive Tasks that can be run through the Craft CLI [4] Module & Plugin Overview
  43. 43. deep dive Endpoints that are accessible through a URL path [4] Module & Plugin Overview
  44. 44. deep dive Main application class file. Registers hooks, events, etc [4] Module & Plugin Overview
  45. 45. deep dive New elements (like SuperTable Blocks for example) [4] Module & Plugin Overview
  46. 46. deep dive New fields (like a markdown editor that stores HTML) [4] Module & Plugin Overview
  47. 47. deep dive New queued tasks (like image transformation) [4] Module & Plugin Overview
  48. 48. deep dive Installation / uninstallation migrations [4] Module & Plugin Overview
  49. 49. deep dive A "template" for a custom data structure [4] Module & Plugin Overview
  50. 50. deep dive A way to represent data from a model and define how it is stored / retrieved in the DB [4] Module & Plugin Overview
  51. 51. deep dive The "business logic" of the application/plugin/module [4] Module & Plugin Overview
  52. 52. deep dive Twig templates for the admin side of your plugin [4] Module & Plugin Overview
  53. 53. deep dive Functional additions toTwig (like twig-dig!) [4] Module & Plugin Overview
  54. 54. deep dive Add twig pages that appear under "Utilities" in the Admin [4] Module & Plugin Overview
  55. 55. deep dive Add custom twig variables accessible under the craft namespace. (Like {{ craft.testvariable }}) [4] Module & Plugin Overview
  56. 56. deep dive Widgets for the admin dashboard. [4] Module & Plugin Overview
  57. 57. deep dive[5] Q & A Q&A

A deep dive through CraftCMS. Yii, routing, data structures, plugins, modules, and more. https://www.digitalsurgeons.com/craftcms

Views

Total views

1,191

On Slideshare

0

From embeds

0

Number of embeds

375

Actions

Downloads

12

Shares

0

Comments

0

Likes

0

×