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_uninstall(). | |
*/ | |
function drupal_way_test_uninstall() { | |
// Remove the all module tables. | |
drupal_uninstall_schema('drupal_way_test'); | |
// Remove the all module variables. | |
// variable_del('drupal_way_test_...'); | |
// variable_del('drupal_way_test_...'); |
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
function demo_drupal_way_hierarchical_select_form_submit($form, $form_state) { | |
if ($form_state['triggering_element']['#name'] == 'submit') { | |
$term_names = array(); | |
foreach ($form_state['values']['items'] as $tid) { | |
$term = taxonomy_term_load($tid); | |
if (isset($term->name)) { | |
$term_names[] = $term->name; | |
} | |
} | |
drupal_set_message(t('You entered the next location: @loc', array('@loc' => implode(', ', $term_names)))); |
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 // Del the tag. | |
/** | |
* Making the Admin menu work! | |
*/ | |
$conf['admin_menu_cache_client'] = FALSE; | |
// Share sessions between HTTP and HTTPS hosts. | |
$conf['https'] = FALSE; | |
$conf['securepages_enable'] = 0; | |
// Name of folder in sites. | |
$sites_folder = 'default'; |
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 | |
* Install | |
*/ | |
/** | |
* Implements hook_uninstall(). | |
*/ | |
function MODULE_uninstall() { |
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
/** | |
* Include settings.local.php. | |
*/ | |
if (file_exists(__DIR__ . '/settings.local.php')) { | |
include __DIR__ . '/settings.local.php'; | |
} |
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 | |
// Get current router name. | |
$current_router = \Drupal::routeMatch()->getRouteName(); |
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 | |
$tree = \Drupal::entityTypeManager()->getStorage('tags')->loadTree('error_code', $parent = 0, $max_depth = NULL, $load_entities = FALSE); |
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 | |
$field_value = $entity->get('field_name')->getString(); |
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 | |
use Drupal\file\Entity\File; | |
use Drupal\image\Entity\ImageStyle; | |
// File ID. | |
$fid = 123; | |
// Load file. | |
$file = File::load($fid); | |
// Get origin image URI. | |
$image_uri = $file->getFileUri(); | |
// Load image style "thumbnail". |
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 | |
// Load term by name | |
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['name' => 'some_name']); |
OlderNewer