This file contains hidden or 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
| opendb () { | |
| [ ! -f .env ] && { echo "No .env file found."; exit 1; } | |
| DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
| DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
| DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
| DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
| DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
| DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) |
This file contains hidden or 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 render_menu_navigation($menu_name,$theme_alter = ''){ | |
| //Set system menu mobile | |
| $menu_tree = \Drupal::menuTree(); | |
| // Build the typical default set of menu tree parameters. | |
| $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name); | |
| // Load the tree based on this set of parameters. | |
| $tree = $menu_tree->load($menu_name, $parameters); | |
| // Transform the tree using the manipulators you want. | |
| $manipulators = array( |
This file contains hidden or 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 _load_header_image($variables) { | |
| if ($node = $variables['node']) { | |
| // Load main_image | |
| $file = $node->field_main_image->entity; | |
| if ($file) { | |
| $variables = array( | |
| 'responsive_image_style_id' => 'header_image', | |
| 'uri' => $file->getFileUri(), |