Use prism for code syntax highlighting
This commit is contained in:
parent
356c9dca43
commit
adf3c67355
54 changed files with 471 additions and 324 deletions
|
@ -21,7 +21,7 @@ It supports both the [PSR-0][3] and [PSR-4][4] standards, as well as providing a
|
|||
|
||||
To use it, download and enable it from Drupal.org as you would for any other module, and then add it as a dependency within your module. The xautoload project page suggests including a minimum version in this format:
|
||||
|
||||
```ini
|
||||
```language-ini
|
||||
dependencies[] = xautoload (>= 7.x-5.0)
|
||||
```
|
||||
|
||||
|
@ -33,7 +33,7 @@ This will ensure that the version of xautoload is 7.x-5.0 or newer.
|
|||
|
||||
Here is an example .info file for a migrate module.
|
||||
|
||||
```ini
|
||||
```language-ini
|
||||
; foo_migrate.info
|
||||
|
||||
name = Foo Migration
|
||||
|
@ -49,7 +49,7 @@ In this example, each custom migration class is stored in it’s own file within
|
|||
|
||||
One thing that the xautoload module does to enable for the use of wildcards within this syntax. By using wildcards, the module file can be simplified as follows:
|
||||
|
||||
```
|
||||
```language-ini
|
||||
files[] = includes/**/*.inc
|
||||
```
|
||||
|
||||
|
@ -72,7 +72,7 @@ In order to do so, you’ll need to complete the following steps:
|
|||
|
||||
Now your class may look something like this:
|
||||
|
||||
```php
|
||||
```language-php
|
||||
<?php
|
||||
|
||||
namespace Drupal\foo_migrate\Node;
|
||||
|
@ -88,7 +88,7 @@ With these steps completed, any imports within your .info file can be removed as
|
|||
|
||||
Within `foo_migrate.migrate.inc`, I can now reference any class names using their full namespace:
|
||||
|
||||
```php
|
||||
```language-php
|
||||
$node_arguments['ArticleNode'] = array(
|
||||
'class_name' => 'Drupal\foo_migrate\Node\FooArticleNodeMigration',
|
||||
'source_type' => 'story',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue