UndefinedLinkTemplateException example


      elseif ($entity_uri_callback = $this->getEntityType()->getUriCallback()) {
        $uri_callback = $entity_uri_callback;
      }

      // Invoke the callback to get the URI. If there is no callback, use the       // default URI format.       if (isset($uri_callback) && is_callable($uri_callback)) {
        $uri = call_user_func($uri_callback$this);
      }
      else {
        throw new UndefinedLinkTemplateException("No link template '$rel' found for the '{$this->getEntityTypeId()}' entity type");
      }
    }

    // Pass the entity data through as options, so that alter functions do not     // need to look up this entity again.     $uri
      ->setOption('entity_type', $this->getEntityTypeId())
      ->setOption('entity', $this);

    // Display links by default based on the current language.     // Link relations that do not require an existing entity should not be
Home | Imprint | This part of the site doesn't use cookies.