This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git commit -m "Text for the commit." --author="davidjguru <davidjguru@1024022.no-reply.drupal.org>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recursive grep | |
$ grep -R -e “string” /path/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Form Example | |
type: module | |
description: Demonstrates how to build a form with Form API | |
package: Custom | |
core: 8.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
formexample_form: | |
path: 'formexample/myform' | |
defaults: | |
_title: 'Form Example Drupal 8' | |
_form: '\Drupal\formexample\Form\FormExample' | |
requirements: | |
_permission: 'access content' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains \Drupal\formexample\Form\FormExample. | |
*/ | |
namespace Drupal\formexample\Form; | |
use Drupal\Core\Form\FormBase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Alter Forms | |
description: Custom module to alter forms | |
package: Development | |
type: module | |
core: 8.x | |
dependencies: | |
- devel:kint | |
- search_kint:search_kint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
*Implements hook_form_alter() | |
*/ | |
function alterforms_form_alter(&$form, $form_state, $form_id) { | |
// Initial zone | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get the Drush Launcher | |
wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar | |
## Make downloaded file executable | |
chmod +x drush.phar | |
## Move drush.phar to a location listed in your $PATH, rename to drush | |
sudo mv drush.phar /usr/local/bin/drush | |
## Update the tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$values = \Drupal::service('name.service')->methodFromService(); |