Drupal 8  8.0.2
NodeController Class Reference
Inheritance diagram for NodeController:

Public Member Functions

 __construct (DateFormatterInterface $date_formatter, RendererInterface $renderer)
 
 addPage ()
 
 add (NodeTypeInterface $node_type)
 
 revisionShow ($node_revision)
 
 revisionPageTitle ($node_revision)
 
 addPageTitle (NodeTypeInterface $node_type)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $dateFormatter
 
 $renderer
 

Detailed Description

Returns responses for Node routes.

Constructor & Destructor Documentation

__construct ( DateFormatterInterface  $date_formatter,
RendererInterface  $renderer 
)

Constructs a NodeController object.

Parameters
\Drupal\Core\Datetime\DateFormatterInterface$date_formatterThe date formatter service.
\Drupal\Core\Render\RendererInterface$rendererThe renderer service.

Member Function Documentation

add ( NodeTypeInterface  $node_type)

Provides the node submission form.

Parameters
\Drupal\node\NodeTypeInterface$node_typeThe node type entity for the node.
Returns
array A node submission form.

References Drupal\entityManager(), and EntityInterface\id().

Here is the call graph for this function:

addPage ( )

Displays add content links for available content types.

Redirects to node/add/[type] if only one content type is available.

Returns
array| A render array for a list of the node types that can be added; however, if there is only one node type defined for the site, the function will return a RedirectResponse to the node add page for that one node type.

References Drupal\entityManager().

Here is the call graph for this function:

addPageTitle ( NodeTypeInterface  $node_type)

The _title_callback for the node.add route.

Parameters
\Drupal\node\NodeTypeInterface$node_typeThe current node.
Returns
string The page title.

References EntityInterface\label(), and t().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{Instantiates a new instance of this class.This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe service container this instance should use.
}

Implements ContainerInjectionInterface.

revisionPageTitle (   $node_revision)

Page title callback for a node revision.

Parameters
int$node_revisionThe node revision ID.
Returns
string The page title.

References Drupal\entityManager(), format_date(), and t().

Here is the call graph for this function:

revisionShow (   $node_revision)

Displays a node revision.

Parameters
int$node_revisionThe node revision ID.
Returns
array An array suitable for drupal_render().

References Drupal\entityManager().

Here is the call graph for this function:


The documentation for this class was generated from the following file: