本文整理汇总了PHP中Html类的典型用法代码示例。如果您正苦于以下问题:PHP Html类的具体用法?PHP Html怎么用?PHP Html使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Html类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testFilter
public function testFilter()
{
$filter = new Html();
$this->assertEquals('<a>test</a>', $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
示例16: sendMessage
public static function sendMessage($inputData)
{
$body = "\n\t\t\t<br>\n\t\t\tName: " . \Html::entities($inputData['name']) . "<br>\n\t\t\tEmail: " . \Html::entities($inputData['email']) . "<br>\n\t\t\tSubject: " . \Html::entities($inputData['subject']) . "<br>\n\t\t\tMessage: <br>" . \Html::entities($inputData['message']) . "<br>\n\t\t";
\Mail::send('templates.email.standard', array('body' => $body), function ($message) {
$message->to(config('gtcms.adminEmail'))->subject(config('gtcms.contactMessageSubject'));
});
}
开发者ID:gtcrais,项目名称:gtcms,代码行数:7,代码来源:Mailer.php
示例17: executeWhenAvailable
/**
* Render the special page boddy
* @param string $par The username
*/
public function executeWhenAvailable($par = '')
{
$this->offset = $this->getRequest()->getVal('offset', false);
if ($par) {
// enter article history view
$this->user = User::newFromName($par, false);
if ($this->user && ($this->user->idForName() || User::isIP($par))) {
// set page title as on desktop site - bug 66656
$username = $this->user->getName();
$out = $this->getOutput();
$out->addModuleStyles(array('mobile.pagelist.styles', 'mobile.pagesummary.styles'));
$out->setHTMLTitle($this->msg('pagetitle', $this->msg('contributions-title', $username)->plain())->inContentLanguage());
if (User::isIP($par)) {
$this->renderHeaderBar($par);
} else {
$this->renderHeaderBar($this->user->getUserPage());
}
$res = $this->doQuery();
$out->addHtml(Html::openElement('div', array('class' => 'content-unstyled')));
$this->showContributions($res);
$out->addHtml(Html::closeElement('div'));
return;
}
}
$this->showPageNotFound();
}
开发者ID:micha6554,项目名称:mediawiki-extensions-MobileFrontend,代码行数:30,代码来源:SpecialMobileContributions.php
示例18: displayValue
function displayValue($output_type, $row)
{
if (isset($row[$this->name]) && $row[$this->name]) {
return Html::convDate($row[$this->name]);
}
return '';
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:7,代码来源:columndate.class.php
示例19: fetchElement
public function fetchElement($name, $value, &$node, $control_name)
{
require_once dirname(__DIR__) . DS . 'models' . DS . 'poll.php';
$options = \Components\Poll\Models\Poll::all()->whereEquals('published', 1)->rows()->raw();
array_unshift($options, \Html::select('option', '0', '- ' . \Lang::txt('Select Poll') . ' -', 'id', 'title'));
return \Html::select('genericlist', $options, $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'title', $value, $control_name . $name);
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:7,代码来源:poll.php
示例20: showForGroup
static function showForGroup(Group $group)
{
global $DB;
$ID = $group->getField('id');
if (!$group->can($ID, READ)) {
return false;
}
$canedit = $group->can($ID, UPDATE);
if ($canedit) {
// Get data
$item = new self();
if (!$item->getFromDB($ID)) {
$item->getEmpty();
}
$rand = mt_rand();
echo "<form name='group_level_form{$rand}' id='group_level_form{$rand}' method='post'\n action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<input type='hidden' name='" . self::$items_id . "' value='{$ID}' />";
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th>" . __('Level attribution', 'itilcategorygroups') . "</th></tr>";
echo "<tr class='tab_bg_2'><td class='center'>";
Dropdown::showFromArray('lvl', array(NULL => "---", 1 => __('Level 1', 'itilcategorygroups'), 2 => __('Level 2', 'itilcategorygroups'), 3 => __('Level 3', 'itilcategorygroups'), 4 => __('Level 4', 'itilcategorygroups')), array('value' => $item->fields['lvl']));
echo "</td></tr>";
echo "</td><td class='center'>";
if ($item->fields["id"]) {
echo "<input type='hidden' name='id' value='" . $item->fields["id"] . "'>";
echo "<input type='submit' name='update' value=\"" . __('Save') . "\"\n class='submit'>";
} else {
echo "<input type='submit' name='add' value=\"" . __('Save') . "\" class='submit'>";
}
echo "</td></tr>";
echo "</table></div>";
Html::closeForm();
}
}
开发者ID:erchbox,项目名称:itilcategorygroups,代码行数:35,代码来源:group_level.class.php
注:本文中的Html类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论