本文整理匯總了PHP中Drupal\taxonomy\Entity\Term::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Term::getName方法的具體用法?PHP Term::getName怎麽用?PHP Term::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\taxonomy\Entity\Term
的用法示例。
在下文中一共展示了Term::getName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAllFormatters
/**
* Tests the plain formatter.
*/
public function testAllFormatters()
{
// Tests the plain formatter.
$this->assertFormatterRdfa(array('type' => 'taxonomy_term_reference_plain'), 'http://schema.org/about', array('value' => $this->term->getName(), 'type' => 'literal'));
// Tests the link formatter.
$term_uri = $this->getAbsoluteUri($this->term);
$this->assertFormatterRdfa(array('type' => 'taxonomy_term_reference_link'), 'http://schema.org/about', array('value' => $term_uri, 'type' => 'uri'));
}
示例2: testAllFormatters
/**
* Tests the plain formatter.
*/
public function testAllFormatters()
{
// Tests the plain formatter.
$this->assertFormatterRdfa(array('type' => 'taxonomy_term_reference_plain'), 'http://schema.org/about', array('value' => $this->term->getName(), 'type' => 'literal'));
// Grant the access content permission to the anonymous user.
Role::create(array('id' => DRUPAL_ANONYMOUS_RID))->grantPermission('access content')->save();
// Tests the link formatter.
$term_uri = $this->getAbsoluteUri($this->term);
$this->assertFormatterRdfa(array('type' => 'taxonomy_term_reference_link'), 'http://schema.org/about', array('value' => $term_uri, 'type' => 'uri'));
}