drupal8-oop

所属分类:collect
开发工具:PHP
文件大小:0KB
下载次数:0
上传日期:2018-06-03 18:36:16
上 传 者sh-1993
说明:  PHP面向对象编程基础教程
(Tutorial for object-oriented programming fundamentals in PHP)

文件列表:
01-Basics/ (0, 2018-06-03)
01-Basics/examples.php (1290, 2018-06-03)
02-Visibility-and-scope/ (0, 2018-06-03)
02-Visibility-and-scope/private-examples.php (981, 2018-06-03)
02-Visibility-and-scope/protected-examples.php (1169, 2018-06-03)
02-Visibility-and-scope/public-examples.php (891, 2018-06-03)
02-Visibility-and-scope/static-examples.php (379, 2018-06-03)
03-This-and-self/ (0, 2018-06-03)
03-This-and-self/self-examples.php (513, 2018-06-03)
03-This-and-self/this-examples.php (869, 2018-06-03)
04-Construct/ (0, 2018-06-03)
04-Construct/examples.php (406, 2018-06-03)
05-Class-inheritance-and-parent/ (0, 2018-06-03)
05-Class-inheritance-and-parent/examples.php (982, 2018-06-03)
06-Naming-conventions/ (0, 2018-06-03)
07-Including-and-autoloading/ (0, 2018-06-03)
07-Including-and-autoloading/Animal.php (486, 2018-06-03)
07-Including-and-autoloading/examples.php (547, 2018-06-03)
08-Explaining-namespacing/ (0, 2018-06-03)
09-Using-namespacing/ (0, 2018-06-03)
10-Type-hinting/ (0, 2018-06-03)
10-Type-hinting/Animal.php (486, 2018-06-03)
10-Type-hinting/examples.php (1618, 2018-06-03)
11-Interfaces/ (0, 2018-06-03)
11-Interfaces/examples.php (2165, 2018-06-03)
12-Abstract-classes/ (0, 2018-06-03)
12-Abstract-classes/examples.php (1654, 2018-06-03)
13-Traits/ (0, 2018-06-03)
... ...

# 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

近期下载者

相关文件


收藏者