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
if (class_exists('Memcached', FALSE)) { | |
$class_loader->addPsr4('Drupal\\memcache\\', 'modules/contrib/memcache/src'); | |
$settings['bootstrap_container_definition'] = [ | |
'parameters' => [], | |
'services' => [ | |
'settings' => [ | |
'class' => 'Drupal\Core\Site\Settings', | |
'factory' => 'Drupal\Core\Site\Settings::getInstance', | |
], |
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 = FieldConfig::loadByName('node', 'BUNDLE', 'FIELD')->getSetting('allowed_values'); |
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 | |
namespace Drupal\my_module\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; | |
/** | |
* Class TestAjaxFormSelect. | |
*/ |
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\hello_world\Form\AddAnotherItem. | |
*/ | |
namespace Drupal\hello_world\Form; | |
use Drupal\Core\Form\FormBase; | |
use Drupal\Core\Form\FormStateInterface; |
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\Core\Menu\MenuLinkTreeInterface; | |
use Drupal\Core\Menu\MenuTreeParameters; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
/** | |
* The menu link tree service. | |
* | |
* @var \Drupal\Core\Menu\MenuLinkTree |
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
# | |
# This is an example VCL file for Varnish. | |
# | |
# It does not do anything by default, delegating control to the | |
# builtin VCL. The builtin VCL is called when there is no explicit | |
# return statement. | |
# | |
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ | |
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples. |
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
Step #1 | |
Cretae file in the next path /usr/bin/localhost_sendmail | |
Step #2 | |
Add to the new file this below content: | |
#!/bin/sh | |
prefix="/var/mail/sendmail" |
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": "drupal/drupal", | |
"description": "Drupal is an open source content management platform powering millions of websites and applications.", | |
"type": "project", | |
"license": "GPL-2.0-or-later", | |
"require": { | |
"composer/installers": "^1.0.24", | |
"wikimedia/composer-merge-plugin": "^1.4", | |
"cweagans/composer-patches": "^1.6", | |
"symfony/var-dumper": "3.*", |
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_preprocess_views_view_field(). | |
*/ | |
function MODULE_preprocess_views_view_field(&$variables) { | |
/** @var \Drupal\views\ViewExecutable $view */ | |
$view = $variables['view']; | |
if ($view->id() == 'schedule') { | |
if ($view->current_display == 'embed_1') { |
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 | |
$manager = \Drupal::entityTypeManager()->getStorage('taxonomy_term'); | |
$tree = $manager->loadTree('VOC_NAME', 0, 0, TRUE); | |
foreach ($tree as $term) { | |
$term->setWeight(0); | |
$term->save(); | |
} |
NewerOlder