• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP html类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中html的典型用法代码示例。如果您正苦于以下问题:PHP html类的具体用法?PHP html怎么用?PHP html使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了html类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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' => '']);
 }
开发者ID:kennygp,项目名称:yii-myweb,代码行数:34,代码来源:ArticlecommentController.php


示例2: 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;
 }
开发者ID:shishenkov,项目名称:zpanel,代码行数:34,代码来源:vcard_attachments.php


示例3: 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);
 }
开发者ID:ppmon,项目名称:ppm,代码行数:14,代码来源:control.php


示例4: check_index

 /**
  * @return string An error message suitable for inclusion in the task log
  */
 static function check_index()
 {
     list($remaining) = search::stats();
     if ($remaining) {
         site_status::warning(t('Your search index needs to be updated.  <a href="%url" class="g-dialog-link">Fix this now</a>', array("url" => html::mark_clean(url::site("admin/maintenance/start/search_task::update_index?csrf=__CSRF__")))), "search_index_out_of_date");
     }
 }
开发者ID:viosca,项目名称:gallery3,代码行数:10,代码来源:search.php


示例5: action_addFolder

 public function action_addFolder()
 {
     $properties = array();
     $properties["owner"] = Wi3::inst()->sitearea->auth->user;
     $properties["adminright"] = Wi3::inst()->sitearea->auth->user->username;
     $properties["title"] = "Nieuwe map";
     $properties["type"] = "folder";
     $properties["created"] = time();
     $properties["filename"] = $properties["created"];
     // needs to be unique
     $settings = array();
     if (isset($_POST["refid"]) and !empty($_POST["refid"]) and isset($_POST["location"]) and !empty($_POST["location"])) {
         $settings["under"] = (int) preg_replace("/[^0-9]/", "", $_POST["refid"]);
     }
     // Add it
     $folder = Wi3::inst()->sitearea->files->add($properties, $settings);
     if ($folder) {
         // Remove cache of everything, since we do not know how this change affects the site
         Wi3::inst()->cache->removeAll();
         $li = html::anchor($folder->id, $folder->title);
         if ($folder->lft == 1 and $folder->rgt == 2) {
             // The new folder is the only folder there is. For the javascript menu to work properly, we need to reload the page.
             echo json_encode(array("scriptsbefore" => array("reload" => "window.location.reload();")));
         } else {
             echo json_encode(array("alert" => "map is aangemaakt", "scriptsafter" => array("adminarea.currentTree().addNode('treeItem_" . $folder->id . "','" . addslashes($li) . "')")));
         }
     } else {
         echo json_encode(array("alert" => "map kon NIET aangemaakt worden"));
     }
 }
开发者ID:azuya,项目名称:Wi3,代码行数:30,代码来源:ajax.php


示例6: __construct

 function __construct()
 {
     parent::__construct("feed");
     /* Set feed ID and self link. */
     $this->id(html::specialchars(url::abs_current()));
     $this->link()->rel("self")->href(url::abs_current());
 }
开发者ID:needful,项目名称:gallery3-contrib,代码行数:7,代码来源:Gallery_Atom_Feed.php


示例7: init

 function init()
 {
     $this->rcmail = rcmail::get_instance();
     $this->out = html::tag('div', array('style' => 'font-size: 12px; text-align: justify; position: absolute; margin-left: auto; left: 50%; margin-left: -250px; width: 500px;'), html::tag('h3', null, 'Welcome to MyRoundcube Plugins - Plugin Manager Installer') . html::tag('span', null, 'Please ' . html::tag('a', array('href' => $this->svn), 'download') . ' Plugin Manager package and upload the entire package to your Roundcube\'s plugin folder.' . html::tag('br') . html::tag('br') . ' If you are prompted to overwrite <i>"./plugins/plugin_manager"</i> please do so.') . html::tag('br') . html::tag('br') . html::tag('div', array('style' => 'display: inline; float: left'), html::tag('a', array('href' => 'javascript:void(0)', 'onclick' => 'document.location.href=\'./\''), $this->gettext('done'))));
     $this->register_handler('plugin.body', array($this, 'download'));
     $this->rcmail->output->send('plugin');
 }
开发者ID:MetallianFR68,项目名称:myroundcube,代码行数:7,代码来源:plugin_manager.php


示例8: 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) : '';
 }
开发者ID:noikiy,项目名称:roundcubemail,代码行数:16,代码来源:rcmail_string_replacer.php


示例9: postLine

 private function postLine()
 {
     $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
     switch ($this->rs->post_status) {
         case 1:
             $img_status = sprintf($img, __('published'), 'check-on.png');
             break;
         case 0:
             $img_status = sprintf($img, __('unpublished'), 'check-off.png');
             break;
         case -1:
             $img_status = sprintf($img, __('scheduled'), 'scheduled.png');
             break;
         case -2:
             $img_status = sprintf($img, __('pending'), 'check-wrn.png');
             break;
     }
     $protected = '';
     if ($this->rs->post_password) {
         $protected = sprintf($img, __('protected'), 'locker.png');
     }
     $selected = '';
     if ($this->rs->post_selected) {
         $selected = sprintf($img, __('selected'), 'selected.png');
     }
     $attach = '';
     $nb_media = $this->rs->countMedia();
     if ($nb_media > 0) {
         $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
         $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
     }
     $res = '<tr class="line' . ($this->rs->post_status != 1 ? ' offline' : '') . '"' . ' id="p' . $this->rs->post_id . '">';
     $res .= '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, '', '', '', !$this->rs->isEditable()) . '</td>' . '<td class="maximal"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>' . '<td class="nowrap">' . $this->rs->user_id . '</td>' . '<td class="nowrap">' . $this->rs->nb_comment . '</td>' . '<td class="nowrap">' . $this->rs->nb_trackback . '</td>' . '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>' . '</tr>';
     return $res;
 }
开发者ID:HackerMajor,项目名称:root,代码行数:35,代码来源:list.php


示例10: render_page

 /**
  * Callback function when HTML page is rendered
  * We'll add an overlay box here.
  */
 function render_page($p)
 {
     if ($_SESSION['plugin.newuserdialog'] && $p['template'] == 'mail') {
         $this->add_texts('localization');
         $rcmail = rcmail::get_instance();
         $identity = $rcmail->user->get_identity();
         $identities_level = intval($rcmail->config->get('identities_level', 0));
         // compose user-identity dialog
         $table = new html_table(array('cols' => 2));
         $table->add('title', $this->gettext('name'));
         $table->add(null, html::tag('input', array('type' => 'text', 'name' => '_name', 'value' => $identity['name'], 'disabled' => $identities_level == 4)));
         $table->add('title', $this->gettext('email'));
         $table->add(null, html::tag('input', array('type' => 'text', 'name' => '_email', 'value' => rcube_utils::idn_to_utf8($identity['email']), 'disabled' => in_array($identities_level, array(1, 3, 4)))));
         $table->add('title', $this->gettext('organization'));
         $table->add(null, html::tag('input', array('type' => 'text', 'name' => '_organization', 'value' => $identity['organization'], 'disabled' => $identities_level == 4)));
         $table->add('title', $this->gettext('signature'));
         $table->add(null, html::tag('textarea', array('name' => '_signature', 'rows' => '3'), $identity['signature']));
         // add overlay input box to html page
         $rcmail->output->add_footer(html::tag('form', array('id' => 'newuserdialog', 'action' => $rcmail->url('plugin.newusersave'), 'method' => 'post'), html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => 'formbuttons'), html::tag('input', array('type' => 'submit', 'class' => 'button mainaction', 'value' => $this->gettext('save'))))));
         $title = rcube::JQ($this->gettext('identitydialogtitle'));
         $script = "\n\$('#newuserdialog').show()\n  .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'{$title}'})\n  .submit(function() {\n    var i, request = {}, form = \$(this).serializeArray();\n    for (i in form)\n      request[form[i].name] = form[i].value;\n\n      rcmail.http_post('plugin.newusersave', request, true);\n      return false;\n  });\n\n\$('input[name=_name]').focus();\nrcube_webmail.prototype.new_user_dialog_close = function() { \$('#newuserdialog').dialog('close'); }\n";
         // disable keyboard events for messages list (#1486726)
         $rcmail->output->add_script($script, 'docready');
         $this->include_stylesheet('newuserdialog.css');
     }
 }
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:30,代码来源:new_user_dialog.php


示例11: aworkstrackpage

 function aworkstrackpage()
 {
     $this->page();
     $this->stylesheet = "style.css";
     $this->__widgetfields[] = html::write("<script src=\"shortcuts.js\"></script><div id=\"header\"></div>");
     $this->__widgetfields[] = html::write("<h1>Seguimiento de Pedidos</h1>");
 }
开发者ID:Esleelkartea,项目名称:arotz,代码行数:7,代码来源:local.php


示例12: format

 /**
  * Форматирование значения. Вызывает обработчики вроде типографа.
  */
 public function format(Node $node, $em)
 {
     $value = $node->{$this->value};
     $ctx = Context::last();
     $ctx->registry->broadcast('ru.molinos.cms.format.text', array($ctx, $this->value, &$value));
     return html::wrap($em, html::cdata($value));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:10,代码来源:control.textarea.php


示例13: prepend

 protected function prepend()
 {
     # chargement des principales locales
     l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
     global $oktAutoloadPaths;
     #autoload
     $oktAutoloadPaths['partnersController'] = __DIR__ . '/inc/class.partners.controller.php';
     $oktAutoloadPaths['partnersRecordset'] = __DIR__ . '/inc/class.partners.recordset.php';
     #permissions
     $this->okt->addPermGroup('partners', __('m_partners_perm_group'));
     $this->okt->addPerm('partners', __('m_partners_perm_global'), 'partners');
     $this->okt->addPerm('partners_add', __('m_partners_perm_add'), 'partners');
     $this->okt->addPerm('partners_remove', __('m_partners_perm_remove'), 'partners');
     $this->okt->addPerm('partners_display', __('m_partners_perm_display'), 'partners');
     $this->okt->addPerm('partners_config', __('m_partners_perm_config'), 'partners');
     #tables
     $this->t_partners = $this->db->prefix . 'mod_partners';
     $this->t_partners_locales = $this->db->prefix . 'mod_partners_locales';
     $this->t_categories = $this->db->prefix . 'mod_partners_categories';
     $this->t_categories_locales = $this->db->prefix . 'mod_partners_categories_locales';
     #config
     $this->config = $this->okt->newConfig('conf_partners');
     $this->config->url = $this->okt->page->getBaseUrl() . $this->config->public_url[$this->okt->user->language];
     # définition des routes
     $this->okt->router->addRoute('partnersPage', new oktRoute('^(' . html::escapeHTML(implode('|', $this->config->public_url)) . ')$', 'partnersController', 'partnersPage'));
     #répertoire upload
     $this->upload_dir = OKT_UPLOAD_PATH . '/partners/';
     $this->upload_url = OKT_UPLOAD_URL . '/partners/';
     # initialisation arbre catégories
     $this->tree = new nestedTree($this->okt, $this->t_categories, 'id', 'parent_id', 'ord', array('active', 'ord'));
 }
开发者ID:jewelhuq,项目名称:okatea,代码行数:31,代码来源:module_handler.php


示例14: 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;
 }
开发者ID:leowh,项目名称:colla,代码行数:31,代码来源:model.php


示例15: delete

 public function delete($id)
 {
     access::verify_csrf();
     $item = model_cache::get("item", $id);
     access::required("view", $item);
     access::required("edit", $item);
     if ($item->is_album()) {
         $msg = t("Deleted album <b>%title</b>", array("title" => html::purify($item->title)));
     } else {
         $msg = t("Deleted photo <b>%title</b>", array("title" => html::purify($item->title)));
     }
     $parent = $item->parent();
     if ($item->is_album()) {
         // Album delete will trigger deletes for all children.  Do this in a batch so that we can be
         // smart about notifications, album cover updates, etc.
         batch::start();
         $item->delete();
         batch::stop();
     } else {
         $item->delete();
     }
     message::success($msg);
     $from_id = Input::instance()->get("from_id");
     if (Input::instance()->get("page_type") == "collection" && $from_id != $id) {
         json::reply(array("result" => "success", "reload" => 1));
     } else {
         json::reply(array("result" => "success", "location" => $parent->url()));
     }
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:29,代码来源:quick.php


示例16: 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));
     }
 }
开发者ID:mustafakarali,项目名称:b2c-1,代码行数:13,代码来源:control.php


示例17: rpc_post_subscribe

 public static function rpc_post_subscribe(Context $ctx)
 {
     $data = $ctx->post;
     if (empty($data['sections'])) {
         throw new InvalidArgumentException("Не выбраны разделы для подписки.");
     }
     if (false === strpos($data['email'], '@')) {
         throw new InvalidArgumentException(t('Введённый email не похож на email.'));
     }
     // В массиве могут быть и другие данные, поэтому мы
     // выбираем только то, что нам нужно завернуть.
     $bulk = array('email' => $data['email'], 'sections' => $data['sections']);
     $link = new url(array('args' => array('q' => 'subscription.rpc', 'action' => 'confirm', 'code' => base64_encode(serialize($bulk)))));
     $sections = Node::findXML(array('class' => 'tag', 'deleted' => 0, 'published' => 1, 'id' => $data['sections'], '#sort' => 'name'), $ctx->db, 'section');
     if (empty($sections)) {
         throw new InvalidArgumentException("Выбраны несуществующие разделы для подписки.");
     }
     $xml = html::em('message', array('mode' => 'confirm', 'host' => MCMS_HOST_NAME, 'email' => $data['email'], 'base' => $ctx->url()->getBase($ctx), 'confirmLink' => $link->string()), html::em('sections', $sections));
     $xsl = $ctx->config->get('modules/subscription/stylesheet', os::path('lib', 'modules', 'subscription', 'message.xsl'));
     if (false === ($body = xslt::transform($xml, $xsl, null))) {
         throw new RuntimeException(t('Возникла ошибка при форматировании почтового сообщения.'));
     }
     $subject = t('Подписка на новости сайта %host', array('%host' => MCMS_HOST_NAME));
     // mcms::debug($data['email'], $subject, $body);
     BebopMimeMail::send(null, $data['email'], $subject, $body);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:26,代码来源:class.subscriptionrpc.php


示例18: endwork

 /**
  * 签到下班
  * @param int $uid
  */
 public function endwork($uid = NULL)
 {
     /* 构造参数 */
     $uid = $this->app->user->id;
     $time = time();
     $ip = $_SERVER["REMOTE_ADDR"];
     $where = html::IPwhere($ip);
     $haveone = $this->dao->select('begintime')->from(TABLE_CHECK)->where('id')->eq($uid)->andwhere('endtime')->eq('')->andwhere('status')->eq('1')->orderBy('pkid desc')->limit(1)->fetch();
     if ($haveone) {
         $now = time();
         $worktime_unix = $now - $haveone->begintime;
         $worktime = $worktime_unix / 3600;
         if ($worktime_unix > 54000) {
             echo "超时签出,异常。系统将把本次的下班时间置为空,当日状态设置为 未签离";
             $result = $this->dao->update(TABLE_CHECK)->set('endtime')->eq(0)->set('status')->eq('2')->where('id')->eq($uid)->andwhere('endtime')->eq('')->andwhere('status')->eq('1')->orderBy('pkid desc')->limit(1)->exec();
             $this->loadModel('action')->create('user', $uid, 'timeout_checkout');
             exit;
         } else {
             $worktime = number_format($worktime, 1);
             echo "工作时间为" . $worktime . "小时,";
             $result = $this->dao->update(TABLE_CHECK)->set('endtime')->eq($time)->set('endip')->eq($ip)->set('status')->eq('0')->where('id')->eq($uid)->andwhere('endtime')->eq('')->andwhere('status')->eq('1')->orderBy('pkid desc')->limit(1)->exec();
             if ($result == 1) {
                 echo "下班成功";
                 $this->loadModel('action')->create('user', $uid, $where . '_endwork');
             } else {
                 echo "下班失败";
                 $this->loadModel('action')->create('user', $uid, 'failed_checkout');
             }
         }
     } else {
         echo "请先上班";
         exit;
     }
 }
开发者ID:shshenpengfei,项目名称:scrum_project_manage_system,代码行数:38,代码来源:model.php


示例19: load_snippet

 /**
  * loads in a string snippet of html from a file (if it can find the file) and returns that
  * if the snippet file is not found, this method returns false
  * {{placeholders}} within the snippet are replaced with values in the $replacements array if available
  * any leftover placeholders are then removed to avoid them being left in the returned html
  * 
  * the loaded snippet is saved to an internal array to avoid reading in the same file repeatedly
  * (such as for form elements where there may be many fields of the same type, for example)
  * @param string $filename the path to the snippet file
  * @param array $replacements an array of find/replace values to replace {{placeholders}} within the snippet with
  * @param bool $replace_all whether or not to replace all the {{placeholders}} within the snippet being loaded
  * @return boolean
  */
 public static function load_snippet($filename, $replacements, $replace_all = true)
 {
     $h = html::getInstance();
     if (!file_exists($filename)) {
         return false;
     }
     $contents = '';
     $find = $replace = array();
     if (isset($h->cached_snippets[$filename])) {
         $contents = $h->cached_snippets[$filename];
     } else {
         $fh = fopen($filename, 'r');
         while (!feof($fh)) {
             $contents .= fread($fh, 8192);
         }
         fclose($fh);
     }
     $h->cached_snippets[$filename] = $contents;
     // replace the sections in the template snippet with the values from the array passed in
     foreach ($replacements as $key => $value) {
         if ($value) {
             $find[] = '{{' . $key . '}}';
             $replace[] = $value;
         }
     }
     $contents = str_replace($find, $replace, $contents);
     // now get rid of any placeholders left that weren't used
     if ($replace_all) {
         $contents = preg_replace('/\\{\\{[^\\}]+\\}\\}/', '', $contents);
     }
     return $contents;
 }
开发者ID:AshleyJSheridan,项目名称:tweed,代码行数:45,代码来源:html.php


示例20: render

 /**
  * Render
  *
  * @param object $object
  * @return string
  */
 public static function render($object)
 {
     $input = $object->options['input'];
     $filter = $object->filter;
     $full_text_search = $filter['full_text_search'] ?? null;
     unset($filter['full_text_search']);
     // generating form
     $table = ['header' => ['name' => i18n(null, 'Column'), 'value' => i18n(null, 'Value'), 'sep' => '&nbsp;', 'value2' => '&nbsp;'], 'options' => []];
     // fields
     foreach ($filter as $k => $v) {
         if (!empty($v['range'])) {
             $table['options'][$k] = ['name' => ['value' => i18n(null, $v['name']) . ':', 'width' => '25%', 'class' => 'list_filter_name'], 'value' => ['value' => self::render_column($v, $k, false, $input), 'width' => '30%'], 'sep' => ['value' => '&mdash;', 'width' => '1%', 'class' => 'list_filter_value'], 'value2' => ['value' => self::render_column($v, $k, true, $input), 'width' => '30%']];
         } else {
             $table['options'][$k] = ['name' => ['value' => i18n(null, $v['name']) . ':', 'width' => '25%', 'class' => 'list_filter_name'], 'value' => ['value' => self::render_column($v, $k, false, $input), 'width' => '30%']];
         }
     }
     // full text search last
     if (!empty($full_text_search)) {
         $names = [];
         foreach ($full_text_search as $v) {
             $names[] = i18n(null, $filter[$v]['name']);
         }
         $table['options']['full_text_search'] = ['name' => ['value' => i18n(null, 'Text Search') . ':', 'class' => 'list_filter_name'], 'value' => ['value' => html::input(['name' => 'filter[full_text_search]', 'class' => 'list_filter_full_text_search', 'size' => 15, 'value' => $input['filter']['full_text_search'] ?? null])], 'value2' => ['value' => implode(', ', $names), 'class' => 'list_filter_value']];
     }
     $body = html::table($table);
     $footer = html::button2(['name' => 'submit_filter', 'value' => i18n(null, 'Submit'), 'type' => 'primary', 'onclick' => "numbers.modal.hide('list_{$object->list_link}_filter'); \$('#list_{$object->list_link}_form').attr('target', '_self'); \$('#list_{$object->list_link}_form').attr('no_ajax', ''); return true;"]);
     return html::modal(['id' => "list_{$object->list_link}_filter", 'class' => 'large', 'title' => i18n(null, 'Filter'), 'body' => $body, 'footer' => $footer]);
 }
开发者ID:volodymyr-volynets,项目名称:frontend,代码行数:34,代码来源:filter.php



注:本文中的html类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP html2text类代码示例发布时间:2022-05-23
下一篇:
PHP hook类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap