We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thanks for sharing your code , i want to tell you about a cache problem in this model after a lot of search i found a solution , this is my solution :
public function build() { $node = \Drupal::request()->attributes->get('node'); $created_time = 0; if ($node instanceof \Drupal\node\NodeInterface) { $created_time = $node->getCreatedTime(); } $link = ""; $link .= $this->generatePrevious($created_time); $link .= $this->generateNext($created_time); $build = array(); $build['#markup'] = $link; $build['#cache']['max-age'] = 0; return $build; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
thanks for sharing your code , i want to tell you about a cache problem in this model after a lot of search i found a solution , this is my solution :
public function build() {
$node = \Drupal::request()->attributes->get('node');
$created_time = 0;
if ($node instanceof \Drupal\node\NodeInterface) {
$created_time = $node->getCreatedTime();
}
$link = "";
$link .= $this->generatePrevious($created_time);
$link .= $this->generateNext($created_time);
$build = array();
$build['#markup'] = $link;
$build['#cache']['max-age'] = 0;
return $build;
}
The text was updated successfully, but these errors were encountered: