本文整理汇总了PHP中fHTML类的典型用法代码示例。如果您正苦于以下问题:PHP fHTML类的具体用法?PHP fHTML怎么用?PHP fHTML使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了fHTML类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: findOptionByMainCategoryCode
static function findOptionByMainCategoryCode($key)
{
$tempRecords = self::findByMainCategoryCode($key);
foreach ($tempRecords as $tempRecord) {
fHTML::printOption($tempRecord->prepareDescription() . " [" . $tempRecord->prepareCategoryCode() . "]", $tempRecord->prepareId());
}
}
开发者ID:JhunCabas,项目名称:material-management,代码行数:7,代码来源:Inv_subcategory.php
示例2: getRow
public function getRow($row)
{
$r = array();
$r[0] = $row;
// rank
$id = $text = $this->owners[$row - 1]['id'];
if (strlen($name = $this->owners[$row - 1]['name'])) {
$text .= ' ' . $name;
}
$id = fHTML::encode($id);
$text = fHTML::encode($text);
if (empty($id)) {
$r[1] = $text;
} else {
$r[1] = '<a href="' . SITE_BASE . "/status?owner={$id}\">{$text}</a>";
}
$n = count($this->headers);
for ($i = 2; $i < $n; $i++) {
if ($this->scores[$row - 1][$i - 2] == '-') {
$r[$i] = $this->scores[$row - 1][$i - 2];
} else {
if ($i < $n - 3) {
$r[$i] = '<a href="' . SITE_BASE . "/status?owner={$id}&problem={$this->headers[$i]}\">{$this->scores[$row - 1][$i - 2]}</a>";
} else {
if ($i < $n - 2) {
$r[$i] = '<a href="' . SITE_BASE . "/status?owner={$id}&verdict=1\">{$this->scores[$row - 1][$i - 2]}</a>";
} else {
$r[$i] = $this->scores[$row - 1][$i - 2];
}
}
}
}
return $r;
}
开发者ID:daerduoCarey,项目名称:oj,代码行数:34,代码来源:BoardTable.php
示例3: findAllOption
static function findAllOption($default = null)
{
$tempRecords = self::findAll();
foreach ($tempRecords as $tempRecord) {
fHTML::printOption($tempRecord->prepareName(), $tempRecord->prepareId(), $default);
}
}
开发者ID:JhunCabas,项目名称:material-management,代码行数:7,代码来源:Branch.php
示例4: findCurrentMonthOption
static function findCurrentMonthOption($month, $year)
{
$tempRecords = self::findCurrentMonth($month, $year);
foreach ($tempRecords as $tempRecord) {
fHTML::printOption($tempRecord->prepareCountry() . " [" . $tempRecord->prepareExchange(2) . "]", $tempRecord->prepareId(), null);
}
}
开发者ID:JhunCabas,项目名称:material-management,代码行数:7,代码来源:Currency.php
示例5: findAllOption
static function findAllOption()
{
$tempRecords = self::findAll();
foreach ($tempRecords as $tempRecord) {
fHTML::printOption($tempRecord->prepareDescription() . " [" . $tempRecord->prepareCategoryCode() . "]", $tempRecord->prepareCategoryCode());
}
}
开发者ID:JhunCabas,项目名称:material-management,代码行数:7,代码来源:Inv_maincategory.php
示例6: findAllOption
static function findAllOption()
{
$tempRecords = self::findAll();
foreach ($tempRecords as $tempRecord) {
fHTML::printOption($tempRecord->prepareId(), $tempRecord->prepareId());
}
}
开发者ID:JhunCabas,项目名称:material-management,代码行数:7,代码来源:Document_type.php
示例7: index
public function index()
{
$this->cache_control('private', 5);
if ($pid = fRequest::get('id', 'integer')) {
Util::redirect('/problem/' . $pid);
}
$view_any = User::can('view-any-problem');
$this->page = fRequest::get('page', 'integer', 1);
$this->title = trim(fRequest::get('title', 'string'));
$this->author = trim(fRequest::get('author', 'string'));
$this->problems = Problem::find($view_any, $this->page, $this->title, $this->author);
$this->page_url = SITE_BASE . '/problems?';
if (!empty($this->title)) {
$this->page_url .= 'title=' . fHTML::encode($this->title) . '&';
}
if (!empty($this->author)) {
$this->page_url .= 'author=' . fHTML::encode($this->author) . '&';
}
$this->page_url .= 'page=';
$this->page_records = $this->problems;
$this->nav_class = 'problems';
$this->render('problem/index');
}
开发者ID:daerduoCarey,项目名称:oj,代码行数:23,代码来源:ProblemController.php
示例8: printOption
/**
* Prints an `option` tag with the provided value, using the selected value to determine if the option should be marked as selected
*
* @param string $text The text to display in the option tag
* @param string $value The value for the option
* @param string $selected_value If the value is the same as this, the option will be marked as selected
* @return void
*/
public static function printOption($text, $value, $selected_value = NULL)
{
$selected = FALSE;
if ($value == $selected_value || is_array($selected_value) && in_array($value, $selected_value)) {
$selected = TRUE;
}
echo '<option value="' . fHTML::encode($value) . '"';
if ($selected) {
echo ' selected="selected"';
}
echo '>' . fHTML::prepare($text) . '</option>';
}
开发者ID:philip,项目名称:flourish,代码行数:20,代码来源:fHTML.php
示例9: printPiece
/**
* Prints out a piece of a template
*
* @param string $template The name of the template to print
* @param string $piece The piece of the template to print
* @param array $data The data to replace the variables with
* @return void
*/
private static function printPiece($template, $name, $data)
{
if (!isset(self::$templates[$template]['pieces'][$name])) {
throw new fProgrammerException('The template piece, %s, was not specified when defining the %s template', $name, $template);
}
$piece = self::$templates[$template]['pieces'][$name];
preg_match_all('#\\{\\{ (\\w+)((?:\\|\\w+)+)? \\}\\}#', $piece, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$variable = $match[1];
$value = !isset($data[$variable]) ? NULL : $data[$variable];
if (isset($match[2])) {
$filters = array_slice(explode('|', $match[2]), 1);
foreach ($filters as $filter) {
if (!in_array($filter, self::$filters)) {
throw new fProgrammerException('The filter specified, %1$s, is invalid. Must be one of: %2$s.', $filter, join(', ', self::$filters));
}
if (!strlen($value)) {
continue;
}
if ($filter == 'inflect') {
$value = fGrammar::inflectOnQuantity($data['total_records'], $value);
} elseif ($filter == 'lower') {
$value = fUTF8::lower($value);
} elseif ($filter == 'url_encode') {
$value = urlencode($value);
} elseif ($filter == 'humanize') {
$value = fGrammar::humanize($value);
}
}
}
$piece = preg_replace('#' . preg_quote($match[0], '#') . '#', fHTML::encode($value), $piece, 1);
}
echo $piece;
}
开发者ID:alandsidel,项目名称:flourish-classes,代码行数:42,代码来源:fPagination.php
示例10: prepare
/**
* Gets the value of an element and runs it through fHTML::prepare()
*
* @param string $element The element to get
* @param mixed $default_value The value to return if the element has not been set
* @return mixed The value of the element specified run through fHTML::prepare(), or the default value if it has not been set
*/
public function prepare($element, $default_value = NULL)
{
return fHTML::prepare($this->get($element, $default_value));
}
开发者ID:philip,项目名称:flourish,代码行数:11,代码来源:fTemplating.php
示例11: show
/**
* Retrieves a message, removes it from the session and prints it - will not print if no content
*
* The message will be printed in a `p` tag if it does not contain
* any block level HTML, otherwise it will be printed in a `div` tag.
*
* @param mixed $name The name or array of names of the message(s) to show, or `'*'` to show all
* @param string $recipient The intended recipient
* @param string $css_class Overrides using the `$name` as the CSS class when displaying the message - only used if a single `$name` is specified
* @return boolean If one or more messages was shown
*/
public static function show($name, $recipient = NULL, $css_class = NULL)
{
if ($recipient === NULL) {
$recipient = '{default}';
}
// Find all messages if * is specified
if (is_string($name) && $name == '*') {
fSession::open();
$prefix = __CLASS__ . '::' . $recipient . '::';
$keys = array_keys($_SESSION);
$name = array();
foreach ($keys as $key) {
if (strpos($key, $prefix) === 0) {
$name[] = substr($key, strlen($prefix));
}
}
}
// Handle showing multiple messages
if (is_array($name)) {
$shown = FALSE;
$names = $name;
foreach ($names as $name) {
$class = trim(self::$class . ' ' . $name);
$class = $css_class === NULL ? $class : $css_class;
$shown = fHTML::show(self::retrieve($name, $recipient), $class, TRUE) || $shown;
}
return $shown;
}
$class = self::$class . ' ' . $name;
$class = $css_class === NULL ? $class : $css_class;
// Handle a single message
return fHTML::show(self::retrieve($name, $recipient), $class, TRUE);
}
开发者ID:gopalgrover23,项目名称:flourish-classes,代码行数:44,代码来源:fMessaging.php
示例12:
"><?php
echo fHTML::prepare($v->getName());
?>
</h3>
<a href="#variables">[list]</a>
<?php
if (User::can('set-variable')) {
?>
<a href="?edit=<?php
echo fHTML::encode($v->getName());
?>
#set_variable">[edit]</a>
<a href="?remove=<?php
echo fHTML::encode($v->getName());
?>
#set_variable">[remove]</a>
<?php
}
?>
<pre><?php
echo fHTML::encode($v->getValue());
?>
</pre>
<?php
}
?>
</fieldset>
</form>
<?php
}
include __DIR__ . '/../layout/footer.php';
开发者ID:daerduoCarey,项目名称:oj,代码行数:31,代码来源:index.php
示例13: catch
if (fRequest::isPost()) {
$user->populate();
if ($GLOBALS['ALLOW_HTTP_AUTH'] && $user->getUserId() != 1) {
$password = 'basic_auth';
} else {
$password = fCryptography::hashPassword($user->getPassword());
$user->setPassword($password);
}
fRequest::validateCSRFToken(fRequest::get('token'));
$user->store();
fMessaging::create('affected', User::makeUrl('list'), $user->getUsername());
fMessaging::create('success', User::makeUrl('list'), 'The user ' . $user->getUsername() . ' was successfully updated');
fURL::redirect(User::makeUrl('list'));
}
} catch (fNotFoundException $e) {
fMessaging::create('error', User::makeUrl('list'), 'The user requested, ' . fHTML::encode($user_id) . ', could not be found');
fURL::redirect(User::makeUrl('list'));
} catch (fExpectedException $e) {
fMessaging::create('error', fURL::get(), $e->getMessage());
}
include VIEW_PATH . '/add_edit_user.php';
// --------------------------------- //
} elseif ('add' == $action) {
$user = new User();
if (fRequest::isPost()) {
try {
$user->populate();
if ($GLOBALS['ALLOW_HTTP_AUTH']) {
$password = 'basic_auth';
} else {
$password = fCryptography::hashPassword($user->getPassword());
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:31,代码来源:user.php
示例14: prepareMoneyColumn
/**
* Prepares a money column by calling fMoney::format()
*
* @internal
*
* @param fActiveRecord $object The fActiveRecord instance
* @param array &$values The current values
* @param array &$old_values The old values
* @param array &$related_records Any records related to this record
* @param array &$cache The cache array for the record
* @param string $method_name The method that was called
* @param array $parameters The parameters passed to the method
* @return string The formatted monetary value
*/
public static function prepareMoneyColumn($object, &$values, &$old_values, &$related_records, &$cache, $method_name, $parameters)
{
list($action, $column) = fORM::parseMethod($method_name);
if (empty($values[$column])) {
return $values[$column];
}
$value = $values[$column];
$remove_zero_fraction = FALSE;
if (count($parameters)) {
$remove_zero_fraction = $parameters[0];
}
if ($value instanceof fMoney) {
$value = $value->format($remove_zero_fraction);
}
return fHTML::prepare($value);
}
开发者ID:hibble,项目名称:printmaster,代码行数:30,代码来源:fORMMoney.php
示例15: prepareNumberColumn
/**
* Prepares a number column by calling fNumber::format()
*
* @internal
*
* @param fActiveRecord $object The fActiveRecord instance
* @param array &$values The current values
* @param array &$old_values The old values
* @param array &$related_records Any records related to this record
* @param array &$cache The cache array for the record
* @param string $method_name The method that was called
* @param array $parameters The parameters passed to the method
* @return string The formatted link
*/
public static function prepareNumberColumn($object, &$values, &$old_values, &$related_records, &$cache, $method_name, $parameters)
{
list($action, $subject) = fORM::parseMethod($method_name);
$column = fGrammar::underscorize($subject);
$class = get_class($object);
$table = fORM::tablize($class);
$schema = fORMSchema::retrieve($class);
$column_info = $schema->getColumnInfo($table, $column);
$value = $values[$column];
if ($value instanceof fNumber) {
if ($column_info['type'] == 'float') {
$decimal_places = isset($parameters[0]) ? (int) $parameters[0] : $column_info['decimal_places'];
if ($decimal_places !== NULL) {
$value = $value->trunc($decimal_places)->format();
} else {
$value = $value->format();
}
} else {
$value = $value->format();
}
}
return fHTML::prepare($value);
}
开发者ID:gopalgrover23,项目名称:flourish-classes,代码行数:37,代码来源:fORMColumn.php
示例16: strpos
<?php
fHTML::sendHeader();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php
echo $this->get('lang');
?>
" lang="<?php
echo $this->get('lang');
?>
">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="google-site-verification" content="vWXUlrnTL08knWQIGwumeb38qgYZlsrXc5VReJ1bUbs" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta property="og:title" content="Safecast" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.safecast.org" />
<meta property="og:image" content="http://www.safecast.org/images/logo.png" />
<meta property="og:site_name" content="Safecast" />
<meta property="fb:admins" content="595809984" />
<meta name="description" content="Safecast is a website that aggregates radioactivity data from throughout the world in order to provide real-time hyper-local information about the status of the Japanese nuclear crisis.">
<meta name="keywords" content="japan,fukushima,radiation,nuclear,reactor,geiger,counter,RDTN,Safecast">
<title><?php
echo $this->prepare('title');
echo strpos($this->get('title'), 'Safecast') === FALSE ? ' - Safecast' : '';
?>
</title>
<base href="<?php
开发者ID:hicapacity,项目名称:safecast.org,代码行数:31,代码来源:header_headless.php
示例17: printSortableColumn
/**
* Prints a sortable column header `a` tag
*
* The a tag will include the CSS class `'sortable_column'` and the
* direction being sorted, `'asc'` or `'desc'`.
*
* {{{
* #!php
* fCRUD::printSortableColumn('name', 'Name');
* }}}
*
* would create the following HTML based on the page context
*
* {{{
* #!html
* <!-- If name is the current sort column in the asc direction, the output would be -->
* <a href="?sort=name&dir=desc" class="sorted_column asc">Name</a>
*
* <!-- If name is not the current sort column, the output would be -->
* <a href="?sort-name&dir=asc" class="sorted_column">Name</a>
* }}}
*
* @param string $column The column to create the sortable header for
* @param string $column_name This will override the humanized version of the column
* @return void
*/
public static function printSortableColumn($column, $column_name = NULL)
{
if ($column_name === NULL) {
$column_name = fGrammar::humanize($column);
}
if (self::$sort_column == $column) {
$sort = $column;
$direction = self::$sort_direction == 'asc' ? 'desc' : 'asc';
} else {
$sort = $column;
$direction = 'asc';
}
$columns = array_merge(array('sort', 'dir'), array_keys(self::$search_values));
$values = array_merge(array($sort, $direction), array_values(self::$search_values));
$url = fHTML::encode(fURL::get() . fURL::replaceInQueryString($columns, $values));
$css_class = self::$sort_column == $column ? ' ' . self::$sort_direction : '';
$column_name = fHTML::prepare($column_name);
echo '<a href="' . $url . '" class="sortable_column' . $css_class . '">' . $column_name . '</a>';
}
开发者ID:gopalgrover23,项目名称:flourish-classes,代码行数:45,代码来源:fCRUD.php
示例18: prepare
/**
* Gets a value from ::get() and passes it through fHTML::prepare()
*
* @param string $key The key to get the value of
* @param string $cast_to Cast the value to this data type
* @param mixed $default_value If the parameter is not set in the `DELETE`/`PUT` post data, `$_POST` or `$_GET`, use this value instead
* @return string The prepared value
*/
public static function prepare($key, $cast_to = NULL, $default_value = NULL)
{
return fHTML::prepare(self::get($key, $cast_to, $default_value));
}
开发者ID:hibble,项目名称:printmaster,代码行数:12,代码来源:fRequest.php
示例19: foreach
<select name="over_under" class="span3">
<?
foreach ($over_under_array as $value => $text) {
fHTML::printOption($text, $value, $check->getOverUnder());
}
?>
</select>
</div>
</div><!-- /clearfix -->
<div class="clearfix">
<label for="check-visibility">Visibility<em>*</em></label>
<div class="input">
<select name="visibility" class="span3">
<?
foreach ($visibility_array as $value => $text) {
fHTML::printOption($text, $value, $check->getVisibility());
}
?>
</select>
</div>
</div><!-- /clearfix -->
<div class="clearfix">
<label for="check-repeat_delay">Repeat Delay<em>*</em></label>
<div class="input">
<?php
$check_delay = (is_null($check->getRepeatDelay()) ? 30 : $check->encodeRepeatDelay()); ?>
<input id="check-repeat_delay" class="span3" type="text" size="20" name="repeat_delay" value="<?=$check_delay; ?>" />
</div>
</div><!-- /clearfix -->
</fieldset>
<fieldset>
开发者ID:nleskiw,项目名称:Graphite-Tattle,代码行数:31,代码来源:add_edit.php
示例20: array
</p>
<p>Target : <?php
echo Check::constructTarget($check);
?>
</p>
<p id="graphiteGraph"><?php
echo Check::showGraph($check);
?>
</p>
<div class="row">
<div class="col-md-4">
<select id="graphiteDateRange" class="form-control">
<?php
$dateRange = array('-12hours' => '12 Hours', '-1days' => '1 Day', '-3days' => '3 Days', '-7days' => '7 Days', '-14days' => '14 Days', '-30days' => '30 Days', '-60days' => '60 Days');
foreach ($dateRange as $value => $text) {
fHTML::printOption($text, $value, '-3days');
}
?>
</select>
</div>
<div class="col-md-4">
<input class="btn btn-primary" type="submit" value="Reload Graph" onClick="reloadGraphiteGraph()"/>
</div>
</div>
</fieldset>
</div>
<?php
}
?>
</div>
</div>
开发者ID:nagyist,项目名称:Tattle,代码行数:31,代码来源:add_edit_predictive_check.php
注:本文中的fHTML类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论