本文整理汇总了PHP中html::a方法的典型用法代码示例。如果您正苦于以下问题:PHP html::a方法的具体用法?PHP html::a怎么用?PHP html::a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::a方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Lists all Articlecomment models.
* @return mixed
*/
public function actionIndex()
{
$list = '';
$post = Yii::$app->request->post();
if ($post['id']) {
$mod = new Query();
$comment = $mod->select(['a.id', 'a.parentId', 'a.articleId', 'a.content', 'a.createTime', 'b.username'])->from('articlecomment as a')->leftJoin('user as b', 'a.userId = b.id')->where(['commentId' => $post['id']])->orderBy(['createTime' => 'DESC', 'id' => 'DESC'])->createCommand()->queryAll();
if ($comment) {
foreach ($comment as $v) {
$content = '回复@' . Articlecomment::getCommentByParId($v['parentId']) . ':' . $v['content'];
$ahtml = html::a(html::tag("i", "", ["class" => "fa fa-thumbs-o-up"]) . html::tag("span", "回复"), ["/main/viewart", "id" => $v["articleId"], "parId" => $v['id']]);
$list .= '<div class="infos small-comment' . $post['id'] . '" style="border:1px solid;">
<div class="media-body markdown-reply content-body">
<p>' . $content . '</p>
<span class="opts pull-right">
<a class="author" >' . $v["username"] . '</a>
•
<addr title="' . $v["createTime"] . '">' . Html::tag("span", Yii::$app->formatter->asRelativeTime($v["createTime"])) . '</addr>
' . $ahtml . '
</span>
</div>
</div>';
}
}
}
$result = array('success' => true, 'message' => $list);
echo json_encode($result);
die;
return $this->renderAjax('index', ['success' => true, 'message' => '']);
}
示例2: printFiles
/**
* Print files.
*
* @param object $files
* @access public
* @return void
* @todo fix style.
*/
public function printFiles($files)
{
if (empty($files)) {
return false;
}
$imagesHtml = '';
$filesHtml = '';
foreach ($files as $file) {
if ($file->editor) {
continue;
}
if ($file->isVideo) {
continue;
}
$file->title = $file->title . ".{$file->extension}";
$fileMD5 = md5_file(rtrim($this->app->getWwwRoot(), '/') . $file->fullURL);
if ($file->isImage) {
if ($file->objectType == 'product') {
continue;
}
$imagesHtml .= "<li class='file-image file-{$file->extension}'>" . html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), html::image($file->smallURL), "target='_blank' data-toggle='lightbox' data-img-width='{$file->width}' data-img-height='{$file->height}' title='{$file->title}'") . '</li>';
} else {
$filesHtml .= "<li class='file file-{$file->extension}'>";
$filesHtml .= html::a(helper::createLink('file', 'download', "fileID={$file->id}&mouse=left"), $file->title, "target='_blank' title='{$file->title}'");
$filesHtml .= "<span class='file-download'><i class='icon-download'></i> " . $file->downloads . "</span>";
$filesHtml .= "<span class='file-md5'>";
$filesHtml .= html::a('javascript:void(0)', 'MD5', "class='label' data-toggle='popover' data-placement='bottom' data-content='{$fileMD5}'");
$filesHtml .= '</span></li>';
}
}
echo "<ul class='files-list clearfix'>" . $imagesHtml . $filesHtml . '</ul>';
}
示例3: notify
/**
* show notify in msgBox.
*
* @access public
* @return string
*/
public function notify()
{
$messages = $this->dao->select('COUNT(*) as count')->from(TABLE_MESSAGE)->where('`to`')->eq($this->app->user->account)->andWhere('readed')->eq(0)->fetch('count');
if ($messages) {
echo html::a(helper::createLink('user', 'message'), sprintf($this->lang->user->message->mine, $messages));
}
}
示例4: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
$icon = 'plugins/vcard_attachments/' . $this->local_skin_path() . '/vcard_add_contact.png';
foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part));
// successfully parsed vcards?
if (empty($vcards)) {
continue;
}
// remove part's body
if (in_array($part, $this->vcard_bodies)) {
$p['content'] = '';
}
$style = 'margin:0.5em 1em; padding:0.2em 0.5em; border:1px solid #999; ' . 'border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; width: auto';
foreach ($vcards as $idx => $vcard) {
$display = $vcard->displayname;
if ($vcard->email[0]) {
$display .= ' <' . $vcard->email[0] . '>';
}
// add box below messsage body
$p['content'] .= html::p(array('style' => $style), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::img(array('src' => $icon, 'style' => "vertical-align:middle"))) . ' ' . html::span(null, Q($display)));
}
$attach_script = true;
}
if ($attach_script) {
$this->include_script('vcardattach.js');
}
return $p;
}
示例5: commonAction
/**
* Common actions.
*
* @param int $productID
* @access public
* @return void
*/
public function commonAction($productID)
{
$this->loadModel('product');
$this->view->product = $this->product->getById($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}"), $this->view->product->name);
$this->product->setMenu($this->product->getPairs(), $productID);
}
示例6: html_output
/**
* This callback function adds a box below the message content
* if there is a vcard attachment available
*/
function html_output($p)
{
$attach_script = false;
foreach ($this->vcard_parts as $part) {
$vcards = rcube_vcard::import($this->message->get_part_content($part, null, true));
// successfully parsed vcards?
if (empty($vcards)) {
continue;
}
// remove part's body
if (in_array($part, $this->vcard_bodies)) {
$p['content'] = '';
}
foreach ($vcards as $idx => $vcard) {
// skip invalid vCards
if (empty($vcard->email) || empty($vcard->email[0])) {
continue;
}
$display = $vcard->displayname . ' <' . $vcard->email[0] . '>';
// add box below message body
$p['content'] .= html::p(array('class' => 'vcardattachment'), html::a(array('href' => "#", 'onclick' => "return plugin_vcard_save_contact('" . rcube::JQ($part . ':' . $idx) . "')", 'title' => $this->gettext('addvcardmsg')), html::span(null, rcube::Q($display))));
}
$attach_script = true;
}
if ($attach_script) {
$this->include_script('vcardattach.js');
$this->include_stylesheet($this->local_skin_path() . '/style.css');
}
return $p;
}
示例7: createModuleMenu
public function createModuleMenu($method)
{
if (!isset($this->lang->my->{$method}->menu)) {
return false;
}
$string = "<nav id='menu'><ul class='nav'>\n";
/* Get menus of current module and current method. */
$moduleMenus = $this->lang->my->{$method}->menu;
$currentMethod = $this->app->getMethodName();
/* Cycling to print every menus of current module. */
foreach ($moduleMenus as $methodName => $methodMenu) {
/* Split the methodMenu to label, module, method, vars. */
list($label, $module, $method, $vars) = explode('|', $methodMenu);
$class = '';
if ($method == $currentMethod) {
$class = "class='active'";
}
$hasPriv = commonModel::hasPriv($module, $method);
if ($module == 'my' and $method == 'order') {
$hasPriv = commonModel::hasPriv('order', 'browse');
}
if ($module == 'my' and $method == 'contract') {
$hasPriv = commonModel::hasPriv('contract', 'browse');
}
if ($hasPriv) {
$string .= "<li {$class}>" . html::a(helper::createLink($module, $method, $vars), $label) . "</li>\n";
}
}
$string .= "</ul></nav>\n";
return $string;
}
示例8: prefs_list
/**
* Handler for user preferences form (preferences_list hook)
*/
function prefs_list($args)
{
if ($args['section'] != 'mailbox') {
return $args;
}
// Load configuration
$this->load_config();
// Load localization and configuration
$this->add_texts('localization/');
if (!empty($_REQUEST['_framed'])) {
$this->rc->output->add_label('newmail_notifier.title', 'newmail_notifier.testbody', 'newmail_notifier.desktopunsupported', 'newmail_notifier.desktopenabled', 'newmail_notifier.desktopdisabled');
$this->include_script('newmail_notifier.js');
}
// Check that configuration is not disabled
$dont_override = (array) $this->rc->config->get('dont_override', array());
foreach (array('basic', 'desktop', 'sound') as $type) {
$key = 'newmail_notifier_' . $type;
if (!in_array($key, $dont_override)) {
$field_id = '_' . $key;
$input = new html_checkbox(array('name' => $field_id, 'id' => $field_id, 'value' => 1));
$content = $input->show($this->rc->config->get($key)) . ' ' . html::a(array('href' => '#', 'onclick' => 'newmail_notifier_test_' . $type . '()'), $this->gettext('test'));
$args['blocks']['new_message']['options'][$key] = array('title' => html::label($field_id, Q($this->gettext($type))), 'content' => $content);
}
}
return $args;
}
示例9: prefs_list
function prefs_list($args)
{
if ($args['section'] == 'mailbox') {
$RCMAIL = rcmail::get_instance();
$field_id = 'rcmfd_html5_notifier';
$select_duration = new html_select(array('name' => '_html5_notifier_duration', 'id' => $field_id));
$select_duration->add($this->gettext('off'), '0');
$times = array('3', '5', '8', '10', '12', '15', '20', '25', '30');
foreach ($times as $time) {
$select_duration->add($time . ' ' . $this->gettext('seconds'), $time);
}
$select_duration->add($this->gettext('durable'), '-1');
$select_smbox = new html_select(array('name' => '_html5_notifier_smbox', 'id' => $field_id));
$select_smbox->add($this->gettext('no_mailbox'), '0');
$select_smbox->add($this->gettext('short_mailbox'), '1');
$select_smbox->add($this->gettext('full_mailbox'), '2');
$content = $select_duration->show($RCMAIL->config->get('html5_notifier_duration') . '');
$content .= $select_smbox->show($RCMAIL->config->get('html5_notifier_smbox') . '');
$content .= html::a(array('href' => '#', 'id' => 'rcmfd_html5_notifier_browser_conf', 'onclick' => 'rcmail_browser_notifications(); return false;'), $this->gettext('conf_browser')) . ' ';
$content .= html::a(array('href' => '#', 'onclick' => 'rcmail_browser_notifications_test(); return false;'), $this->gettext('test_browser'));
$args['blocks']['new_message']['options']['html5_notifier'] = array('title' => html::label($field_id, rcube::Q($this->gettext('shownotifies'))), 'content' => $content);
$check_only_new = new html_checkbox(array('name' => '_html5_notifier_only_new', 'id' => $field_id . '_only_new', 'value' => 1));
$content = $check_only_new->show($RCMAIL->config->get('html5_notifier_only_new', false));
$args['blocks']['new_message']['options']['html5_notifier_only_new'] = array('title' => html::label($field_id, rcube::Q($this->gettext('onlynew'))), 'content' => $content);
$input_excluded = new html_inputfield(array('name' => '_html5_notifier_excluded_directories', 'id' => $field_id . '_excluded'));
$args['blocks']['new_message']['options']['html5_notifier_excluded_directories'] = array('title' => html::label($field_id, rcube::Q($this->gettext('excluded_directories'))), 'content' => $input_excluded->show($RCMAIL->config->get('html5_notifier_excluded_directories') . ''));
$select_type = new html_select(array('name' => '_html5_notifier_popuptype', 'id' => $field_id . '_popuptype'));
$select_type->add($this->gettext('new_tab'), '0');
$select_type->add($this->gettext('new_window'), '1');
$args['blocks']['new_message']['options']['html5_notifier_popuptype'] = array('title' => html::label($field_id, rcube::Q($this->gettext('notifier_popuptype'))), 'content' => $select_type->show($RCMAIL->config->get('html5_notifier_popuptype') . ''));
$RCMAIL->output->add_script("\$(document).ready(function(){ rcmail_browser_notifications_colorate(); });");
}
return $args;
}
示例10: mailto_callback
/**
* Callback function used to build mailto: links around e-mail strings
*
* This also adds an onclick-handler to open the Rouncube compose message screen on such links
*
* @param array Matches result from preg_replace_callback
* @return int Index of saved string value
* @see rcube_string_replacer::mailto_callback()
*/
public function mailto_callback($matches)
{
$href = $matches[1];
$suffix = $this->parse_url_brackets($href);
$i = $this->add(html::a(array('href' => 'mailto:' . $href, 'onclick' => "return " . rcmail_output::JS_OBJECT_NAME . ".command('compose','" . rcube::JQ($href) . "',this)"), rcube::Q($href)) . $suffix);
return $i >= 0 ? $this->get_replacement($i) : '';
}
示例11: setting
public function setting()
{
$this->view->title = $this->lang->ldap->common . $this->lang->colon . $this->lang->ldap->setting;
$this->view->position[] = html::a(inlink('index'), $this->lang->ldap->common);
$this->view->position[] = $this->lang->ldap->setting;
$this->display();
}
示例12: render_preset_url
/**
* Render preset url
*
* @param object $form
* @return array
*/
public function render_preset_url(&$form)
{
$result = ['success' => true, 'error' => [], 'data' => ['html' => '', 'js' => '', 'css' => '']];
$params = ['lc_translation_language_code' => $form->values['lc_missing_language_code'], 'lc_translation_text_sys' => $form->values['lc_missing_text_sys']];
$result['data']['html'] = html::a(['href' => '/numbers/backend/i18n/basic/controller/translations/_edit?' . http_build_query2($params), 'value' => 'Translate']) . '<br/><br/>';
return $result;
}
示例13: __construct
public function __construct()
{
parent::__construct();
if (RUN_MODE == 'admin') {
$this->view->treeModuleMenu = $this->loadModel('tree')->getTreeMenu('product', 0, array('treeModel', 'createAdminLink'));
$this->view->treeManageLink = html::a(helper::createLink('tree', 'browse', "type=product"), $this->lang->tree->manage);
}
}
示例14: expected_link
private function expected_link($text, $number = null)
{
if ($number === null) {
$number = $text;
}
$var = $number - 1;
$attributes['href'] = "example.com?one=fish&two=fish&page={$var}";
return html::li('', html::a($attributes, $text));
}
示例15: __construct
public function __construct()
{
parent::__construct();
if (RUN_MODE == 'admin') {
$this->view->treeModuleMenu = $this->loadModel('tree')->getTreeMenu('product', 0, array('treeModel', 'createAdminLink'));
$this->view->treeManageLink = html::a(helper::createLink('product', 'setting'), $this->lang->product->setting, "data-toggle='modal'");
$this->view->treeManageLink .= ' ' . html::a(helper::createLink('tree', 'browse', "type=product"), $this->lang->tree->manage);
}
}