本文整理汇总了PHP中entity_link函数的典型用法代码示例。如果您正苦于以下问题:PHP entity_link函数的具体用法?PHP entity_link怎么用?PHP entity_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了entity_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: convertValueForDisplay
static function convertValueForDisplay($value, $field, $excerpt = 40)
{
if (is_null($value)) {
return 'NULL';
}
if (!($mod = self::loadModification($field))) {
return $value;
}
$table = Doctrine::getTable($mod['object_model']);
$columns = $table->getColumns();
if ($mod['object_model'] == 'Entity') {
if (!array_key_exists($field['field_name'], $columns)) {
if ($extensionName = EntityTable::getExtensionNameByFieldName($field['field_name'])) {
$table = Doctrine::getTable($extensionName);
}
}
} elseif ($mod['object_model'] == 'Relationship') {
if (!array_key_exists($field['field_name'], $columns)) {
$table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($field['field_name']));
}
}
if ($alias = self::getFieldNameAlias($field)) {
$class = $table->getRelation($alias)->getClass();
if ($record = Doctrine::getTable($class)->find($value, Doctrine::HYDRATE_ARRAY)) {
if ($class == 'Entity') {
sfLoader::loadHelpers('Ls');
return entity_link($record, null);
} elseif ($class == 'sfGuardUser') {
sfLoader::loadHelpers('Ls');
return user_link($record);
}
return $record;
}
}
if (in_array($field['field_name'], array('start_date', 'end_date'))) {
return Dateable::convertForDisplay($value);
}
$def = $table->getColumnDefinition($field['field_name']);
switch ($def['type']) {
case 'integer':
return (double) $value;
break;
case 'boolean':
return $value ? 'yes' : 'no';
break;
}
if ($excerpt) {
$short = LsString::excerpt($value, $excerpt);
return $short == $value ? $value : '<span title="' . strip_tags($value) . '">' . $short . '</span>';
}
return $value;
}
开发者ID:silky,项目名称:littlesis,代码行数:52,代码来源:ModificationFieldTable.class.php
示例2: convertValueForDisplay
public function convertValueForDisplay($value)
{
if (is_null($value)) {
return '<span class="text_small">NULL</span>';
}
if (!($record = $this->Modification->getObject(true))) {
return $value;
}
$table = $record->getTable();
if ($record instanceof Entity) {
$data = $record->getData();
if (!array_key_exists($this->field_name, $data)) {
if ($extensionName = EntityTable::getExtensionNameByFieldName($this->field_name)) {
$table = Doctrine::getTable($extensionName);
}
}
} elseif ($record instanceof Relationship) {
$data = $record->getData();
if (!array_key_exists($this->field_name, $data)) {
$table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($this->field_name));
}
}
if ($alias = $this->getFieldNameAlias()) {
$class = $table->getRelation($alias)->getClass();
if ($record = Doctrine::getTable($class)->find($value)) {
if ($record instanceof Entity) {
sfLoader::loadHelpers('Ls');
return entity_link($record, null);
}
return $record;
}
}
if (in_array($this->field_name, array('start_date', 'end_date'))) {
return Dateable::convertForDisplay($value);
}
$def = $table->getColumnDefinition($this->field_name);
switch ($def['type']) {
case 'integer':
return (string) $value;
break;
case 'boolean':
return $value ? 'yes' : 'no';
break;
}
return LsString::excerpt($value);
}
开发者ID:silky,项目名称:littlesis,代码行数:46,代码来源:ModificationField.class.php
示例3: alert
}
if (!refSource || !refName)
{
alert('You must complete the source fields');
return false;
}
return true;
}
<?php
if (isset($entity1)) {
?>
var bulkEntityLink = '<?php
echo str_replace("'", "\\'", entity_link($entity1));
?>
';
<?php
echo "setEntity(" . ($is_switched ? '2' : '1') . ", " . $entity1['id'] . ", '" . $entity1['primary_ext'] . "', bulkEntityLink);";
}
?>
<?php
if (isset($entity2_name)) {
?>
$('entity<?php
echo $is_switched ? 1 : 2;
?>
_input').value = "<?php
echo $entity2_name;
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:toolbarSuccess.php
示例4: include_partial
<?php
}
?>
<?php
if (isset($nearby_address_pager) && $nearby_address_pager->getCountQuery()->count()) {
?>
<?php
include_partial('global/section', array('title' => 'Nearby Entities', 'pager' => $nearby_address_pager));
?>
<div class="padded">
<?php
foreach ($nearby_address_pager->execute() as $address) {
?>
<?php
echo entity_link($address->Entity);
?>
(<?php
echo link_to($address->getOneLiner(), 'entity/address?id=' . $address->id);
?>
)
<br />
<?php
}
?>
</div>
<?php
}
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:addressSuccess.php
示例5: include_partial
<?php
include_partial('entity/basic', array('entity' => $entity));
?>
<?php
include_partial('global/subsection', array('title' => 'Child Organizations', 'pager' => $children_pager, 'pointer' => 'Subgroups of ' . $entity->name));
?>
<div class="padded">
<?php
foreach ($children_pager->execute() as $child) {
?>
<?php
echo entity_link($child);
?>
<br />
<?php
}
?>
</div>
开发者ID:silky,项目名称:littlesis,代码行数:21,代码来源:childOrgsSuccess.php
示例6: pager_meta
<div class="section" style="display: block;">
<span class="section_title">Matches</span>
</div>
<div class="section_meta" style="display: block;"><?php
echo pager_meta($entity_pager);
?>
</div>
<div class="padded" style="display: block;">
<?php
foreach ($entity_pager->execute() as $entity) {
?>
<?php
$innerHtml = '<span class="text_big">' . entity_link($entity) . '</span> ' . input_hidden_tag('relationship[' . strtolower($entityField) . '_id]', $entity->id);
?>
<?php
$innerHtml = str_replace('"', '\\\'', $innerHtml);
?>
<?php
include_partial('entity/oneliner', array('entity' => $entity, 'actions' => array(array('raw' => '<a href="javascript:void(0);" onclick="selectEntity(\'' . $innerHtml . '\', \'' . strtolower($entityField) . '\');">select</a>'))));
?>
<?php
}
?>
</div>
开发者ID:silky,项目名称:littlesis,代码行数:29,代码来源:_entityresults.php
示例7: entity_link
<?php
echo entity_link($object, null);
?>
</td>
<td style='padding-bottom:.6em'>
<?php
$recipients = LsDoctrineQuery::create()->from('Entity e')->andWhereIn('e.id', explode(',', $object['degree1_ids']))->fetchArray();
?>
<?php
echo LsNumber::makeReadable($object['total'], '$');
?>
</td>
<td style='padding-bottom:.6em'>
<?php
$recipientLinks = array();
?>
<?php
foreach ($recipients as $recipient) {
?>
<?php
$recipientLinks[] = entity_link($recipient, null, false);
?>
<?php
}
?>
<?php
echo implode(', ', $recipientLinks);
?>
</td>
</tr>
开发者ID:silky,项目名称:littlesis,代码行数:30,代码来源:_personrecipientrow.php
示例8: entity_link
<tr>
<td>
<?php
echo entity_link($object, null);
?>
<?php
$rels = LsDoctrineQuery::create()->from('Relationship r')->andWhereIn('r.id', explode(',', $object['relationship_ids']))->fetchArray();
?>
<?php
$rel_links = array();
?>
<?php
foreach ($rels as $rel) {
?>
<?php
$rel_links[] = trim(get_partial('relationship/oneliner', array('relationship' => $rel, 'profiled_entity' => $base_object, 'related_entity' => $object)));
?>
<?php
}
?>
<?php
echo implode(' ', $rel_links);
?>
</td>
</tr>
开发者ID:silky,项目名称:littlesis,代码行数:26,代码来源:_connecttorow.php
示例9: link_to
No similar names found.
<br />
<div style="padding-top: .5em">
<?php
echo link_to('Look for possible merges »', EntityTable::getInternalUrl($entity, 'merge'));
?>
</div>
<?php
} else {
?>
<div class="padded">
<?php
foreach ($similar_entities as $similar_entity) {
?>
<?php
echo entity_link($similar_entity, null);
?>
<br />
<?php
}
?>
<br />
<?php
echo link_to('Begin merging process »', EntityTable::getInternalUrl($entity, 'merge'));
?>
</div>
<?php
}
?>
</div>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_similarEntities.php
示例10: entity_link
<tr class="hover">
<td>
<span class="text_big">
<?php
if ($object->Entity1->id == $base_object->id) {
?>
<?php
echo entity_link($object->Entity2);
?>
<?php
} else {
?>
<?php
echo entity_link($object->Entity1);
?>
<?php
}
?>
</span>
</td>
<td>
<?php
if ($base_object->id == $object->entity1_id) {
?>
<?php
echo link_to($object->description2 ? $object->description2 : $object->Category->default_description, 'relationship/view?id=' . $object->id);
?>
<?php
} else {
?>
<?php
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_relationshipsrowbydate.php
示例11: foreach
foreach ($article_pager->execute() as $article) {
?>
<span style="color: #888;"><?php
echo $article['ArticleSource']['name'];
?>
</span>
<br />
<span style="font-size: 18px; font-weight: bold;"><?php
echo link_to($article['title'] . ' »', $article['url']);
?>
</span>
<br />
<?php
$entities = array();
?>
<?php
foreach ($article->ArticleEntity as $ae) {
?>
<?php
$entities[] = entity_link($ae->Entity, null);
?>
<?php
}
?>
<?php
echo implode(', ', $entities);
?>
<br />
<br />
<?php
}
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:latestSuccess.php
示例12: uniqid
<?php
$unique = uniqid() . "_" . $related_entity["id"];
$entity_length = strlen($related_entity["name"]);
$blurb_length = 85 - round($entity_length * 1.2);
?>
<div class="related_entity">
<div class="related_entity_entity">
<?php
echo entity_link($related_entity);
?>
<?php
if (isset($related_entity["blurb"])) {
?>
<span class="related_entity_blurb">
<?php
echo excerpt($related_entity['blurb'], $blurb_length);
?>
</span>
<?php
}
?>
</div>
<div class="related_entity_relationship">
<?php
$first = array_shift($relationships);
?>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_entitywithrelationships.php
示例13: json_encode
<?php
echo json_encode(array('id' => $entity->id, 'ext' => $entity['primary_ext'], 'link' => entity_link($entity, null, false)));
开发者ID:silky,项目名称:littlesis,代码行数:3,代码来源:toolbarCreateSuccess.php
示例14: array
<br />
<br />
<span class="entity-carousel-count">Related <?php
echo $entity['primary_ext'] == 'Person' ? 'people' : 'orgs';
?>
: </span>
<?php
$related_links = array();
?>
<?php
foreach ($interlocks as $related) {
?>
<?php
$related_links[] = entity_link($related, 'entity-carousel-related', false, excerpt($related['name'], 40));
?>
<?php
}
?>
<?php
$related_links[] = '<nobr><strong>' . link_to('More »', EntityTable::generateRoute($entity, 'interlocks')) . '</strong></nobr>';
?>
<?php
echo implode(" • ", $related_links);
?>
</div>
</div>
<?php
}
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_carousel.php
示例15: array
relationships:</span>
<?php
$related_links = array();
?>
<?php
foreach ($sample_relateds as $related) {
?>
<?php
$related_links[] = entity_link($related, 'entity-mini-related', false, excerpt($related['name'], 40));
?>
<?php
}
?>
<?php
if (count($relateds) > 3) {
?>
<?php
$related_links[] = '<nobr>' . entity_link($entity, 'entity-mini-related', false, 'More »') . '</nobr>';
?>
<?php
}
?>
<?php
echo implode(" • ", $related_links);
?>
</div>
</div>
<?php
}
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_mini.php
示例16: elseif
?>
→
<?php
echo ModificationFieldTable::convertValueForDisplay($field['new_value'], $field);
?>
)
</td>
<?php
} elseif ($object['merge_object_id']) {
?>
<?php
$merge_object = LsDoctrineQuery::create()->from('Entity e')->where('e.id = ? AND e.is_deleted IS NOT NULL', $object['merge_object_id'])->fetchOne();
?>
<td>
Merged into <?php
echo entity_link($merge_object);
?>
</td>
<?php
} else {
?>
<td></td>
<?php
}
?>
</tr>
<?php
if (!$object['is_delete']) {
foreach ($fields as $field) {
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_userlistrow.php
示例17: use_helper
<?php
use_helper('LsNumber');
?>
<span class="text_big">
<?php
slot('share_text');
echo entity_link($relationship['Entity1']);
?>
<?php
echo $current === NULL ? "is/was" : ($current == '1' ? "is" : "was");
?>
a member of <?php
echo entity_link($relationship['Entity2']);
end_slot();
echo get_slot('share_text');
slot('share_text', RelationshipTable::formatSentenceForShare(get_slot('share_text')));
?>
</span>
<br />
<br />
<?php
$data = array('Title' => $relationship['description1'], 'Start date' => Dateable::convertForDisplay($relationship['start_date']), 'End date' => Dateable::convertForDisplay($relationship['end_date']), 'Is current' => LsLogic::nullOrBoolean($relationship['is_current']), 'Dues' => readable_number($relationship['dues'], '$'), 'Notes' => $relationship['notes'] ? nl2br($relationship['notes']) : null);
?>
<?php
include_partial('global/section', array('title' => 'Details'));
?>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_membershipview.php
示例18: sprintf
<tr>
<td>
<?php
echo sprintf("%01.1f", AddressTable::getDistanceBetweenCoords($object->latitude, $object->longitude, $base_object->latitude, $base_object->longitude));
?>
</td>
<td><?php
echo entity_link($object->Entity, null);
?>
</td>
<td>
<span class="text_small"><?php
echo $object->getOneLiner();
?>
</span>
</td>
</tr>
开发者ID:silky,项目名称:littlesis,代码行数:17,代码来源:_addresslistrow.php
示例19: elseif
echo $field->getFieldNameForDisplay();
?>
</strong> (<?php
echo $field->getOldValueForDisplay();
?>
→ <?php
echo $field->getNewValueForDisplay();
?>
)
</td>
<?php
} elseif ($object->merge_object_id) {
?>
<td>
Merged into <?php
echo entity_link(Doctrine::getTable('Entity')->find($object->merge_object_id));
?>
</td>
<?php
} else {
?>
<td></td>
<?php
}
?>
<td>
<?php
echo link_to('more changes', 'modification/list?user_id=' . $object->user_id);
?>
</td>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_updatedlistrow.php
示例20: entity_link
<tr>
<td>
<?php
echo entity_link($object, null);
?>
</td>
<td>
<?php
$entities = LsDoctrineQuery::create()->from('Entity e')->andWhereIn('e.id', explode(',', $object['degree1_ids']))->execute();
?>
<?php
$entity_links = array();
?>
<?php
foreach ($entities as $entity) {
?>
<?php
$entity_links[] = entity_link($entity, null);
?>
<?php
}
?>
<?php
echo implode(', ', $entity_links);
?>
</td>
</tr>
开发者ID:silky,项目名称:littlesis,代码行数:28,代码来源:_networksearchrow.php
注:本文中的entity_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论