本文整理汇总了PHP中html_attr函数的典型用法代码示例。如果您正苦于以下问题:PHP html_attr函数的具体用法?PHP html_attr怎么用?PHP html_attr使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_attr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html_attr
" size="80" name="sbr_name" class="b-combo__input-text" id="sbr_name">
</div>
</div>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" class="b-layout__table b-layout__table_width_full b-layout__table_margbot_20">
<tr class="b-layout__tr">
<td class="b-layout__left b-layout__left_width_150">
<div class="b-layout__txt b-layout__txt_padtop_5">Название этапа</div>
</td>
<td class="b-layout__right">
<div class="b-combo">
<div class="b-combo__input">
<input type="text" value="<?php
echo html_attr($op['stage_name']);
?>
" maxlength="<?php
echo sbr::NAME_LENGTH;
?>
" size="80" name="stage_name" class="b-combo__input-text" id="stage_name">
</div>
</div>
</td>
</tr>
</table>
<?php
}
//if
?>
<div class="b-textarea b-textarea_padtop_10">
示例2: html_attr
?>
][add_wt_switch]" onchange="SBR.getStageByItem(this).setWTime(null,1)">
<option value="+"<?php
echo $stage->data['add_wt_switch'] == '+' ? ' selected="selected"' : '';
?>
>Добавить</option>
<option value="-"<?php
echo $stage->data['add_wt_switch'] == '-' ? ' selected="selected"' : '';
?>
>Отнять</option>
</select>
<input name="stages[<?php
echo $num;
?>
][add_work_time]" type="text" size="4" value="<?php
echo html_attr($stage->data['add_work_time']);
?>
" maxlength="3" onfocus="SBR.adErrCls(this)" onchange="SBR.getStageByItem(this).setWTime(this.value)" onkeyup="SBR.getStageByItem(this).setWTime(this.value, null, true)" onkeydown="return SBR.cancelEnter(event)"/> (дней)
</span>
<?php
}
?>
</div>
</div>
</div>
<b class="b2"></b>
<b class="b1"></b>
<input type="hidden" name="stages[<?php
echo $num;
?>
][id]" value="<?php
示例3: array_keys
$selop->ListData = array_keys($GLOBALS['filter_operators']);
$selop->SelectName = "FilterOperator[{$i}]";
$selop->SelectedData = $FilterOperator[$i];
$selop->Render();
echo $selop->HTML;
?>
</div>
<div class="col-md-2 vspacer-md">
<?php
/* Comparison expression */
?>
<input name="FilterValue[<?php
echo $i;
?>
]" value="<?php
echo html_attr($FilterValue[$i]);
?>
" class="form-control">
</div>
<div class="col-md-2 vspacer-md">
<button type="button" class="btn btn-default clear_filter" id="filter_<?php
echo $i;
?>
"><i class="glyphicon glyphicon-trash text-danger"></i></button>
</div>
</div>
<?php
}
?>
<script>
示例4: foreach
exit;
}
?>
<form method="post" action="" id="frm">
<?php
foreach ($_POST as $k => $v) {
if ($k == 'u_token_key') {
continue;
}
?>
<input type="hidden" name="<?php
echo $k;
?>
" value="<?php
echo html_attr($v);
?>
"/>
<?php
}
?>
<input type="hidden" name="step" id="step_fld" value="1"/>
<input type="hidden" name="u_token_key" value="<?php
echo $_SESSION['rand'];
?>
"/>
</form>
<?php
if (!$lc || !$lc->id) {
?>
<script>
示例5: set_attributes
public function set_attributes($tag = 'body', $attributes)
{
// $attributes: string or array
$tag = strtolower($tag);
if (!in_array($tag, array('body', 'html'))) {
return;
}
$this->_ci->load->_ci_cached_vars['template_' . $tag . '_tag_attributes'] = html_attr($attributes);
}
示例6: Render
//.........这里部分代码省略.........
if ($FilterField[$i] != '' && $FilterOperator[$i] != '' && ($FilterValue[$i] != '' || strstr($FilterOperator[$i], 'Empty'))) {
$filtersGET .= "&FilterAnd[{$i}]={$FilterAnd[$i]}&FilterField[{$i}]={$FilterField[$i]}&FilterOperator[{$i}]={$FilterOperator[$i]}&FilterValue[{$i}]=" . urlencode($FilterValue[$i]);
}
}
$filtersGET .= "&SortField={$SortField}&SortDirection={$SortDirection}&FirstRecord={$FirstRecord}&Embedded={$Embedded}";
$filtersGET .= "&DisplayRecords={$DisplayRecords}";
$filtersGET .= '&SearchString=' . urlencode($SearchString);
$filtersGET = substr($filtersGET, 1);
// remove initial &
$redirectUrl = $this->ScriptFileName . '?SelectedID=' . urlencode($SelectedID) . '&' . $filtersGET . '&' . $update_status;
@header("Location: {$redirectUrl}");
$this->HTML .= '<META HTTP-EQUIV="Refresh" CONTENT="0;url=' . $redirectUrl . '">';
return;
} elseif ($addNew_x != '') {
$SelectedID = '';
$this->hideTV();
} elseif ($Print_x != '') {
// print code here ....
$this->AllowNavigation = 0;
$this->AllowSelection = 0;
} elseif ($SaveFilter_x != '' && $this->AllowSavingFilters) {
$SourceCode .= '<form method="post" action="' . $_SERVER['HTTP_REFERER'] . '">' . "\n";
for ($i = 1; $i <= 20 * $FiltersPerGroup; $i++) {
// Number of filters allowed
if ($i % $FiltersPerGroup == 1 && $i != 1 && $FilterAnd[$i] != '') {
$SourceCode .= "\t<input name=\"FilterAnd[{$i}]\" value=\"{$FilterAnd[$i]}\" type=\"hidden\">\n";
}
if ($FilterField[$i] != '' && $FilterOperator[$i] != '' && ($FilterValue[$i] != '' || strstr($FilterOperator[$i], 'Empty'))) {
if (!strstr($SourceCode, "\t<input name=\"FilterAnd[{$i}]\" value=\"")) {
$SourceCode .= "\t<input name=\"FilterAnd[{$i}]\" value=\"{$FilterAnd[$i]}\" type=\"hidden\">\n";
}
$SourceCode .= "\t<input name=\"FilterField[{$i}]\" value=\"{$FilterField[$i]}\" type=\"hidden\">\n";
$SourceCode .= "\t<input name=\"FilterOperator[{$i}]\" value=\"{$FilterOperator[$i]}\" type=\"hidden\">\n";
$SourceCode .= "\t<input name=\"FilterValue[{$i}]\" value=\"" . html_attr($FilterValue[$i]) . "\" type=\"hidden\">\n\n";
}
}
$SourceCode .= "\n\t<input type=\"submit\" value=\"Show Filtered Data\">\n";
$SourceCode .= "</form>";
$this->HTML .= '<div class="row"><div class="col-md-6 col-md-offset-3">';
$this->HTML .= '<div class="panel panel-info">';
$this->HTML .= '<div class="panel-heading"><h3 class="panel-title">' . $Translation["saved filters title"] . "</h3></div>";
$this->HTML .= '<div class="panel-body">';
$this->HTML .= $Translation["saved filters instructions"];
$this->HTML .= '<textarea class="form-control vspacer-lg" rows="12" wrap="off">' . $SourceCode . '</textarea>';
$this->HTML .= '<button type="submit" class="btn btn-default btn-block"><i class="glyphicon glyphicon-remove"></i> ' . $Translation['hide code'] . '</button>';
$this->HTML .= '</div>';
$this->HTML .= '</div>';
$this->HTML .= '</div></div>';
} elseif ($Filter_x != '') {
$orderBy = array();
if ($SortField) {
$sortFields = explode(',', $SortField);
$i = 0;
foreach ($sortFields as $sf) {
$tob = preg_split('/\\s+/', $sf, 2);
$orderBy[] = array(trim($tob[0]) => strtolower(trim($tob[1])) == 'desc' ? 'desc' : 'asc');
$i++;
}
$orderBy[$i - 1][$tob[0]] = strtolower(trim($SortDirection)) == 'desc' ? 'desc' : 'asc';
}
$currDir = dirname(__FILE__) . '/hooks';
// path to hooks folder
$mi = getMemberInfo();
$uff = "{$currDir}/{$this->TableName}.filters.{$mi['username']}.php";
// user-specific filter file
$gff = "{$currDir}/{$this->TableName}.filters.{$mi['group']}.php";
示例7: html_attr
</div>
<div class="cl-form-video" id="msgs_yt_box<?php
echo $msg['id'];
?>
" style="height:auto">
<?php
if ($error['yt_link']) {
?>
<div style="color:red"><?php
echo $error['yt_link'];
?>
</div><?php
}
?>
<input type="text" name="yt_link" value="<?php
echo html_attr($msg['yt_link']);
?>
" />
<label>Например: http://www.youtube.com/watch?v=bNF_P281Uu4</label>
</div>
<div class="cl-form-btns">
<?php
if (!$is_main) {
?>
<a href="javascript:;" class="lnk-dot-grey cl-form-cancel" onclick="SBR_STAGE.delMsgForm(<?php
echo $msg['id'] ? $msg['id'] : $msg['parent_id'];
?>
)">Отменить</a>
<?php
}
?>
示例8: js
/**
* JS
*
* Helps generate JavaScript asset HTML.
*
* @access public
* @param string the name of the file or asset
* @param string optional, module name
* @return string HTML code for JavaScript asset
*/
public function js($asset_name, $module_name = NULL, $attributes = array(), $location_type = '')
{
$attributes = html_attr($attributes);
$location_type = 'js_' . (in_array($location_type, array('url', 'path')) ? $location_type : 'path');
return '
<script type="text/javascript" src="' . $this->{$location_type}($asset_name, $module_name) . '"' . $attributes . '></script>';
}
示例9: html_attr
echo $is_edit ? ' form-nr-docs-edit' : '';
?>
">
<b class="b1"></b>
<b class="b2"></b>
<div class="form-in">
<form action="." method="post" enctype="multipart/form-data" id="<?php
echo $is_edit ? 'docsEditFrm' : 'docsAddFrm';
?>
">
<div class="form-block first">
<div class="form-el">
<label class="form-label3">Название документа:</label>
<span class="nra-doc-title">
<input type="text" name="name" value="<?php
echo html_attr($doc['name']);
?>
" maxlength="40" />
</span>
<div class="tip" style="left:585px"></div>
<span class="form-hint">Максимум 40 символов</span>
</div>
<div class="form-el">
<label class="form-label3">Этап проекта:</label>
<span class="nra-doc-sel">
<select name="stage_id">
<option value="0">Весь проект</option>
<?php
foreach ($sbr->stages as $stg) {
?>
<option value="<?php
示例10: auto_link
/**
* Modifies the auto_link helper (url_helper) by accepting as an optional third
* argument an array of html attributes for the anchor tags (just like the anchor helper).
*
* This array is supplied as the third argument, replacing the
* optional argument $pop in the original helper.
*
* This modified helper attempts to be backward compatible with the use of the
* original helper by accepting TRUE and FALSE as possible values for the $attributes
* argument, and giving output identical to the original usage of the helper.
*
* use: auto_link($string, 'url' , array('class' => 'external', 'target'=>'_blank'));
* use: auto_link($string, 'email', array('class' => 'email_link' , 'style' => 'color:red;'));
* use(legacy): auto_link($string, 'url' , TRUE);
*
* @link https://github.com/EllisLab/CodeIgniter/wiki/auto-link
* @author Derek Jones (original author)
* @author Ivan Tcholakov (adaptation)
*
* @see url_helper
* @link https://codeigniter.com/user_guide/helpers/url_helper.html
* @param string $str
* @param string $type
* @param mixed $attributes
* @return string
*/
function auto_link($str, $type = 'both', $attributes = '')
{
static $html_helper_loaded = null;
if ($html_helper_loaded !== true) {
get_instance()->load->helper('html');
$html_helper_loaded = true;
}
// MAKE THE THIRD ARGUMENT BACKWARD COMPATIBLE
// here we deal with the original third argument $pop
// which could be TRUE or FALSE, and was FALSE by default.
if ($attributes === TRUE) {
$attributes = ' target="_blank"';
} elseif ($attributes === FALSE) {
$attributes = '';
}
if (!empty($attributes)) {
$attributes = html_attr($attributes);
}
// Find and replace any URLs.
// Modified by Ivan Tcholakov, 19-DEC-2013.
//if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
if ($type !== 'email' && preg_match_all('#(\\w*://|www\\.)[^\\s()<>;]+(\\w|/)#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
// We process the links in reverse order (last -> first) so that
// the returned string offsets from preg_match_all() are not
// moved as we add more HTML.
foreach (array_reverse($matches) as $match) {
// $match[0] is the matched string/link
// $match[1] is either a protocol prefix or 'www.'
//
// With PREG_OFFSET_CAPTURE, both of the above is an array,
// where the actual value is held in [0] and its offset at the [1] index.
$a = '<a href="' . (strpos($match[1][0], '/') ? '' : 'http://') . $match[0][0] . '"' . $attributes . '>' . $match[0][0] . '</a>';
$str = substr_replace($str, $a, $match[0][1], strlen($match[0][0]));
}
}
// Find and replace any emails.
if ($type !== 'url' && preg_match_all('#([\\w\\.\\-\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+[^[:punct:]\\s])#i', $str, $matches, PREG_OFFSET_CAPTURE)) {
foreach (array_reverse($matches[0]) as $match) {
if (filter_var($match[0], FILTER_VALIDATE_EMAIL) !== FALSE) {
$str = substr_replace($str, safe_mailto($match[0], '', $attributes), $match[1], strlen($match[0]));
}
}
}
return $str;
}
示例11: html_attr
<option value="<?php
echo $exc;
?>
"<?php
echo $exc == $sbr_all['filter']['cost_sys'] ? ' selected="selected"' : '';
?>
><?php
echo $exn[2];
?>
</option>
<?php
}
?>
</select></td>
<td><div class="b-input"><input class="b-input__text" type="text" name="filter[work_time]" value="<?php
echo html_attr($sbr_all['filter']['work_time']);
?>
" onkeydown="if(event.keyCode==13)SBR.form.submit()" onfocus="this.select()" /></div></td>
<td><select name="filter[status]" onchange="SBR.form.submit()">
<option value="-1">Все</option>
<option value="<?php
echo sbr_adm::STATUS_RESERVED;
?>
"<?php
echo sbr_adm::STATUS_RESERVED == $sbr_all['filter']['status'] ? ' selected="selected"' : '';
?>
>зарезервировано</option>
<?php
foreach (sbr_stages::$ss_classes as $st => $ssc) {
?>
<option value="<?php
示例12: html_tag
/**
* HTML attributes
*
* @param string $name
* @param array $attrs
* @param string $value
* @param bool $empty
*
* @return string
*/
function html_tag(string $name, array $attrs = [], string $value = null, bool $empty = false) : string
{
return '<' . $name . html_attr($attrs) . ($empty ? ' />' : '>' . $value . '</' . $name . '>');
}
示例13: html_attr
?>
" onkeydown="if(event.keyCode==13)SBR.form.submit()" onfocus="this.select()">
</div>
</td>
<td>
<div class="b-input">
<input class="b-input__text" type="text" name="filter[arbitr_name]" value="<?php
echo html_attr($filter['arbitr_name']);
?>
" onkeydown="if(event.keyCode==13)SBR.form.submit()" onfocus="this.select()">
</div>
</td>
<td>
<div class="b-input">
<input class="b-input__text" type="text" name="filter[days_left]" value="<?php
echo html_attr($filter['days_left']);
?>
" onkeydown="if(event.keyCode==13)SBR.form.submit()" onfocus="this.select()">
</div>
</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="6">
<div class="pager">
<?php
echo new_paginator($page, ceil($page_count / sbr_adm::PAGE_SIZE), 10, "%s?site=admin&mode=arbitrage{$filter_prms}&dir_col={$dir_col}&dir={$dir}&page=%d%s");
?>
</div>
</td>
示例14: get_attributes_string
/**
* Creates HTML attribute string from array
*
* @param string|array $attributes Attribute array
*
* @return string Attribute string
*
* @deprecated Use html_attr().
*/
function get_attributes_string($attributes)
{
return html_attr($attributes);
}
示例15: html_tag_open
function html_tag_open($tag, $attributes = array())
{
return '<' . $tag . html_attr($attributes) . '>';
}