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 | |
$foo = NULL; | |
var_dump(isset($foo)); | |
var_dump(isset($bar)); | |
// gibt in beiden Fällsen "false" zurück |
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 | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { | |
$fields = parent::baseFieldDefinitions($entity_type); | |
$fields['my_vid'] = BaseFieldDefinition::create('integer') |
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
uuid: fb63811a-5555-4101-97ae-de49656cf585 | |
langcode: de | |
status: true | |
dependencies: | |
config: | |
- image.style.thumbnail | |
module: | |
- image | |
- media | |
- user |
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
$form['foobar'] = array( | |
'#type' => 'select', | |
'#title' => t('FooBar'), | |
'#options' => array( | |
'foo' => t('Foo), | |
'bar' => t('Bar), | |
), | |
'#default_value' => 'foo', | |
'#value' => 'bar', | |
); |
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 mymodule_form_alter(&$form, &$form_state, $form_id) { | |
switch($form_id) { | |
case 'views_exposed_form': | |
$form['additional_buttons'] = array( | |
'#type' => 'fieldset', | |
'#collapsible' => FALSE, | |
'#printed' => TRUE, | |
); |
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 | |
// I need nodes where file field "field_images" is empty | |
$query = new EntityFieldQuery(); | |
$query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'real_estate') | |
->fieldCondition('field_images', 'fid', 'NULL', '=') | |
->addMetaData('account', user_load(1)); // Run the query as user 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
// This is not a hook - it's a custom function' | |
function THEMENAME_childtree($mlid, $menu='main-menu') { | |
$tree = menu_tree_all_data($menu); | |
foreach($tree as $child){ | |
if($child['link']['mlid'] == $mlid){ | |
return drupal_render(menu_tree_output($child['below'])); | |
} | |
} | |
} |