本文整理汇总了PHP中UI::link方法的典型用法代码示例。如果您正苦于以下问题:PHP UI::link方法的具体用法?PHP UI::link怎么用?PHP UI::link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI::link方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hourTable
function hourTable($hours, $o = array())
{
$r = getRenderer();
$table['headers'] = array('Date', 'Client', 'Description', 'Staff', 'Hours', 'Billable', 'Type', 'Edit', 'Delete');
$table['rows'] = array();
$total_hours = 0;
$billable_hours = 0;
$hours_to_skip = array();
foreach ($hours as $h) {
if (!empty($hours_to_skip[$h->id])) {
continue;
}
$total_hours += $h->getHours();
$billable_hours += $h->getBillableHours();
if ($h->is_project_hour()) {
$description = UI::link(array('controller' => 'Hour', 'action' => 'show', 'id' => $h->id, 'text' => $h->getName()));
$edit_button = UI::button(array('controller' => 'Hour', 'action' => 'show', 'id' => $h->id));
} else {
$description = UI::link(array('controller' => 'SupportHour', 'action' => 'show', 'id' => $h->id, 'text' => $h->getName()));
$edit_button = UI::button(array('controller' => 'SupportHour', 'action' => 'show', 'id' => $h->id));
}
$company_link = UI::link(array('text' => $h->getCompanyName(), 'controller' => 'Company', 'action' => 'show', 'id' => $h->getCompany()->id));
$name = $h->getStaffName();
if ($h->getPairName()) {
$name . ' and ' . $h->getPairName();
}
$logged = $h->getHours();
$billable = $h->getBillableHours();
$type = $h->getType();
if ($h->is_pair()) {
$name = $h->getPairName();
$logged = $logged * 2;
$billable = $billable * 2;
$hours_to_skip[$h->get('pair_hour_id')] = true;
}
$table['rows'][] = array($h->getData('date'), $company_link, $description, $name, $logged, $billable, $type, $edit_button, UI::button(array('controller' => 'Hour', 'action' => 'destroy', 'id' => $h->id)));
}
$o['title'] = 'Hours';
$o['id'] = 'hour-table';
$o['pager'] = true;
$hours_table = $r->view('basicTable', $table, $o);
$totals = '
<div class="bs-docs-example" id="Hours">
<div class="hours-month">
Total Project Hours: <span class="unbillable">' . $total_hours . '</span>
</div>
<div class="hours-week">
Billable Project Hours: <span class="billable">' . $billable_hours . '</span>
</div>
<div class="clear-both"></div></div>
';
return $totals . $hours_table;
}
示例2: bookmarkTable
function bookmarkTable($bookmarks, $o = array())
{
if (!$bookmarks) {
return;
}
$r = getRenderer();
$html = '<fieldset id="bookmarks"><legend>Bookmarks</legend><ul id="bookmark-list">';
foreach ($bookmarks as $b) {
$html .= "\n <li>\n <div class='destroy-bookmark-container'>\n " . UI::link(array('controller' => 'Bookmark', 'action' => 'destroy', 'id' => $b->id, 'text' => '<span class="ui-icon ui-icon-trash"></span>'), array('class' => 'ui-state-default ui-corner-all')) . " \n </div>\n <a href='" . $b->getSource() . "'>" . $b->getDescription() . "</a>\n <div class='clear'></div>\n </li>";
}
$html .= '</ul></fieldset>';
return $html;
}
示例3: paymentTable
function paymentTable($payments, $o = array())
{
$r = getRenderer();
$table = array();
$table['headers'] = array('Date', 'Invoice ID', 'Client', 'Amount', 'Type', 'Edit', 'Delete');
$table['rows'] = array();
$total_payments = 0;
$r = getRenderer();
foreach ($payments as $p) {
$total_payments += $p->getAmount();
$table['rows'][] = array(UI::link(array('controller' => 'Payment', 'action' => 'show', 'id' => $p->id, 'text' => $p->getData('date'))), UI::link(array('text' => $p->getInvoiceId(), 'controller' => 'Invoice', 'action' => 'show', 'id' => $p->getInvoiceId())), UI::link(array('controller' => 'Company', 'action' => 'show', 'id' => $p->getCompany()->id, 'text' => $p->getCompanyName())), '$ ' . number_format($p->getAmount(), 2), $p->getType(), $p->getPurpose(), UI::button(array('controller' => 'Payment', 'action' => 'show', 'id' => $p->id)), UI::button(array('controller' => 'Payment', 'action' => 'destroy', 'id' => $p->id)));
}
$payment_table = $r->view('basicTable', $table, array_merge(array('title' => 'Payments', 'pager' => true), $o));
$total_payments = $r->view('basicMessage', 'Total payments: $ ' . number_format($total_payments, 2));
return '<div id="payments-table">' . $total_payments . $payment_table . '</div>';
}
示例4: link
function link($controller, $parameters, $text = false, $o = array())
{
$parameters['controller'] = $controller;
$parameters['text'] = $text;
return UI::link($parameters, $o);
}