当前位置: 首页>>代码示例>>PHP>>正文


PHP Tag::getName方法代码示例

本文整理汇总了PHP中Tag::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::getName方法的具体用法?PHP Tag::getName怎么用?PHP Tag::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tag的用法示例。


在下文中一共展示了Tag::getName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setTags

 /**
  * @param array $tags
  */
 public function setTags(array $tags)
 {
     foreach ($tags as $tag) {
         $tag = new Tag($tag);
         $this->tags[$tag->getName()] = $tag;
     }
 }
开发者ID:freyr,项目名称:gallery,代码行数:10,代码来源:Photo.php

示例2: __toString

 public function __toString()
 {
     if (isset($this->pointer)) {
         $tag_name = Tag::getName($this->tag);
         return isset($this->symbol_table) ? "[" . $tag_name . ", " . $this->symbol_table->get($this->pointer) . "]" : "[" . $tag_name . ", " . $this->pointer . "]";
     }
     return "[" . $this->tag . "]";
 }
开发者ID:quack,项目名称:quack,代码行数:8,代码来源:Token.php

示例3: renderTagHead

 public function renderTagHead(Tag $tag)
 {
     $res = '## [' . $tag->getName() . ']';
     if ($tag->getDate()) {
         $res .= ' - ' . $tag->getDate();
     }
     return $res . "\n";
 }
开发者ID:hiqdev,项目名称:chkipper,代码行数:8,代码来源:MarkdownRenderer.php

示例4: __construct

 public function __construct(AbstractObject $parent, $summary = '', Tag $tag = null)
 {
     parent::__construct($parent);
     $this->summary = $summary;
     $this->operationid = uniqid('', true);
     //@todo getSwagger()->title -> Do some complex construction?
     if ($tag) {
         $this->tags[] = $tag->getName();
     }
 }
开发者ID:skystebnicki,项目名称:PHPSwaggerGen,代码行数:10,代码来源:Operation.php

示例5: shouldBeTogether

 /**
  * Should the given tags be kept together, or kept apart?
  *
  * @param Tag $first
  * @param Tag $second
  *
  * @return bool
  */
 public static function shouldBeTogether(Tag $first, Tag $second)
 {
     $firstName = $first->getName();
     $secondName = $second->getName();
     if ($firstName === $secondName) {
         return true;
     }
     foreach (self::$groups as $group) {
         if (in_array($firstName, $group, true) && in_array($secondName, $group, true)) {
             return true;
         }
     }
     return false;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:22,代码来源:TagComparator.php

示例6: testCreate

 public function testCreate()
 {
     $tag = new Tag('a');
     $this->assertSame("a", $tag->getName());
     $this->assertSame("<a></a>", $tag->render());
     $tag->href = "TEST";
     $this->assertSame('<a href="TEST"></a>', $tag->render());
     $img = new Tag('img');
     $this->assertSame('<img>', $img->render());
     $tag->addChild($img);
     $this->assertSame('<a href="TEST"><img></a>', $tag->render());
     $img->src = "http://github.com/";
     $this->assertSame('<a href="TEST"><img src="http://github.com/"></a>', $tag->render());
     $tag->addText('Click me');
     $this->assertSame('<a href="TEST"><img src="http://github.com/">Click me</a>', $tag->render());
     $tag->addText('<some text>');
     $this->assertSame('<a href="TEST"><img src="http://github.com/">Click me&lt;some text&gt;</a>', $tag->render());
     // getText - text at wrong index
     $this->assertSame(NULL, $tag->getText());
     // getText - text at index 0
     $tag->setText('<some text>');
     $this->assertSame('<some text>', $tag->getText());
 }
开发者ID:xmlscript,项目名称:php-html-element,代码行数:23,代码来源:TagTest.php

示例7: addTag

 /**
  * Adds tag.
  * @param Tag $tag
  * @param boolean $prependNotes default is append
  * @return Tag the added tag
  */
 public function addTag(Tag $tag, $prependNotes = false)
 {
     return $this->findTag($tag->getName())->setDate($tag->getDate())->addNotes($tag->getNotes(), $prependNotes);
 }
开发者ID:hiqdev,项目名称:chkipper,代码行数:10,代码来源:History.php

示例8: addTag

 /**
  * Helper function to add a tag to a tree.
  *
  * @param Tag $tag - the Tag to add
  * @param TreeNode $parent - the current parent node
  * @return TreeNode - the new parent node
  * @author Karthik Viswanathan
  */
 private function addTag($tag, $parent)
 {
     if ($tag->isClosing()) {
         // if there is some discrepency on what the tag closes,
         // just move up the tree until a similar opening tag is found
         // if no similar opening tag can be found, assume that
         // the parent tag is still unclosed
         $findParent = $parent;
         while ($findParent != null && $findParent->getValue()->getName() != $tag->getName()) {
             $findParent = $findParent->getParent();
             if ($findParent->getValue() != 'root') {
                 break;
             }
         }
         if ($findParent != null) {
             return $findParent->getParent();
         }
         return $parent;
     }
     $node = $this->appendToTree($tag, $parent);
     $tag->setNode($node);
     $this->populateTagArray($tag);
     // self closed means the parent is still unclosed
     if ($tag->isSelfClosed()) {
         return $parent;
     }
     return $node;
 }
开发者ID:iface91,项目名称:iface,代码行数:36,代码来源:PQLite.php

示例9: assignTagToCve

 public function assignTagToCve(Cve &$cve, Tag &$tag)
 {
     if ($cve == null || $cve->getId() == -1 || $tag == null) {
         Utils::log(LOG_DEBUG, "Exception", __FILE__, __LINE__);
         throw new Exception("Cve object is not valid or Cve.id is not set");
     }
     # Check if the tag name is valid
     if ($tag->getName() == "") {
         $tag->setName(Constants::$NA);
     }
     $tagId = $this->getTagIdByName($tag->getName());
     if ($tagId == -1) {
         $this->getPakiti()->getDao("Tag")->create($tag);
     } else {
         $tag->setId($tagId);
     }
     Utils::log(LOG_DEBUG, "Assinging the tag to the cve [cveId=" . $cve->getId() . ",tag=" . $tag->getName() . "]", __FILE__, __LINE__);
     # Check if the already assigned
     $isAssigned = $this->getPakiti()->getManager("DbManager")->queryToSingleValue("select 1 from CveTag where\n      \t \t\tcveId=" . $this->getPakiti()->getManager("DbManager")->escape($cve->getId()) . " and\n      \t \t\ttagId=" . $this->getPakiti()->getManager("DbManager")->escape($tag->getId()));
     if ($isAssigned != null) {
         throw new Exception($cve->getName() . " is already associated with " . $tag->getName() . " tag!");
     } else {
         # Association between cve and cveTag doesn't exist, so create it
         $this->getPakiti()->getManager("DbManager")->query("\n      \t\tinsert into CveTag set\n      \t\t\tcveId=" . $this->getPakiti()->getManager("DbManager")->escape($cve->getId()) . ",\n      \t \t\ttagId=" . $this->getPakiti()->getManager("DbManager")->escape($tag->getId()) . ",\n      \t \t\t`reason`='" . $this->getPakiti()->getManager("DbManager")->escape($tag->getReason()) . "'");
     }
 }
开发者ID:basvandervlies,项目名称:pakiti3,代码行数:26,代码来源:TagsManager.php

示例10: update

 public function update(Tag &$tag)
 {
     $this->db->query("update Tag set\n      \tname='" . $this->db->escape($tag->getName()) . "',\n      \tdescription='" . $this->db->escape($tag->getName()) . "',\n      \tenabled=" . $this->db->escape($tag->getEnabled()) . "\n      where id=" . $tag->getId());
 }
开发者ID:basvandervlies,项目名称:pakiti3,代码行数:4,代码来源:TagDao.php

示例11: set

 public function set(Tag $tag)
 {
     $this->setName($tag->getName());
     $this->setDate($tag->getDate());
     $this->setNotes($tag->getNotes());
 }
开发者ID:hiqdev,项目名称:chkipper,代码行数:6,代码来源:Tag.php


注:本文中的Tag::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。