本文整理汇总了PHP中HTML_Common::charset方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Common::charset方法的具体用法?PHP HTML_Common::charset怎么用?PHP HTML_Common::charset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Common
的用法示例。
在下文中一共展示了HTML_Common::charset方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAttrString
/**
* Returns an HTML formatted attribute string
* @param array $attributes
* @return string
* @access private
*/
function _getAttrString($attributes)
{
$strAttr = '';
if (is_array($attributes)) {
$charset = HTML_Common::charset();
foreach ($attributes as $key => $value) {
$strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
}
}
return $strAttr;
}
示例2: getFrozenHtml
/**
* Returns the value of field without HTML tags (in this case, value is changed to a mask)
*
* @since 1.0
* @access public
* @return string
*/
public function getFrozenHtml()
{
// Modified by Ivan Tcholakov, 16-MAR-2010.
//$value = htmlspecialchars($this->getValue());
$value = @htmlspecialchars($this->getValue(), ENT_COMPAT, HTML_Common::charset());
//
if ($this->getAttribute('wrap') == 'off') {
$html = $this->_getTabs() . '<pre>' . $value . "</pre>\n";
} else {
$html = nl2br($value) . "\n";
}
return $html . $this->_getPersistantData();
}
示例3: renderHeader
/**
* Called when visiting a header element
*
* @param object An HTML_QuickForm_header element being visited
* @access public
* @return void
*/
function renderHeader(&$header)
{
$name = $header->getName();
$id = empty($name) ? '' : ' id="' . $name . '"';
if (!empty($name) && isset($this->_templates[$name])) {
$header_html = str_replace('{header}', $header->toHtml(), $this->_templates[$name]);
} else {
$header_html = str_replace('{header}', $header->toHtml(), $this->_headerTemplate);
}
$attributes = $header->getAttributes();
$strAttr = '';
if (is_array($attributes)) {
$charset = HTML_Common::charset();
foreach ($attributes as $key => $value) {
if ($key == 'name') {
continue;
}
$strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
}
}
if ($this->_fieldsetsOpen > 0) {
$this->_html .= $this->_closeFieldsetTemplate;
$this->_fieldsetsOpen--;
}
$openFieldsetTemplate = str_replace('{id}', $id, $this->_openFieldsetTemplate);
$openFieldsetTemplate = str_replace('{attributes}', $strAttr, $openFieldsetTemplate);
$this->_html .= $openFieldsetTemplate . $header_html;
$this->_fieldsetsOpen++;
}
示例4: getFrozenHtml
/**
* Returns the value of field without HTML tags
*
* @since 1.0
* @access public
* @return string
*/
function getFrozenHtml()
{
$value = $this->getValue();
// Modified by Ivan Tcholakov, 16-MAR-2010.
//return ('' != $value? htmlspecialchars($value): ' ') .
// $this->_getPersistantData();
$value = ('' != $value ? @htmlspecialchars($value, ENT_COMPAT, HTML_Common::charset()) : ' ') . $this->_getPersistantData();
return '<span class="freeze">' . $value . '</span>';
//
}
示例5: _getAttrString
/**
* Returns an HTML formatted attribute string
* Use Sigma for parsing
* @param array $attributes
* @return string
* @access private
*/
function _getAttrString($attributes)
{
$template = new \Cx\Core\Html\Sigma(ASCMS_CORE_PATH . '/Html/View/Template/Generic/');
$template->loadTemplateFile('Attribute.html');
$strAttr = '';
if (is_array($attributes)) {
$charset = HTML_Common::charset();
foreach ($attributes as $key => $value) {
$template->setVariable(array('ATTRIBUTE_NAME' => $key, 'ATTRIBUTE_VALUE' => htmlspecialchars($value, ENT_COMPAT, $charset)));
$template->parse('attribute');
}
}
return $template->get();
}
示例6: _getAttrString
/**
* Returns an HTML formatted attribute string
* @param array $attributes
* @return string
* @access private
*/
function _getAttrString($attributes)
{
$strAttr = '';
if (is_array($attributes)) {
$charset = HTML_Common::charset();
foreach ($attributes as $key => $value) {
// Modified by Ivan Tcholakov, 16-MAR-2010
//$strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
$strAttr .= ' ' . $key . '="' . @htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
//
}
}
return $strAttr;
}