In Depth Guide : Acquia Certified Developer Drupal
  • IN DEPTH GUIDE: ACQUIA CERTIFIED DEVELOPER - DRUPAL 8 EXAM
  • Test Format
  • Domain 1.0: Fundamental Web Development Concepts
    • 1.1 Demonstrate knowledge of HTML and CSS
    • 1.2 Identify Javascript and jQuery programming concepts
    • 1.3 Demonstrate the use of Git for version control
  • Domain 2.0: Site Building
    • 2.1 Demonstrate ability to create and configure Content Types with appropriate fields and field sett
    • 2.2 Demonstrate ability to configure Display Modes for building custom form and view modes for core
    • 2.3 Demonstrate ability to create and use Taxonomy vocabularies and terms for classification and org
    • 2.4 Demonstrate ability to configure Block types, manage Blocks library and configure Block layouts
    • 2.5 Demonstrate ability to build main and alternative navigation systems by using Menus
    • 2.6 Demonstrate ability to create and configure Views for building content list pages, blocks and fe
    • 2.7 Demonstrate ability to use Configuration Management capabilities for exporting site configuratio
    • 2.8 Demonstrate ability to build multilingual websites using core multilingual capabilities
    • 2.9 Demonstrate ability to build RESTful web application using core Web Services capabilities
  • Domain 3.0: Front end development (theming)
    • 3.1 Given a scenario, demonstrate ability to create a custom theme or sub theme.
    • 3.2 Demonstrate knowledge of theming concepts
    • 3.3 Demonstrate ability to use Twig syntax
    • 3.4 Demonstrate ability to build or override Twig templates for defining layout content
    • 3.5 Demonstrate ability to write template pre-process functions for overriding custom output
  • Domain 4.0: Back end development (coding)
    • 4.1 Demonstrate ability to write code using core and Object Oriented PHP
    • 4.2 Demonstrate ability to develop Custom Modules using Drupal API for extending Drupal functionalit
    • 4.3 Demonstrate ability to store and retrieve data using code
    • 4.4 Demonstrate ability to work with other essential APIs
    • 4.5 Demonstrate ability to write code using Drupal Coding Standards
    • 4.6 Demonstrate ability to analyze and resolve site performance issues arising from site configurati
    • 4.7 Demonstrate ability to analyze and resolve security issues arising from site configuration or cu
  • Other Resources
Powered by GitBook
On this page
  • Indenting and Whitespace
  • Annotations
  • Naming Conventions
  • Other Resources
  1. Domain 4.0: Back end development (coding)

4.5 Demonstrate ability to write code using Drupal Coding Standards

Previous4.4 Demonstrate ability to work with other essential APIsNext4.6 Demonstrate ability to analyze and resolve site performance issues arising from site configurati

Last updated 7 years ago

Review Drupal Coding Standards such as line spacing between @doc blocks. Review PHP constants.

A Review of some key .

Indenting and Whitespace

  • Use an indent of 2 spaces, with no tabs.

  • Lines should have no trailing whitespace at the end.

  • One line space between namespace and use statements same with annotations and classes.

Annotations

Annotations are formatted docblocks that use to autoload classes into memory. In Drupal 8 they are used for plugin discovery metadata and configuration.

For example the in the core telephone field module annotation block

/**
 * Plugin implementation of the 'telephone_link' formatter.
 *
 * @FieldFormatter(
 *   id = "telephone_link",
 *   label = @Translation("Telephone link"),
 *   field_types = {
 *     "telephone"
 *   }
 * )
 */

Naming Conventions

Coding standards ensure that a team can cohesively work together on maintainable code. A few naming conventions to note are:

  • classes: UpperCamel Classes should not use underscores.

  • methods: lowerCamel

  • variables: $lowerCamelCase or $snake_case

  • PHP constants: always uppercase const CACHE_TEMPORARY = -1;

Other Resources

See more at .

Drupal.org Drupal Standards
PS4
TelephoneLinkFormatter
on Drupal.org's Object-oriented code
Drupal.org Namespaces
Drupal.org Drupal Standards
Drupalize.me Understanding the Drupal Coding Standards video