本文整理汇总了PHP中HTML类的典型用法代码示例。如果您正苦于以下问题:PHP HTML类的具体用法?PHP HTML怎么用?PHP HTML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTML类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: urlToData
function urlToData($url)
{
$html = new HTML();
$url = explode("/", $url);
foreach ($url as $el) {
$el = $html->sanatizeString($el);
$el = strtolower($el);
if (!$el) {
continue;
}
if (IMAGE_CHANGE_CODE && substr($el, 0, 10) == 'changecode') {
$data['changecode'] = substr($el, 11);
}
if ($this->isImage($el)) {
$data['hash'] = $el;
} else {
if ($el == 'mp4' || $el == 'raw' || $el == 'preview' || $el == 'webm') {
$data[$el] = 1;
} else {
if ($this->isSize($el)) {
$data['size'] = $el;
} else {
if ($this->isRotation($el)) {
$data['rotate'] = $el;
} else {
if ($this->isFilter($el)) {
$data['filter'][] = $el;
} else {
if ($legacy = $this->isLegacyThumbnail($el)) {
$data['hash'] = $legacy['hash'];
$data['size'] = $legacy['size'];
} else {
if ($el == 'forcesize') {
$data['forcesize'] = true;
} else {
if (strlen(MASTER_DELETE_CODE) > 10 && $el == 'delete_' . MASTER_DELETE_CODE) {
$data['delete'] = true;
}
}
}
}
}
}
}
}
}
if ($data['delete'] && $data['hash']) {
$this->deleteImage($data['hash']);
return false;
}
if ($data['mp4']) {
$hash = $data['hash'];
if (!$hash || $this->getTypeOfHash($hash) != 'gif') {
unset($data['mp4']);
}
}
return $data;
}
示例2: getContent
public function getContent($file)
{
$writer = new HTML(@IOFactory::load($file));
$html = $writer->getContent();
// Remove <style> manually
$html = preg_replace('/<style>.*<\\/style>/s', '', $html);
// Remove HTML tags
return strip_tags($html);
}
示例3: createHiddenIDs
function createHiddenIDs()
{
$input = new HTML("input");
$input->addAttr("type", "hidden");
$input->addAttr("evalID", Request::option('evalID'));
$input = new HTML("input");
$input->addAttr("type", "hidden");
$input->addAttr("itemID", Request::option('itemID'));
$input = new HTML("input");
$input->addAttr("type", "hidden");
$input->addAttr("rangeID", Request::option("rangeID"));
return;
}
示例4: renderStyles
public static function renderStyles(){
if (count(self::$_styles) == 0)
return FALSE;
self::$_styles = array_unique(self::$_styles);
switch ( Kohana::$environment){
case Kohana::DEVELOPMENT:
case Kohana::STAGING:
case kohana::TESTING:
default:
foreach (self::$_styles as $style){
echo HTML::style("media/styles/".$style);
}
break;
case Kohana::PRODUCTION:
?><link rel='stylesheet' type='text/css' href='<?php
echo url::base();
?>
min/index.php?b=media/styles&f=<?php
echo implode(",", self::$_styles);
?>
' /><?
break;
}
}
示例5: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
foreach ($this->_group_by_city() as $city => $venues) {
?>
<header>
<h4><?php
echo HTML::chars($city);
?>
</h4>
</header>
<ul class="list-unstyled row">
<?php
foreach ($venues as $venue) {
?>
<li class="col-xs-6 col-sm-4 col-md-3"><?php
echo HTML::anchor(Route::model($venue), HTML::chars($venue->name));
?>
</li>
<?php
}
?>
</ul>
<?php
}
return ob_get_clean();
}
示例6: summaryAsHTML
function summaryAsHTML($rev)
{
if (!($summary = $this->summary($rev))) {
return '';
}
return HTML::strong(array('class' => 'wiki-summary'), "(", TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), ")");
}
示例7: create
public static function create($view)
{
$view->tabs(function ($tabs) {
$tabs->tab('Module Settings', function ($view) {
$view->text('name', __('admin::module.create.form.name'), Input::old('name'));
$view->actions(function ($view) {
$view->next_tab('Next up, add some schemas <i class="icon-arrow-right icon-white"></i>', 'primary');
});
});
$tabs->tab('Schemas', function ($view) {
$view->table(function ($table) {
$table->header(array('name' => array('title' => __('admin::account.read_multiple.table.name'), 'attributes' => array('class' => 'first big')), 'relationships', 'buttons' => array('attributes' => array('class' => 'buttons last'))));
$table->no_results(function ($table) {
$table->well(function ($table) {
$table->raw(__('admin::account.read_multiple.table.no_results'));
});
});
$table->display(array('relationships' => function ($schema) {
$relationships = '';
if (isset($schema->relationships)) {
foreach ($schema->relationships as $relationship) {
$relationships .= '<b>' . $relationship->name . '</b><br>' . $relationship->type;
}
}
return $relationships;
}, 'buttons' => function ($schema) {
return HTML::link(prefix('admin') . 'module/add/', '<span class="icon-pencil"></span>', array('class' => 'btn btn-small')) . HTML::link(prefix('admin') . 'module/add/', '<span class="icon-trash icon-white"></span>', array('class' => 'btn btn-primary'));
}));
});
$view->button('#add-schema', 'Add Schema', 'primary');
});
});
}
示例8: table
/**
* Returns a new table of all work orders.
*
* @param WorkOrder|Builder $workOrder
*
* @return \Orchestra\Contracts\Html\Builder
*/
public function table($workOrder)
{
return $this->table->of('work-orders', function (TableGrid $table) use($workOrder) {
$table->with($workOrder)->paginate($this->perPage);
$table->attributes(['class' => 'table table-hover table-striped']);
$table->column('ID', 'id');
$table->column('subject', function (Column $column) {
$column->value = function (WorkOrder $workOrder) {
return link_to_route('maintenance.work-orders.show', $workOrder->subject, [$workOrder->getKey()]);
};
});
$table->column('Created At', 'created_at');
$table->column('created_by', function (Column $column) {
$column->value = function (WorkOrder $workOrder) {
return $workOrder->user->fullname;
};
});
$table->column('priority', function (Column $column) {
$column->value = function (WorkOrder $workOrder) {
if ($workOrder->priority instanceof Priority) {
return $workOrder->priority->getLabel();
}
return HTML::create('em', 'None');
};
});
$table->column('status', function (Column $column) {
$column->value = function (WorkOrder $workOrder) {
if ($workOrder->status instanceof Status) {
return $workOrder->status->getLabel();
}
return HTML::create('em', 'None');
};
});
});
}
示例9: content
/**
* Render view.
*
* @return string
*/
public function content()
{
if (!$this->blog_entries) {
return '';
}
ob_start();
?>
<ul class="list-unstyled">
<?php
foreach ($this->blog_entries as $entry) {
?>
<li><?php
echo __(':blog by :author', array(':blog' => HTML::anchor(Route::model($entry), HTML::chars($entry->name)), ':author' => HTML::user($entry->author())));
?>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
示例10: render
/**
* Render alert.
*
* @return string
*/
public function render()
{
ob_start();
// Section attributes
$attributes = array('class' => 'alert alert-block ' . $this->class);
if ($this->header === true) {
$this->header = self::generate_header();
}
?>
<div <?php
echo HTML::attributes($attributes);
?>
>
<?php
if ($this->header) {
?>
<strong><?php
echo HTML::chars($this->header);
?>
</strong><?php
}
?>
<?php
echo $this->content;
?>
</div>
<?php
return ob_get_clean();
}
示例11: content
/**
* Render view.
*
* @return string
*/
public function content()
{
if (!$this->blog_entries) {
return '';
}
ob_start();
?>
<ul class="unstyled">
<?php
foreach ($this->blog_entries as $entry) {
?>
<li><?php
echo HTML::anchor(Route::model($entry), HTML::chars($entry->name));
?>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
示例12: paginate
public function paginate($page = null, $link = null, $count = null)
{
if ($page == null) {
$page = Arr::get($_GET, 'page', 1);
}
if (!empty($_GET['item_count'])) {
$this->count = (int) Arr::get($_GET, 'item_count');
$count = $this->count;
} else {
if ($count == null) {
$count = $this->count;
} else {
$this->count = (int) $count;
}
}
if ($link == null) {
$link = Request::initial()->uri();
}
$count = (int) $count;
$page = (int) $page;
$start = $page * $count - $count;
$max_page = $this->page_count();
if ($page < 1) {
$page = 1;
} else {
$page = min($page, $max_page);
}
$prev = $page == 1 ? false : true;
$next = $page == $max_page ? false : true;
$this->orm->limit($count)->offset($start);
$this->view_vars = array('page' => $page, 'max_page' => $max_page, 'key' => $this->config->get('key', 'page'), 'count' => $count, 'link' => Security::xss_clean(HTML::chars($link)), 'next' => $next, 'prev' => $prev);
return Security::xss_clean(HTML::chars($this));
}
示例13: content
/**
* Render content.
*
* @return string
*/
public function content()
{
if (!$this->events) {
return '';
}
ob_start();
?>
<ul class="list-unstyled">
<?php
foreach ($this->events as $event) {
?>
<li>
<span title="<?php
echo Date::format(Date::DATETIME, $event->stamp_begin) . ($event->stamp_end ? ' - ' . Date::format(Date::TIME, $event->stamp_end) : '');
?>
"><?php
echo Date::format(Date::DM_PADDED, $event->stamp_begin);
?>
</span>
<?php
echo HTML::anchor(Route::model($event), HTML::chars($event->name), array('class' => 'hoverable', 'title' => HTML::chars($event->name)));
?>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
示例14: PurgePage
function PurgePage(&$request)
{
global $WikiTheme;
$page = $request->getPage();
$pagelink = WikiLink($page);
if ($request->getArg('cancel')) {
$request->redirect(WikiURL($page));
// noreturn
}
$current = $page->getCurrentRevision();
if (!$current or !($version = $current->getVersion())) {
$html = HTML::p(array('class' => 'error'), _("Sorry, this page does not exist."));
} elseif (!$request->isPost() || !$request->getArg('verify')) {
$purgeB = Button('submit:verify', _("Purge Page"), 'wikiadmin');
$cancelB = Button('submit:cancel', _("Cancel"), 'button');
// use generic wiki button look
$fieldset = HTML::fieldset(HTML::p(fmt("You are about to purge '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'purge')), HTML::div(array('class' => 'toolbar'), $purgeB, $WikiTheme->getButtonSeparator(), $cancelB)));
$sample = HTML::div(array('class' => 'transclusion'));
// simple and fast preview expanding only newlines
foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) {
$sample->pushContent($s, HTML::br());
}
$html = HTML($fieldset, HTML::div(array('class' => 'wikitext'), $sample));
} elseif ($request->getArg('currentversion') != $version) {
$html = HTML(HTML::p(array('class' => 'error'), _("Someone has edited the page!")), HTML::p(fmt("Since you started the purge process, someone has saved a new version of %s. Please check to make sure you still want to permanently purge the page from the database.", $pagelink)));
} else {
// Real purge.
$pagename = $page->getName();
$dbi = $request->getDbh();
$dbi->purgePage($pagename);
$dbi->touch();
$html = HTML::div(array('class' => 'feedback'), fmt("Purged page '%s' successfully.", $pagename));
}
GeneratePage($html, _("Purge Page"));
}
示例15: html
public function html()
{
$this->render_field->set('tag', 'option')->text($this->field->alias())->attr('value', HTML::entities($this->render_field->value));
if ($this->field->parent()->val() == $this->render_field->value) {
$this->render_field->attr('selected', 'selected');
}
}