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
| {% set link = "/job/#{fields.id.content}" %} | |
| {% set fll_name = "#{fields.field_first_name.content} #{fields.field_last_name.content}" %} |
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
| Drupal.CTools.Modal.dismiss(); | |
| $form['cancel'] = array( | |
| '#type' => 'button', | |
| '#value' => t('Cancel'), | |
| '#attributes' => array('onClick' => 'Drupal.CTools.Modal.dismiss();'), | |
| ); |
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
| /** | |
| * Implements hook_preprocess_block(&$variables). | |
| */ | |
| function icareix_global_preprocess_block(&$variables) { | |
| if ($variables['elements']['#plugin_id'] == 'system_branding_block') { | |
| // Select front page by user role. | |
| $current_user = \Drupal::currentUser(); | |
| $current_uid = $current_user->id(); | |
| $config = \Drupal::config('icareix_global.FrontPageByRole'); | |
| $url = \Drupal::config('system.site')->get('page.front'); |
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
| \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/job/1')->save(); |
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
| $route = \Drupal::service('current_route_match'); | |
| $route_name = $route->getRouteName(); | |
| $invoice_id = $route->getRawParameter('invoice'); | |
| $invoice_url = \Drupal\Core\Url::fromRoute($route_name, ['invoice' => $invoice_id], ['absolute' => TRUE])->toString(); |
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
| $route = \Drupal::service('current_route_match'); | |
| $job_id = $route->getRawParameters()->getInt('job'); |
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
| $route_name = \Drupal::service('current_route_match')->getRouteName(); |
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
| // from entity | |
| $tags = \Drupal::entityTypeManager()->getStorage('job')->load(1)->getCacheTags(); | |
| // from views | |
| $tags = \Drupal\views\Entity\View::load('front')->getCacheTags(); |
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
| // Clean local task cache by tag. | |
| \Drupal\Core\Cache\Cache::invalidateTags(['config:block.block.icareix_local_tasks']); |
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
| $url = 'url'; | |
| $url_object = \Drupal::service('path.validator')->getUrlIfValid($url); | |
| $route = $url_object->getRouteName(); |