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

PHP html函数代码示例

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

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



在下文中一共展示了html函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: print_processing_script

 public static function print_processing_script($order)
 {
     echo html('p', __('Your Order is strill being processed. Please wait a few seconds...', 'colabsthemes'));
     echo html('p', sprintf(__('If your Order does not complete soon, please contact us and refer to your Order ID - #%d.', 'colabsthemes'), $order->get_id()));
     $page = $_SERVER['REQUEST_URI'];
     header("Refresh:5; url={$page}");
 }
开发者ID:nickwoodland,项目名称:easysitges,代码行数:7,代码来源:paypal-form.php


示例2: wrap

 /**
  * Mark the field as editable
  *
  * @param string $content Filtered content
  * @param mixed $data Additional data like an object id etc.
  *
  * @return string Wrapped content
  */
 public function wrap($content, $data)
 {
     if (!$this->allow($data)) {
         return $content;
     }
     $data = wp_parse_args($data, array('type' => $this->input_type));
     if ('rich' == $data['type'] && !FEE_Core::$options->rich) {
         $data['type'] = 'textarea';
     }
     self::$wrapped[$data['type']] = true;
     if (is_null($content)) {
         $content = '';
     }
     if (!is_scalar($content)) {
         trigger_error("scalar expected. " . gettype($content) . " given", E_USER_WARNING);
     }
     $data = apply_filters('front_end_editor_wrap', $data, $this->filter);
     $data['filter'] = $this->filter;
     $data_attr = array();
     foreach ($data as $key => $value) {
         if (!is_scalar($value)) {
             $value = json_encode($value);
         }
         $data_attr["data-{$key}"] = $value;
     }
     $data_attr['class'] = 'fee-field';
     if ($this->was_placeholded) {
         $data_attr['title'] = FEE_Core::get_title($this->filter);
     }
     $wrap_tag = in_array($data['type'], array('textarea', 'rich', 'widget')) ? 'div' : 'span';
     if ('div' == $wrap_tag) {
         $data_attr['class'] .= ' fee-clearfix';
     }
     return html($wrap_tag, $data_attr, $content);
 }
开发者ID:radeno,项目名称:wp-front-end-editor,代码行数:43,代码来源:base.php


示例3: show

 function show()
 {
     $docs = _class('docs');
     $dir = $docs->docs_dir;
     $dir_len = strlen($dir);
     $ext = '.stpl';
     $ext_len = strlen($ext);
     $name = preg_replace('~[^a-z0-9/_-]+~ims', '', $_GET['id']);
     if (strlen($name)) {
         $dev_path = YF_PATH . '.dev/samples/classes/';
         $dev_class_path = $dev_path . $name . '.class.php';
         if (file_exists($dev_class_path)) {
             return _class($name, $dev_path)->show();
         }
         $f = $dir . $name . '.stpl';
         if (!file_exists($f)) {
             return _404('Not found');
         }
         return '<section class="page-contents">' . tpl()->parse_string(file_get_contents($f), $replace, 'doc_' . $name) . '</section>';
     }
     $url = rtrim(url('/@object/@action/')) . '/';
     $data = [];
     foreach ((array) $this->_get_misc_docs($dir) as $name) {
         $data[$name] = ['name' => $name, 'link' => $url . urlencode($name)];
     }
     ksort($data);
     return html()->li($data);
 }
开发者ID:yfix,项目名称:yf,代码行数:28,代码来源:sample_misc.class.php


示例4: render

 /**
  *
  * @since 2.0.0
  *
  * @return string
  */
 public function render()
 {
     $introduction = html('div class="intro-text"', html('h2', __('Send Posts to Subscribers', 'Postmatic')), html('p', __('Posts are sent as soon as you hit publish.<br /> Comments can be sent with a simple reply.', 'Postmatic')));
     $table_entries = array(array('title' => __('Author Subscriptions', 'Postmatic'), 'type' => 'checkbox', 'name' => 'auto_subscribe_authors', 'desc' => __('Subscribe authors to comments on their own posts.<small>(Recommended)</small>', 'Postmatic') . html('p', __('This will automatically subscribe post authors to new comment notifications on their posts. This works well to keep the author up to date with the latest comments and discussion.', 'Postmatic'))), array('title' => __('User Accounts', 'Postmatic'), 'type' => 'checkbox', 'name' => 'send_login_info', 'desc' => __('Email subscribers WordPress account credentials when they subscribe.', 'Postmatic') . html('p', __('Only necessary in some situations as all user commands are otherwise possible via email. If enabled we recommend using a good front end login plugin.', 'Postmatic'))), array('title' => __('Choose Posts to Deliver', 'Postmatic'), 'type' => 'checkbox', 'name' => 'no_post_email_default', 'desc' => __('Do not send new posts unless I choose to.', 'Postmatic') . html('p', __('Uncheck the "Do not deliver this post via email" checkbox before publishing to deliver a specific post.', 'Postmatic'))), array('title' => __('Default sending mode', 'Postmatic'), 'type' => 'checkbox', 'name' => 'excerpt_default', 'desc' => __('Send only the excerpt instead of the full post content.', 'Postmatic') . html('p', __('Enable this setting to only send excerpts with a button to read more online. You can override this on a per-post basis when drafting a new post. Note that the user will not be able to reply to the email to leave a comment because... well... who can comment on an excerpt?', 'Postmatic'))));
     $this->override_entries($table_entries);
     return $introduction . $this->form_table($table_entries);
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:13,代码来源:post-options-tab.php


示例5: document

function document()
{
    set("title", "Documents");
    set("data", Document::getAll());
    set("promos", Promo::getAll());
    return html("list.html.php", "layout.html.php");
}
开发者ID:babolivier,项目名称:isen-rentree,代码行数:7,代码来源:document.php


示例6: input

 public function input()
 {
     $input = parent::input();
     if (isset($this->data)) {
         $input->data('url', html(json_encode($this->data), false));
     } else {
         if ($page = $this->page()) {
             foreach ($page->files() as $file) {
                 if ($file->type() == 'image') {
                     $media[$file->name()]['orientation'] = (string) $file->orientation();
                     $media[$file->name()]['thumbnail'] = (string) $file->url();
                     $media[$file->name()]['width'] = (string) $file->width();
                     $media[$file->name()]['height'] = (string) $file->height();
                 }
                 if ($media[$file->name()]['type'] != 'video') {
                     $media[$file->name()]['type'] = (string) $file->type();
                 }
                 $media[$file->name()][$file->extension()] = (string) $file->url();
                 $media[$file->name()]['url'] = (string) $file->url();
                 $media[$file->name()]['name'] = (string) $file->name();
             }
             $mediajson = html(json_encode($media));
             $input->data(array('media' => $mediajson, 'field' => 'gallery'));
         }
     }
     //$input->tag('div');
     //$input->removeAttr('type');
     //$input->removeAttr('value');
     return $input;
 }
开发者ID:jonataneriksson,项目名称:juslinmaunula.com,代码行数:30,代码来源:gallery.php


示例7: indexAction

 public function indexAction()
 {
     // Display the send_us_a_file.html page if the "Send us a file" feature is on and the user is not logged in.
     if (fz_config_get('app', 'send_us_a_file_feature') && false == $this->getUser()) {
         set('start_from', Zend_Date::now()->get(Zend_Date::DATE_SHORT));
         $maxUploadSize = min(Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('upload_max_filesize')), Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('post_max_size')));
         set('max_upload_size', $maxUploadSize);
         return html('send_us_a_file.html');
     }
     $this->secure();
     $user = $this->getUser();
     $freeSpaceLeft = max(0, Fz_Db::getTable('File')->getRemainingSpaceForUser($user));
     $maxUploadSize = min(Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('upload_max_filesize')), Fz_Db::getTable('File')->shorthandSizeToBytes(ini_get('post_max_size')), $freeSpaceLeft);
     $progressMonitor = fz_config_get('app', 'progress_monitor');
     $progressMonitor = new $progressMonitor();
     set('upload_id', md5(uniqid(mt_rand(), true)));
     set('start_from', Zend_Date::now()->get(Zend_Date::DATE_SHORT));
     set('refresh_rate', 1200);
     set('files', Fz_Db::getTable('File')->findByOwnerOrderByUploadDateDesc($user));
     set('use_progress_bar', $progressMonitor->isInstalled());
     set('upload_id_name', $progressMonitor->getUploadIdName());
     set('free_space_left', $freeSpaceLeft);
     set('max_upload_size', $maxUploadSize);
     set('sharing_destinations', fz_config_get('app', 'sharing_destinations', array()));
     set('disk_usage', array('space' => '<b id="disk-usage-value">' . bytesToShorthand(Fz_Db::getTable('File')->getTotalDiskSpaceByUser($user)) . '</b>', 'quota' => fz_config_get('app', 'user_quota')));
     return html('main/index.php');
 }
开发者ID:robyandelluk,项目名称:FileZ,代码行数:27,代码来源:Main.php


示例8: _modal

 /**
  * Render a modal
  *
  * @param \FrenchFrogs\Polliwog\Modal\Modal\Bootstrap $modal
  * @return string
  */
 public function _modal(Modal\Bootstrap $modal)
 {
     $html = '';
     // header
     if ($modal->hasCloseButton()) {
         $html .= html('button', ['type' => 'button', 'class' => 'close', 'data-dismiss' => 'modal', 'aria-label' => $modal->getCloseButtonLabel()], '<span aria-hidden="true">&times;</span>');
     }
     if ($modal->hasTitle()) {
         $html .= html('h4', ['class' => static::MODAL_HEADER_TITLE_CLASS], $modal->getTitle());
     }
     $html = html('div', ['class' => static::MODAL_HEADER_CLASS], $html);
     // body
     $html .= html('div', ['class' => static::MODAL_BODY_CLASS], $modal->getBody());
     // footer
     if ($modal->hasActions()) {
         $actions = '';
         if ($modal->hasCloseButton()) {
             $actions .= html('button', ['type' => 'button', 'class' => 'btn btn-default', 'data-dismiss' => 'modal'], $modal->getCloseButtonLabel());
         }
         foreach ($modal->getActions() as $action) {
             /** @var Element\Button $action */
             $actions .= html('button', $action->getAttributes(), $action->getLabel());
         }
         $html .= html('div', ['class' => static::MODAL_FOOTER_CLASS], $actions);
     }
     // container
     if (!$modal->isOnlyContent()) {
         $html = html('div', ['class' => static::MODAL_CONTENT_CLASS, 'role' => 'document'], $html);
         $html = html('div', ['class' => static::MODAL_CLASS, 'role' => 'dialog'], $html);
     }
     return $html;
 }
开发者ID:B4CKSL4SH,项目名称:Framework,代码行数:38,代码来源:Bootstrap.php


示例9: mark_automatically

 public function mark_automatically($student_answer, &$log)
 {
     $this->msg->set_root('/auto-marking');
     $log = array();
     if (!$this->auto_marking_method) {
         throw new Exception($this->msg->_('cannot-mark-type-none'));
     }
     if (!is_string($student_answer)) {
         throw new Exception($this->msg->_('invalid-format'));
     }
     $clean_answer = Util::remove_useless_whitespaces($student_answer);
     $log[] = ['sa-running', []];
     $log[] = ['sa-pattern', [html($this->raw_answer)]];
     $log[] = ['sa-given-answer', [html($student_answer)]];
     $log[] = ['sa-given-answer-clean', [html($clean_answer)]];
     if (preg_match($this->answer, $student_answer) || preg_match($this->answer, $clean_answer)) {
         $log[] = ['sa-result-correct', []];
         $mark = 1;
     } else {
         $log[] = ['sa-result-incorrect', []];
         $mark = 0;
     }
     $log[] = ['mark', array('mark' => $mark)];
     return $mark;
 }
开发者ID:OrgAindaSemTitulo,项目名称:Sistema,代码行数:25,代码来源:QuestionSA.class.php


示例10: show

    /**
     */
    public function show()
    {
        css('
			#faq-search { padding-top: 20px; }
			#faq-items { padding-top: 20px; padding-bottom: 20px; }
			#faq-items li.li-header { list-style: none; display:none; }
			#faq-items li.li-level-0 { display: block; font-size: 15px; }
			#faq-items li.li-level-1 { padding-top: 10px; font-size: 13px; }
			span.highlight { background-color: #ff0; }
		');
        asset('jquery-highlight');
        jquery('
			var url_hash = window.location.hash.replace("/", "");
			if (url_hash) {
				$("li.li-level-0" + url_hash + " .li-level-1", "#faq-items").show();
			}
			$(".li-level-0", "#faq-items").click(function(){
				$(".li-level-1", this).toggle()
			})
			$("input#search", "#faq-search").on("change keyup", function(){
				var words = $(this).val();
				$("#faq-items").unhighlight();
				$("#faq-items").highlight(words);
				$(".li-level-1").hide().filter(":has(\'span.highlight\')").show();
			})
		');
        $items = [];
        foreach ((array) db()->from(self::table)->where('active', 1)->where('locale', conf('language'))->get_all() as $a) {
            $items[$a['id']] = ['parent_id' => $a['parent_id'], 'name' => _truncate(trim($a['title']), 60, true, '...'), 'link' => url('/@object/#/faq' . $a['id']), 'id' => 'faq' . $a['id']];
            if ($a['text']) {
                $items['1111' . $a['id']] = ['parent_id' => $a['id'], 'body' => trim($a['text'])];
            }
        }
        return tpl()->parse_string($this->_tpl, ['items' => html()->li_tree($items)]);
    }
开发者ID:yfix,项目名称:yf,代码行数:37,代码来源:yf_faq.class.php


示例11: show

function show(&$smarty, $tmp, $setting, &$html, $lv = 0, &$limit)
{
    if ($setting['shownode'] && $lv != 0) {
        if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
            $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'lists', 'arg0' => $tmp['info']['node_id']));
        }
        $html .= html($lv, $url, $tmp['info']['node_name']);
    }
    if (!$setting['shownode']) {
        if ($limit <= 0) {
            return;
        }
        #$tmp['article'] = array_slice( $tmp['article'], 0, $setting['limit'] );
    }
    if ($tmp['article']) {
        if ($setting['styleart']) {
            $tmp_lv = $setting['shownode'] ? $setting['lv'] + 1 : 2;
        } else {
            $tmp_lv = $lv + 1;
        }
        foreach ($tmp['article'] as $row) {
            if (is_object($smarty) && method_exists($smarty, 'gen_url')) {
                $url = $smarty->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'index', 'arg0' => $row['article_id']));
            }
            $html .= html($tmp_lv, $url, $row['title']);
            $limit--;
        }
    }
    if ($tmp['child']) {
        foreach ($tmp['child'] as $row) {
            show($smarty, $row, $setting, $html, $lv + 1, $limit);
        }
    }
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:34,代码来源:widget_article.php


示例12: markdown2html

function markdown2html($text)
{
    $text = html($text);
    //bold text
    $text = preg_replace('/__(.+?)__/s', '<strong>$1</strong>', $text);
    $text = preg_replace('/\\*\\*(.+?)\\*\\*/s', '<strong>$1</strong>', $text);
    //italic text
    $text = preg_replace('/_([^_]+)_/', '<em>$1</em>', $text);
    $text = preg_replace('/\\*([^\\*]+)\\*/', '<em>$1</em>', $text);
    //преобразование стиля Windows (\r\n) в стиль Unix (\n)
    $text = preg_replace('/\\r\\n/', "\n", $text);
    //преобразуем стиль MacOS (\r) в Unix (\n)
    $text = preg_replace('/\\r/', "\n", $text);
    //Абзацы. Изначальный вид >>> $text = '<p>' . preg_replace('/\n\n/', '<p></p>', $text) . '</p>'; <<< но получается слишком большое расстояние, видимо из-за двойных <p>
    $text = preg_replace('/\\n\\n/', '<p></p>', $text);
    //разрывы строки
    $text = preg_replace('/\\n/', '<br>', $text);
    // [linked text](link URL)
    $text = preg_replace('/\\[([^\\]]+)]\\(([-a-z0-9._~:\\/?#@!$&\'()*+,;=%]+)\\)/i', '<a href="$2">$1</a>', $text);
    //    // Преобразуем стиль Windows (\r\n) в Unix (\n).  Иногда вместо preg_replace можно и нужно использовать str_replace
    //    $text = str_replace("\r\n", "\n", $text);
    //    // Преобразуем стиль Macintosh (\r) в Unix (\n).
    //    $text = str_replace("\r", "\n", $text);
    //    // Абзацы
    //    $text = '<p>' . str_replace("\n\n", '</p><p>'# $text) . '</p>';
    //    // Разрывы строк
    //    $text = str_replace("\n", 1<br>1, $text);
    return $text;
}
开发者ID:Shuma2,项目名称:ianctrainings,代码行数:29,代码来源:helpers.inc.php


示例13: ready_content

 protected function ready_content()
 {
     $content = '';
     $content .= $this->send_login_warning_content();
     $content .= html('input', array('name' => $this->import_type_name, 'type' => 'hidden', 'value' => $this->import_type));
     return $this->form_wrap($content, array('value' => __('Import from Subscribe To Comments Reloaded', 'Postmatic')));
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:7,代码来源:subscribe-reloaded-import-options-tab.php


示例14: show

 /**
  */
 function show()
 {
     $deepness = 3;
     $ext = '.stpl';
     $ext_len = strlen($ext);
     foreach ((array) $this->_dir_array as $gname => $glob) {
         foreach (range(1, $deepness) as $deep) {
             $glob_pattern = $glob . '*' . str_repeat('/*', $deep) . $ext;
             foreach (glob($glob_pattern) as $path) {
                 $name = substr(implode('/', array_reverse(array_slice(array_reverse(explode('/', $path)), 0, $deep))), 0, -$ext_len);
                 $names[$name][$path] = $path;
                 $theme = implode(array_slice(array_reverse(explode('/', $path)), $deep, 1));
                 $found_in[$path] = $gname . ' | ' . $theme;
             }
         }
     }
     ksort($names);
     foreach ((array) $names as $name => $paths) {
         $links = [];
         foreach ($paths as $path) {
             $links[] = a('/file_manager/edit/' . urlencode($path), 'Edit ' . $path, 'fa fa-edit', $found_in[$path]);
         }
         $body['<b>' . $name . '</b>'] = implode(' ', $links);
     }
     return html()->simple_table($body, ['condensed' => 1]);
 }
开发者ID:yfix,项目名称:yf,代码行数:28,代码来源:yf_template_editor.class.php


示例15: niceClass

 public static function niceClass($tag = "test")
 {
     if (substr($tag, 0, 1) + 0 > 0) {
         $tag = "_number_" . $tag;
     }
     return html(str_replace(array(" ", "&"), array("_", "_-amp-_"), $tag));
 }
开发者ID:andreaskasper,项目名称:askbot_php,代码行数:7,代码来源:Tag.php


示例16: render

 protected function render()
 {
     $prop = $this->props;
     $this->beginContent();
     $xi = $prop->expandIcon;
     if ($prop->menu instanceof NavigationLinkInterface) {
         $links = $prop->excludeRoot ? $prop->menu : [$prop->menu];
     } else {
         $links = $prop->menu;
     }
     if (!$links) {
         return;
     }
     echo html(map($links, function ($link) use($xi) {
         /** @var NavigationLinkInterface $link */
         if (!$link) {
             return '';
         }
         if (is_array($link)) {
             $link = $link[0];
         }
         // Exclude hidden links and menu separators.
         if (!$link->isActuallyVisible() || $link->isGroup() && $link->title() == '-') {
             return null;
         }
         $children = $link->getMenu();
         $children->rewind();
         $active = $link->isActive() ? '.active' : '';
         $sub = $children->valid() ? '.sub' : '';
         $current = $link->isSelected() ? '.current' : '';
         $url = $link->isGroup() && !isset($link->defaultURI) ? null : $link->url();
         $header = $link->isGroup() && $link->title() != '-' ? '.header' : '';
         return [h("li{$active}{$sub}{$current}{$header}", [h("a{$active}", ['href' => $url], [when($link->icon(), h('i', ['class' => $link->icon()])), $link->title(), when(isset($xi) && $sub, h("span.{$xi}"))]), when($sub, $this->renderMenuItem($children, $xi, false))])];
     }));
 }
开发者ID:electro-modules,项目名称:matisse-components,代码行数:35,代码来源:MainMenu.php


示例17: print_processing_script

 public static function print_processing_script($order)
 {
     echo html('p', __('Your Order is strill being processed. Please wait a few seconds...', APP_TD));
     echo html('p', sprintf(__('If your Order does not complete soon, please contact us and refer to your Order ID - #%d.', APP_TD), $order->get_id()));
     $page = $_SERVER['REQUEST_URI'];
     echo html('script', 'setTimeout( function(){ location.href="' . $page . '"; }, 5000 );');
 }
开发者ID:TopLineMediaTeam,项目名称:horseshow,代码行数:7,代码来源:paypal-form.php


示例18: show

 function show()
 {
     $id = preg_replace('~[^a-z0-9_-]+~ims', '', $_GET['id']);
     if (strlen($id)) {
         if (substr($id, 0, strlen('table2_')) === 'table2_') {
             return _class($id, YF_PATH . '.dev/samples/table2/')->show();
         } else {
             return _class('docs')->_show_for($this);
         }
     }
     $ext = '.class.php';
     $ext_len = strlen($ext);
     $globs = ['yf_dev' => YF_PATH . '.dev/samples/table2/*' . $ext];
     $names = [];
     foreach ($globs as $glob) {
         foreach (glob($glob) as $cls) {
             $cls = basename($cls);
             if ($cls == __CLASS__ || false === strpos($cls, __FUNCTION__)) {
                 #					continue;
             }
             $name = substr($cls, 0, -$ext_len);
             $names[$name] = $name;
         }
     }
     $links = [];
     foreach ($names as $name) {
         $data[$name] = ['name' => $name, 'link' => url('/@object/@action/' . $name)];
     }
     return html()->li($data);
 }
开发者ID:yfix,项目名称:yf,代码行数:30,代码来源:sample_table.class.php


示例19: page_add_bookmark

function page_add_bookmark()
{
    $form = new Zebra_Form('form');
    $form->clientside_validation(array('close_tips' => true, 'on_ready' => false, 'disable_upload_validation' => true, 'scroll_to_error' => false, 'tips_position' => 'right', 'validate_on_the_fly' => true, 'validate_all' => true));
    $form->add('label', 'label_url', 'url', 'URL');
    $url = $form->add('text', 'url', 'http://');
    $url->set_rule(array('required' => array('url_error', 'URL musí být vyplněno.'), 'url' => array(true, 'url_error', 'Pole musí obsahovat platné URL (včetně protokolu).')));
    $form->add('label', 'label_title', 'title', 'Název stránky');
    $title = $form->add('text', 'title', '');
    $title->set_rule(array('required' => array('title_error', 'Název musí být vyplněn.')));
    $form->add('submit', 'submitbtn', 'Přidat');
    if ($form->validate()) {
        $ok = model_add($_POST['url'], $_POST['title'], array());
        if ($ok) {
            flash('info', 'Záložka byla vytvořena');
        } else {
            flash('error', 'Záložku se nepodařilo vytvořit.');
        }
        redirect_to('/');
    }
    // set('form', $form->render('views/add_form.php', true));
    set('form', $form->render('', true));
    set('title', 'Nová záložka');
    return html('add.html.php');
}
开发者ID:Tomas-Vahalik,项目名称:priklad-limonade-zebraform,代码行数:25,代码来源:main.php


示例20: login

 public function login($welcome = null)
 {
     if ($user = panel()->site()->user()) {
         go(panel()->urls()->index());
     }
     $message = l('login.error');
     $error = false;
     $form = panel()->form('login');
     $form->cancel = false;
     $form->save = l('login.button');
     $form->centered = true;
     if (r::is('post') and get('_csfr') and csfr(get('_csfr'))) {
         $data = $form->serialize();
         $user = site()->user(str::lower($data['username']));
         if (!$user) {
             $error = true;
         } else {
             if (!$user->hasPanelAccess()) {
                 $error = true;
             } else {
                 if (!$user->login(get('password'))) {
                     $error = true;
                 } else {
                     go(panel()->urls()->index());
                 }
             }
         }
     }
     if ($username = s::get('username')) {
         $form->fields->username->value = html($username, false);
     }
     return layout('login', array('meta' => new Snippet('meta'), 'welcome' => $welcome ? l('login.welcome') : '', 'form' => $form, 'error' => $error ? $message : false));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:33,代码来源:auth.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP html2bb_video函数代码示例发布时间:2022-05-15
下一篇:
PHP htmLawed函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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