All Projects → david-hernandez → drupal8-oop

david-hernandez / drupal8-oop

Licence: other
Tutorial for object-oriented programming fundamentals in PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to drupal8-oop

drupal8-vagrant
Simple Drupal 8 Development Environment
Stars: ✭ 59 (+59.46%)
Mutual labels:  drupal, drupal-8
dkan2
Deprecated: please use the 2.x branch of the dkan repo
Stars: ✭ 17 (-54.05%)
Mutual labels:  drupal, drupal-8
apigee-devportal-kickstart-drupal
A fast demo and starting point for Apigee Developer Portals for Drupal
Stars: ✭ 21 (-43.24%)
Mutual labels:  drupal, drupal-8
composer-tutorial
A walk through of various Composer tasks
Stars: ✭ 40 (+8.11%)
Mutual labels:  drupal, drupal-8
migrate source example
Example module for Drupal 8 that provides migrations of users, terms, files and nodes from database, JSON resources, CSV and XML files. #migrate
Stars: ✭ 39 (+5.41%)
Mutual labels:  drupal, drupal-8
drupal-composer-init
Initialise a Drupal composer setup
Stars: ✭ 43 (+16.22%)
Mutual labels:  drupal, drupal-8
DrupalTwigFood
Useful functions, filters for twig @ Drupal 8
Stars: ✭ 1 (-97.3%)
Mutual labels:  drupal, drupal-8
drupal-jsonapi-params
A package to manage json-api params
Stars: ✭ 42 (+13.51%)
Mutual labels:  drupal, drupal-8
shila-drupal-theme
Atomic design and Pattern Lab friendly, component-based, fairly unopinionated starting point for new Drupal themes
Stars: ✭ 81 (+118.92%)
Mutual labels:  drupal, drupal-8
drupal8-composer-template
Project template for Drupal 8 projects with composer | Quick installation via "composer create-project woprrr/drupal8-composer-template:8.3.0"
Stars: ✭ 27 (-27.03%)
Mutual labels:  drupal, drupal-8
DrupalDriver
A collection of drivers for controlling Drupal.
Stars: ✭ 64 (+72.97%)
Mutual labels:  drupal, drupal-8
varbase
Built using Drupal 8/9, an enterprise website builder platform that combines powerful editorial features, mobile, lead-generation, SEO, social media integration, and beautiful bespoke designs. Varbase is packed with adaptive functionalities and essential modules.
Stars: ✭ 75 (+102.7%)
Mutual labels:  drupal, drupal-8
drupal-circleci-behat
Test and deploy Drupal 9 with CircleCI 2.0 and Behat 3
Stars: ✭ 17 (-54.05%)
Mutual labels:  drupal, drupal-8
gatsby-drupal-kit
A Gatsby V2 starter kit designed to work with a new Drupal 8 site.
Stars: ✭ 23 (-37.84%)
Mutual labels:  drupal, drupal-8
apigee-api-catalog-drupal
Manage your API catalog within Drupal's content management approach
Stars: ✭ 17 (-54.05%)
Mutual labels:  drupal, drupal-8
drupal-react-image-gallery
Drupal 8 module that provides a dynamic Image Gallery based on the react-image-gallery component.
Stars: ✭ 13 (-64.86%)
Mutual labels:  drupal, drupal-8
fractal-twig-drupal-adapter
Twig template adapter for Fractal with Drupal 8 directives.
Stars: ✭ 13 (-64.86%)
Mutual labels:  drupal, drupal-8
distros.bid
A saas to create drupal websites in seconds using docker containers.
Stars: ✭ 16 (-56.76%)
Mutual labels:  drupal, drupal-8
drupal8-employee-crud-module
No description or website provided.
Stars: ✭ 16 (-56.76%)
Mutual labels:  drupal, drupal-8
docker-drupal
Docker scaffolding for Drupal 8
Stars: ✭ 41 (+10.81%)
Mutual labels:  drupal, drupal-8

Drupal 8 Object-oriented Programming Fundamentals

This tutorial is intended to help those who are new to object-oriented programming (OOP) and struggling with the fundamentals needed for Drupal 8 development. Drupal 8 is a huge OOP shift compared to the procedural programming of previous versions of Drupal.

Almost everything in this tutorial is specific to PHP, not necessarily Drupal. Any PHP developer may find it helpful, but be aware that some of the examples and application-specific details will be based on Drupal 8.

Prerequisites

Many of the topics covered are introductory, and written for a beginner, but you should have some prior PHP experience. Also, this tutorial is not intended to take the place of a generic, introductory OOP tutorial. This is intended to supplement any existing one, and explain some of the details you didn't understand.

Limitations

This tutorial will not cover all use cases and minute technical details. It aims for general usage.

For the Drupal folks, this is not a module development guide. This will help you in your module development, but do not expect an explanation of plugins, services, and whatnot.

If you are using an IDE, like PHP Storm, it may alert you to problems with some of the classes. This is because it sees the classes in all the directories and may think they are duplicate. The scripts themselves should run fine when executing.

The PHP files provided in this tutorial should be executable, but your results may vary. And, as always, if you find any mistakes, please open an issue or create a pull request. Don't assume I know what I'm doing.™

Contents

  • 01 - Methods, properties, the arrow (->) and double colon (::) operators
  • 02 - Public, protected, private, and static keywords
  • 03 - $this and self
  • 04 - __construct methods
  • 05 - How classes work together, inherit methods and properties, and parent
  • 06 - Naming conventions for classes, methods, variables, constants, etc
  • 07 - Including classes from other files and using an autoloader
  • 08 - Namespacing and how it relates to the autoloader
  • 09 - Using namespaces, use statements, and more on the global space
  • 10 - Declaring parameter types in method and function definitions
  • 11 - Interfaces
  • 12 - Abstract classes, and using them as base classes
  • 13 - Using traits to reuse code
  • 14 - Using factories to generate objects
  • 15 - Late static binding and how it works with Drupal's dependency injection
  • 16 - Tips to help you on your journey
  • 17 - Common error messages
  • 18 - Let's take all we've learned and build an application
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].