By admin , 10 May, 2023 Slick slider: margin between slides .slick-list { margin: 0 -24px; } .slick__slide { margin: 0 24px; } Tags slick
By admin , 8 May, 2023 Render form in block <?php namespace Drupal\mymodule\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Co Tags form block
By admin , 4 May, 2023 Inject RouteMatchInterface to ContentEntityForm use Drupal\Core\Routing\RouteMatchInterface; /** * The current route match. * * @var \Drupal\Core\Routing\RouteMatchInterface */ protected $routeMatch; /** * Constructs a PrivatemsgMessageForm object. * * @param \Drupal\Core\En Tags dependency injection routes
By admin , 3 May, 2023 Inject Logger to service use Drupal\Core\Logger\LoggerChannelFactoryInterface; /** * Logger Factory. * * @var \Drupal\Core\Logger\LoggerChannelFactoryInterface */ protected $logger; /** * Constructor. */ public Tags dependency injection logger
By admin , 2 May, 2023 Get all site roles $roles = $this->entityTypeManager->getStorage('user_role')->loadMultiple(); Tags roles
By admin , 27 April, 2023 Move field to hidden region programmatically \Drupal::entityTypeManager() ->getStorage('entity_view_display') ->load('user.user.default') ->setComponent('field_notify', [ 'region' => 'hidden', ])->save(); Tags field
By admin , 27 April, 2023 Change field form settings programmatically \Drupal::entityTypeManager() ->getStorage('entity_form_display') ->load('user.user.default') ->setComponent('field__notify', [ 'type' => 'boolean_checkbox', 'weight' => 6, 'settings' => ['display_label' => Tags field
By admin , 27 April, 2023 Remove config when the module is uninstalled /** * Implements hook_uninstall(). */ function mymodule_uninstall($is_syncing) { \Drupal::configFactory()->getEditable('CONFIG_NAME')->delete(); } Tags config
By admin , 27 April, 2023 Use service in the .module file with PHPStorm autocomplete /** @var \Drupal\privatemsg\PrivateMsgService $privatemsg_service */ $privatemsg_service = \Drupal::service('privatemsg.common'); Tags service phpstorm