public static function ViewsAddButtonNode::generateUrl in Views Add Button 8
Same name and namespace in other branches
- 2.0.x src/Plugin/views_add_button/ViewsAddButtonNode.php \Drupal\views_add_button\Plugin\views_add_button\ViewsAddButtonNode::generateUrl()
Generate the add button URL.
Parameters
string $entity_type: Entity type ID.
string $bundle: Bundle ID.
array $options: Array of options to be passed to the Url object.
string $context: Module-specific context string.
Return value
\Drupal\Core\Url Url object which is used to construct the add button link
File
- src/
Plugin/ views_add_button/ ViewsAddButtonNode.php, line 65
Class
- ViewsAddButtonNode
- Node plugin for Views Add Button.
Namespace
Drupal\views_add_button\Plugin\views_add_buttonCode
public static function generateUrl($entity_type, $bundle, array $options, $context = '') {
// Create URL from the data above.
$url = Url::fromRoute('node.add', [
'node_type' => $bundle,
], $options);
return $url;
}