當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Html類代碼示例

本文整理匯總了PHP中Html的典型用法代碼示例。如果您正苦於以下問題:PHP Html類的具體用法?PHP Html怎麽用?PHP Html使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Html類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testFilter

 public function testFilter()
 {
     $filter = new Html();
     $this->assertEquals('&lt;a&gt;test&lt;/a&gt;', $filter->apply('<a>test</a>'));
     $this->assertEquals('test', $filter->apply('test'));
     // test error message
     $this->assertErrorMessage($filter->getErrorMessage());
 }
開發者ID:seytar,項目名稱:psx,代碼行數:8,代碼來源:HtmlTest.php

示例2: displayTabContentForItem

 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     echo "<form name='notificationtargets_form' id='notificationtargets_form'\n             method='post' action=' ";
     echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
     echo "<table class    ='tab_cadre_fixe'>";
     echo '<tr><th colspan="2">' . __('Access type', 'formcreator') . '</th></tr>';
     echo '<td>' . __('Access', 'formcreator') . '</td>';
     echo '<td>';
     Dropdown::showFromArray('access_rights', array(PluginFormcreatorForm::ACCESS_PUBLIC => __('Public access', 'formcreator'), PluginFormcreatorForm::ACCESS_PRIVATE => __('Private access', 'formcreator'), PluginFormcreatorForm::ACCESS_RESTRICTED => __('Restricted access', 'formcreator')), array('value' => isset($item->fields["access_rights"]) ? $item->fields["access_rights"] : 1));
     echo '</td>';
     if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
         echo '<tr><th colspan="2">' . self::getTypeName(2) . '</th></tr>';
         $table = getTableForItemType(__CLASS__);
         $table_profile = getTableForItemType('Profile');
         $query = "SELECT p.`id`, p.`name`, IF(f.`plugin_formcreator_profiles_id` IS NOT NULL, 1, 0) AS `profile`\n                   FROM {$table_profile} p\n                   LEFT JOIN {$table} f\n                     ON p.`id` = f.`plugin_formcreator_profiles_id`\n                     AND f.`plugin_formcreator_forms_id` = " . (int) $item->fields['id'];
         $result = $GLOBALS['DB']->query($query);
         while (list($id, $name, $profile) = $GLOBALS['DB']->fetch_array($result)) {
             $checked = $profile ? ' checked' : '';
             echo '<tr><td colspan="2"><label>';
             echo '<input type="checkbox" name="profiles_id[]" value="' . $id . '" ' . $checked . '> ';
             echo $name;
             echo '</label></td></tr>';
         }
     }
     echo '<tr>';
     echo '<td class="center" colspan="2">';
     echo '<input type="hidden" name="profiles_id[]" value="0" />';
     echo '<input type="hidden" name="form_id" value="' . (int) $item->fields['id'] . '" />';
     echo '<input type="submit" name="update" value="' . __('Save') . '" class="submit" />';
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
 }
開發者ID:ChristopheG77,項目名稱:formcreator,代碼行數:34,代碼來源:formprofiles.class.php

示例3: check

 public function check()
 {
     $username = $_POST['username'];
     $password = $_POST['password'];
     $conn = Db::getConnection();
     $sql = "SELECT username, password, admin\n\t\t\t\tFROM users\n\t\t\t\tWHERE username = '{$username}'";
     $q = $conn->prepare($sql);
     $q->execute();
     $users = $q->fetch(\PDO::FETCH_ASSOC);
     //var_dump($users);die('  proba');
     $logger = new Logger();
     $error = $logger->checkCredentials($password, $users);
     //$isAdmin = $logger->checkAdmin($password,$users);
     //var_dump($error);die('   ajde vise!!!');
     if ($error) {
         //echo '<pre>'; var_dump($error);die(); echo '</pre>';
         $html = new Html($this->controllerName);
         $html->error = $error;
         //echo '<pre>'; var_dump($html->error);die(); echo '</pre>';
         $html->render('index');
     } else {
         $user = new User($users['username'], $users['admin']);
         $user->login();
         //var_dump($user);die('   jebem li ga');
         header('Location: /');
     }
 }
開發者ID:Mikili975,項目名稱:news_obj,代碼行數:27,代碼來源:LoginController.php

示例4: testSetGetStorageAsText

 /**
  * Test that the storage number can be set and retrieved.
  */
 public function testSetGetStorageAsText()
 {
     $text = 'test';
     $html = new Html();
     $html->set('test', $text);
     $this->assertSame($text, $html->get('test'));
 }
開發者ID:ucsdmath,項目名稱:html,代碼行數:10,代碼來源:BaseTestStatus.php

示例5: tagField

function tagField($db, $limit = null)
{
    $nsid = $_SESSION['namespace_id'] ? $_SESSION['namespace_id'] : DB_PUBNS;
    $sql = sprintf('select t.name, m.tag, count(m.tag) as num from tagmap as ' . 'm, tags as t where t.id=m.tag and t.namespace=%d group by tag ' . 'order by date desc', $nsid);
    $sql .= !is_null($limit) ? ' LIMIT ' . $limit : null;
    $max_size = 250;
    $min_size = 100;
    if (!($result = $db->query($sql))) {
        debug_hook('Failed to load tag cloud!', __METHOD__);
        return;
    }
    while ($row = $result->fetch_assoc()) {
        $tags[$row['name']] = $row['num'];
    }
    $max_value = max(array_values($tags));
    $min_value = min(array_values($tags));
    $spread = $max_value - $min_value;
    if ($spread == 0) {
        $spread = 1;
    }
    $step = ($max_size - $min_size) / $spread;
    print '<div id="tags">';
    foreach ($tags as $key => $value) {
        $size = ceil($min_size + ($value - $min_value) * $step);
        $a = new Html('a');
        $a->attr('style', 'font-size: ' . $size . '%');
        $a->attr('href', DB_LOC . '/tags/' . urlencode($key));
        $a->data(str_replace('_', ' ', $key));
        $a->write();
        print '(' . $value . '), ';
    }
    print '<a href="' . DB_LOC . '/">all</a>';
    print '</div>';
}
開發者ID:richardmarshall,項目名稱:image-dropbox,代碼行數:34,代碼來源:func.php

示例6: add

 public function add($data)
 {
     $ContentModel = ContentModel::getInstance($this->_mid);
     if (!isset($this->_model[$this->_mid])) {
         $this->error = '模型不存在';
     }
     $ContentInputModel = new ContentInputModel($this->_mid);
     $insertData = $ContentInputModel->get($data);
     if ($insertData == false) {
         $this->error = $ContentInputModel->error;
         return false;
     }
     if ($ContentModel->create($insertData)) {
         $result = $ContentModel->add($insertData);
         $aid = $result[$ContentModel->table];
         $this->editTagData($aid);
         M('upload')->where(array('uid' => $_SESSION['uid']))->save(array('state' => 1));
         //============記錄動態
         $DMessage = "發表了文章:<a target='_blank' href='" . U('Index/Index/content', array('mid' => $insertData['mid'], 'cid' => $insertData['cid'], 'aid' => $aid)) . "'>{$insertData['title']}</a>";
         addDynamic($_SESSION['uid'], $DMessage);
         //內容靜態
         $Html = new Html();
         $Html->content($this->find($aid));
         $categoryCache = cache('category');
         $cat = $categoryCache[$insertData['cid']];
         $Html->relation_category($insertData['cid']);
         $Html->index();
         return $aid;
     } else {
         $this->error = $ContentModel->error;
         return false;
     }
 }
開發者ID:jyht,項目名稱:v5,代碼行數:33,代碼來源:Content.class.php

示例7: create

 public function create()
 {
     $firstname = $_POST['firstname'];
     $lastname = $_POST['lastname'];
     $email = $_POST['email'];
     $username = $_POST['username'];
     $password = password_hash($_POST['password'], PASSWORD_BCRYPT);
     $conn = Db::getConnection();
     $sql = "SELECT *\n\t\t\t\tFROM users";
     $q = $conn->prepare($sql);
     $q->execute();
     $users = $q->fetchAll(\PDO::FETCH_ASSOC);
     $validator = new Validator();
     $error = $validator->validateRegisterForm($_POST, $users);
     //echo '<pre>'; var_dump($error); echo '</pre>';die();
     if ($error) {
         //echo '<pre>'; var_dump($error);die(); echo '</pre>';
         $html = new Html($this->controllerName);
         $html->error = $error;
         //echo '<pre>'; var_dump($html->error);die(); echo '</pre>';
         //;kweojn'dlfv'dlfkv
         $html->render('index');
     } else {
         $newUserSql = "INSERT INTO users\n\t\t\t(`firstname`, `lastname`, `email`, `username`, `password`, `admin`)\n\t\t\tVALUES\n\t\t\t('{$firstname}', '{$lastname}', '{$email}', '{$username}', '{$password}', '0')";
         $q = $conn->prepare($newUserSql);
         $q->execute();
         header('Location: /login/index');
     }
 }
開發者ID:Mikili975,項目名稱:news_obj,代碼行數:29,代碼來源:RegisterController.php

示例8: placeLink

 public function placeLink(Html $row, DibiRow $data, $pres)
 {
     foreach ($row->getChildren() as $cell) {
         $inside = $cell->getText();
         $cell->setText('');
         $cell->add(Html::el('a')->href($this->link(":Front:{$pres}:", $data['link']))->setText($inside));
     }
 }
開發者ID:xixixao,項目名稱:chytrapalice,代碼行數:8,代碼來源:AuthorPresenter.php

示例9: _before_add

 function _before_add()
 {
     $html = new Html();
     $fields_type = $this->_mod->site_model_fields();
     $this->assign('fields_type', $html->select($fields_type, 'formtype'));
     $regexp = $this->_mod->regexp();
     $this->assign('verification_select', $html->select($regexp, 'verification_select', '', 'id="J_verification_select" style="width:100px"'));
 }
開發者ID:kjzwj,項目名稱:jcms,代碼行數:8,代碼來源:model_fieldsAction.class.php

示例10: getPreAuthPage

 private function getPreAuthPage()
 {
     $mainTag = new Html();
     $head = new Head();
     $head->addChild("\n            <title>Admin page</title>\n            <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n            <link rel='shortcut icon' href='images/system/favicon.ico' type='image/x-icon'/>\n            <link rel='stylesheet' type='text/css' href='/src/front/style/style-less.css'/>\n            <script type='text/javascript' src='/src/front/js/fixies.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/jquery.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/jquery-1.10.2.js'></script>\n            <script type='text/javascript' src='/src/front/js/ext/tinycolor.js'></script>\n            <script type='text/javascript' src='/src/front/js/v-utils.js'></script>\n            <script type='text/javascript' src='/src/front/js/utils.js'></script>\n            <script type='text/javascript' src='/src/front/js/admin.js'></script>\n            <script type='text/javascript' src='/src/front/js/components/vCore-effects.js'></script>\n            ");
     $body = new Body();
     $body->addChild("\n            <div class='admin_auth_container' >\n                <div class='auth_header f-20'>Авторизация</div>\n                <label class='f-15' for='user'>User</label>\n                <input id='user'>\n                <label class='f-15' for='password'>Password</label>\n                <input id='password' type='password'>\n                <button class='button f-20 input_hover'>Войти</button>\n            </div>\n            <script type='text/javascript'>\n                /*inputHoverModule.update();*/\n            </script>\n        ");
     return $mainTag->addChildList([$head, $body]);
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:9,代碼來源:AdminPage.php

示例11: deploy

 public function deploy($element, $flag, $alias = '', $view = '', $schema = '')
 {
     $h = new Html();
     if ($flag == 0) {
         $attr = '{"id":"' . $alias . '-' . $view . '"}';
         $h->b($element, 0, 1, $schema, $attr);
     } else {
         $h->b($element, 1, 1);
     }
 }
開發者ID:antfuentes87,項目名稱:titan,代碼行數:10,代碼來源:Article.php

示例12: getHtml

 public function getHtml()
 {
     $html = new Html();
     $head = new Head();
     $head->addChild("\n        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n        <meta http-equiv='cache-control' content='max-age=0' />\n        <meta http-equiv='cache-control' content='no-cache' />\n        <meta http-equiv='expires' content='0' />\n        <meta http-equiv='expires' content='Tue, 01 Jan 1980 1:00:00 GMT' />\n        <meta http-equiv='pragma' content='no-cache' />\n        <link rel='stylesheet' type='text/css' href='/src/front/style/admin-page.css'>\n        ");
     $head->addChild(Components::getMenu());
     $head->addChildList($this->getHeadContent());
     $body = new Body();
     $body->addChildList($this->getGeneralContent());
     return $this->pagePrefix . $html->addChildList([$head, $body])->getHtml();
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:11,代碼來源:AdminPagesCreator.php

示例13: _before_edit

 function _before_edit()
 {
     $html = new Html();
     $advertising_list = $this->get_advertising();
     $input_data = join(',', $advertising_list);
     $selected = $this->_mod->where(array('id' => $this->_get('id')))->getField('advertising');
     $advertising = $html->input('select', 'advertising', $input_data, 'advertising', '', $selected);
     $this->assign('advertising', $advertising);
     //廣告位
     $this->assign('iframe_tools', true);
     //iFrame彈窗
 }
開發者ID:kjzwj,項目名稱:jcms,代碼行數:12,代碼來源:picshowAction.class.php

示例14: testInterpret

 public function testInterpret()
 {
     /** @var \Magento\Framework\View\Layout\Reader\Context $readerContext */
     $readerContext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Framework\\View\\Layout\\Reader\\Context');
     $pageXml = new \Magento\Framework\View\Layout\Element(__DIR__ . '/_files/_layout_update.xml', 0, true);
     $parentElement = new \Magento\Framework\View\Layout\Element('<page></page>');
     $html = new Html();
     foreach ($pageXml->xpath('html') as $htmlElement) {
         $html->interpret($readerContext, $htmlElement, $parentElement);
     }
     $structure = $readerContext->getPageConfigStructure();
     $this->assertEquals(['html' => ['test-name' => 'test-value']], $structure->getElementAttributes());
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:HtmlTest.php

示例15: index

 public function index()
 {
     $conn = Db::getConnection();
     $articleModel = new Article();
     $firstFiveArticles = $articleModel->getArticles($conn, 5);
     //var_dump($firstFiveArticles);die('lele');
     foreach ($firstFiveArticles as &$article) {
         $article['time'] = $articleModel->formatArticleDate($article["time"]);
         //date("d.m.Y H:i",strtotime($article["time"]))
     }
     $html = new Html($this->controllerName);
     $html->firstFiveArticles = $firstFiveArticles;
     $html->render('home');
     //var_dump($result);die();
 }
開發者ID:Mikili975,項目名稱:news_obj,代碼行數:15,代碼來源:SiteController.php


注:本文中的Html類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。