start new:
tmux
start new with session name:
tmux new -s myname
| <?php | |
| function helloworld_multistep_example_form($form, &$form_state) | |
| { | |
| // We add 2 keys to form_state ("step" and "state") to keep track | |
| // of state in a multistep form. | |
| $step = isset($form_state['step'])? ($form_state['step']) : (1); | |
| $form['heading'] = array( | |
| '#type' => 'markup', |
| <?php | |
| /** | |
| * @file | |
| * Defines a dropdown widget for integer fields. | |
| */ | |
| namespace Drupal\nba_content_core\Plugin\Field\FieldWidget; | |
| use Drupal\Core\Field\FieldFilteredMarkup; | |
| use Drupal\Core\Field\FieldItemListInterface; |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| <?php | |
| // Delete all nodes. | |
| entity_delete_multiple('node', \Drupal::entityQuery('node')->execute()); | |
| // Delete all files. | |
| entity_delete_multiple('file', \Drupal::entityQuery('file')->execute()); | |
| // Delete all taxonomy terms. | |
| entity_delete_multiple('taxonomy_term', \Drupal::entityQuery('taxonomy_term')->execute()); |
| <?php | |
| namespace Drupal\sd8_migration\Plugin\migrate\source; | |
| use Drupal\migrate\Plugin\migrate\source\SqlBase; | |
| /** | |
| * Table source from database. | |
| * |
| <?php | |
| namespace Drupal\my_module\Services; | |
| use Drupal\Core\Config\ConfigFactory; | |
| /** | |
| * Class MyService. | |
| * | |
| * @package Drupal\my_module\Services |
| <?php | |
| /** | |
| * Set redis configuration. | |
| */ | |
| /** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */ | |
| if (extension_loaded('redis')) { | |
| // Set Redis as the default backend for any cache bin not otherwise specified. | |
| // $settings['cache']['default'] = 'cache.backend.redis'; |
| # Taxonomy terms: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
| # Menu links: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
| # File items: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
| # Nodes: |