本文整理汇总了PHP中Link::getDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Link::getDescription方法的具体用法?PHP Link::getDescription怎么用?PHP Link::getDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Link
的用法示例。
在下文中一共展示了Link::getDescription方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatApiClass
private function formatApiClass(Link $link)
{
$linkToClass = $this->getLinkToApiClass($link->getDestination());
if (empty($linkToClass)) {
return;
}
$description = $link->getDescription();
$parts = explode("\\", $description);
$description = end($parts);
$link = sprintf('[%s](%s)', $description, $linkToClass);
return $link;
}
示例2: formatInternalMethod
private function formatInternalMethod(Link $link)
{
if (empty($this->scope->class)) {
return;
}
$methodName = substr($link->getDestination(), 0, strlen($link->getDestination()) - 2);
$methods = $this->scope->class->getMethods(true);
if (empty($methodName) || !array_key_exists($methodName, $methods)) {
return;
}
$linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
return sprintf('[%s](%s#%s)', $link->getDescription(), $linkToClass, strtolower($methodName));
}
示例3: formatInternalProperty
private function formatInternalProperty(Link $link)
{
if (empty($this->scope->class)) {
return;
}
$properties = $this->scope->class->getProperties(true);
$propertyName = substr($link->getDestination(), 1);
if (!$propertyName || !array_key_exists($propertyName, $properties)) {
return;
}
$linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
return sprintf('[%s](%s#$%s)', $link->getDescription(), $linkToClass, strtolower($propertyName));
}
示例4: parse
public function parse($comment)
{
if (preg_match_all('/{\\@link(.*?)}/', $comment, $matches)) {
foreach ($matches[0] as $key => $rawLink) {
$linkParser = new LinkParser($this->scope);
$linkFormatted = $linkParser->parse($matches[1][$key]);
$comment = str_replace($rawLink, $linkFormatted, $comment);
}
}
if (preg_match_all('/{\\@hook(.*?)}/', $comment, $matches)) {
foreach ($matches[0] as $key => $rawLink) {
$link = new Link($matches[1][$key]);
$anchor = strtolower(str_replace('.', '', $link->getDestination()));
$linkFormatted = sprintf('[%s](/api-reference/events#%s)', $link->getDescription(), $anchor);
$comment = str_replace($rawLink, $linkFormatted, $comment);
}
}
return $comment;
}
示例5: formatInternalConstant
private function formatInternalConstant(Link $link)
{
$constName = $link->getDestination();
if (empty($this->scope->class) || empty($constName)) {
return;
}
$constants = $this->scope->class->getConstants(true);
if (!array_key_exists($constName, $constants)) {
return;
}
$constant = $constants[$constName];
if (!$constant) {
return;
}
$description = $link->getDescription();
if ($constant->getLongDesc()) {
// we are displaying a link only to constants having a long description.
$linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
return sprintf('`[%s](%s#%s)`', $description, $linkToClass, strtolower($constant));
}
return sprintf('`%s`', $description);
}
示例6: elseif
<input type="text" disabled="disabled" value="<?php
echo $link->getCode();
?>
"/>
</p>
<p>
<label for="enlace">Enlace: </label>
<input id="enlace" type="text" name="enlace" value="<?php
echo $link->getUrl();
?>
" />
</p>
<p>
<label for="descripcion">Descripción</label>
<textarea id="descripcion" name="descripcion"><?php
echo $link->getDescription();
?>
</textarea>
</p>
<input type="hidden" name="accion" value="doedit" />
<input type="submit" value="Guardar">
</form>
<?php
} elseif ($_GET['accion'] == 'delete') {
$link->delete();
header("Location: index.php");
}
} else {
?>
<form action="#" method="post">
<p>
示例7: formatting
public function formatting(Link $link)
{
return $this->formatExternalLink($link->getDestination(), $link->getDescription());
}
示例8: array
<?php
require_once "head.php";
include_once "menu.php";
$user_links = Usuario::getLinks($_SESSION['idusuario']);
$datarows = array();
foreach ($user_links as $user_link) {
$l = new Link($user_link['id_link']);
$clicks = $l->getClicks();
$datarows[] = "['" . $l->getDescription() . "', " . $clicks['num'] . "]";
}
?>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Enlaces', 'Nº de clicks'],
示例9: __construct
public function __construct($link)
{
parent::__construct('save');
$language = OW::getLanguage()->getInstance();
$this->link = $link;
$urlField = new TextField('url');
$urlField->setHasInvitation(true)->setInvitation('http://www.example.com');
$this->addElement($urlField->setRequired(true)->addValidator(new UrlValidator())->setLabel($language->text('links', 'save_form_url_field_label'))->setValue($this->link->getUrl()));
$titleField = new TextField('title');
$this->addElement($titleField->setRequired(true)->setLabel($language->text('links', 'save_form_title_field_label'))->setValue($this->link->getTitle()));
$descriptionTextArea = new WysiwygTextarea('description');
$descriptionTextArea->setLabel($language->text('links', 'save_form_desc_field_label'));
$descriptionTextArea->setValue($this->link->getDescription());
$descriptionTextArea->setRequired(true);
$this->addElement($descriptionTextArea);
$tagService = BOL_TagService::getInstance();
$tags = array();
if (intval($this->link->getId()) > 0) {
$arr = $tagService->findEntityTags($this->link->getId(), 'link');
foreach (!empty($arr) ? $arr : array() as $dto) {
$tags[] = $dto->getLabel();
}
}
$tagsField = new TagsInputField('tags');
$tagsField->setLabel($language->text('links', 'save_form_tags_field_label'));
$tagsField->setValue($tags);
$tagsField->setDelimiterChars(array('.'));
$this->addElement($tagsField);
// $tagsField = new TagsField('tags', $tags);
// $this->addElement($tagsField->setLabel($language->text('links', 'save_form_tags_field_label')));
$submit = new Submit('submit');
$this->addElement($submit);
}