By editor, 23 December, 2015 Page Redirection on Drupal 8 / 9 Tags Drupal 8 Code Drupal 9 Example 1. Redirect to the front page: return new \Symfony\Component\HttpFoundation\RedirectResponse(\Drupal::url('<front>')); Example 2. Redirect to a route path (user page):
By editor, 22 December, 2015 Create and Render link in drupal_set_message Tags Drupal 8 Code Example : Password Reset Link. $link = \Drupal::l(t('Link'), \Drupal\Core\Url::fromRoute('user.pass')); drupal_set_message(t("Password Reset Link : @link!", ['@link!' => $link]));
By editor, 18 December, 2015 Filter input text with Drupal Text Formats Tags Drupal 8 Code Like Drupal 7, you can use check_markup(); CAUTION : This must only use on a rendered HTML page
By editor, 17 December, 2015 Move a file in drupal 8 Tags Drupal 8 Code file_move(FileInterface $source, $destination = NULL, $replace = FILE_EXISTS_RENAME) Example: $file = \Drupal\file\Entity\File::load($fid); file_move(FileInterface $source, 'path/to/destination');
By editor, 17 December, 2015 Create a static progress bar on drupal 8 Tags Drupal 8 Code Theming The easiest way is use html default progress bar like: <progress value='$percentage' max='100'></progress> And theme with CSS.