buildTagName() 공개 정적인 메소드

public static buildTagName ( $type, $name, null $document = null ) : string
$type
$name
$document null
리턴 string
예제 #1
0
파일: View.php 프로젝트: jjpeters67/pimcore
 /**
  * @param $type
  * @param $realName
  * @param array $options
  * @return Model\Document\Tag
  */
 public function tag($type, $realName, $options = array())
 {
     $type = strtolower($type);
     $document = $this->document;
     $name = Model\Document\Tag::buildTagName($type, $realName, $document);
     try {
         if ($document instanceof Model\Document\PageSnippet) {
             $tag = $document->getElement($name);
             if ($tag instanceof Model\Document\Tag && $tag->getType() == $type) {
                 // call the load() method if it exists to reinitialize the data (eg. from serializing, ...)
                 if (method_exists($tag, "load")) {
                     $tag->load();
                 }
                 // set view & controller, editmode
                 $tag->setController($this->controller);
                 $tag->setView($this);
                 $tag->setEditmode($this->editmode);
                 $tag->setOptions($options);
             } else {
                 $tag = Model\Document\Tag::factory($type, $name, $document->getId(), $options, $this->controller, $this, $this->editmode);
                 $document->setElement($name, $tag);
             }
             // set the real name of this editable, without the prefixes and suffixes from blocks and areablocks
             $tag->setRealName($realName);
         }
         return $tag;
     } catch (\Exception $e) {
         \Logger::warning($e);
     }
 }