interface IRender

Interface for all render array managers.

UML: IRender

Visit also:

@author darrenkelly

Hierarchy

  • interface \Drupal\ooe\Render\IRender

Expanded class hierarchy of IRender

All classes that implement IRender

File

lib/Drupal/ooe/Render/IRender.php, line 23
IRender

Namespace

Drupal\ooe\Render
View source
interface IRender {

  /**
   * Builds and returns a Drupal render array.
   *
   * @return array
   *   A Drupal render array.
   */
  public function get();

  /**
   * Sets the render prefix.
   *
   * Prefer @link IRender::setWrapperTag @endlink(ITag)
   * over use of freestyle, error prone XHTML strings !
   *
   * @see drupal_render(&$elements);
   *
   * @param string $prefix
   *   The render prefix; may contain HTML.
   *
   * @return IRender
   *   This.
   */
  public function setPrefix($prefix);

  /**
   * Sets the render suffix.
   *
   * Prefer @link IRender::setWrapperTag @endlink(ITag)
   * over use of freestyle, error prone XHTML strings !
   *
   * @see drupal_render(&$elements);
   *
   * @param string $suffix
   *   The render prefix; may contain HTML. May be null.
   *
   * @return IRender
   *   This.
   */
  public function setSuffix($suffix);

  /**
   * If this has a wrapper tag, it will be used to build a prefix.
   *
   * Otherwise the prefix as explictly set will be used.
   *
   * @return string
   *   The prefix.
   */
  public function getPrefix();

  /**
   * If this has a wrapper tag, it will be used to build a suffix.
   *
   * Otherwise the suffix as explictly set will be used.
   *
   * @return string
   *   The suffix.
   */
  public function getSuffix();

  /**
   * Sets a wrapper tag.
   *
   * Will be used
   * to generate the prefix and suffix of this.
   *
   * This is an extremely important operation
   * in the OOE render object strategy, because
   * it enables one to essentially associate
   * a managed XHTML tag, including its attributes,
   * with a portion of a Drupal render array.
   *
   * This approach is far less error prone than
   * using freestyle XHTML strings in
   * @link IRender::setPrefix @endlink(string) and
   * @link IRender::setSuffix @endlink(string),
   * and should be preferred over those operations
   * whenever possible.
   *
   * It is particularly powerful when coupled
   * with the convenient creation methods of
   * @link IRenderFactory @endlink.
   *
   * @param ITag $tag
   *   The XHTML tag holder.
   *
   * @return IRender
   *   This.
   */
  public function setWrapperTag(ITag $tag);
}

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
IRender::get public function Builds and returns a Drupal render array.
IRender::getPrefix public function If this has a wrapper tag, it will be used to build a prefix.
IRender::getSuffix public function If this has a wrapper tag, it will be used to build a suffix.
IRender::setPrefix public function Sets the render prefix.
IRender::setSuffix public function Sets the render suffix.
IRender::setWrapperTag public function Sets a wrapper tag.