本文整理汇总了PHP中Ethna_Util::escapeHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Ethna_Util::escapeHtml方法的具体用法?PHP Ethna_Util::escapeHtml怎么用?PHP Ethna_Util::escapeHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ethna_Util
的用法示例。
在下文中一共展示了Ethna_Util::escapeHtml方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preforward
function preforward()
{
$type = $this->af->get('type');
if ($type === null) {
$type = 'text';
}
$type_options = array('text' => '一行入力', 'textarea' => '複数行入力', 'select' => 'セレクトボックス', 'radio' => 'ラジオボタン', 'checkbox' => 'チェックボックス', 'file' => 'ファイル選択');
$data =& $this->backend->getManager('Data');
$index_options = range(0, count($data->get('attr')) + 1);
unset($index_options[0]);
$this->af->setApp('id', $this->af->get('id'));
$this->af->setApp('index', $this->af->get('index'));
$this->af->setApp('index_options', $index_options);
$this->af->setApp('type', $type);
$this->af->setApp('type_options', $type_options);
$this->af->setApp('form_name', $data->get('name'));
$forms = array();
$attr_list = $data->get('attr');
if (is_array($attr_list)) {
foreach ($attr_list as $attr) {
$attr = Ethna_Util::escapeHtml($attr);
$t = $attr['type_name'][0];
$attr['style'] = $attr['type_name'] == 'textarea' ? 'overflow-y: scroll;height: 2.8em;' : '';
$attr['width'] = 1;
$attr['height'] = 1;
$attr['values'] = ' ';
$form = FormBuilder::build($attr);
if ($t == 'c' || $t == 'r') {
$v = ' checked="checked"';
} else {
$v = '';
}
$form = preg_replace('/\\<\\?.+?\\?\\>/', $v, $form);
$attr['form'] = $form;
$forms[] = $attr;
}
$this->af->setAppNE('forms', $forms);
}
}
示例2: _getRenderer
/**
* レンダラオブジェクトを取得する
*
* @access protected
* @return object Ethna_Renderer レンダラオブジェクト
*/
function _getRenderer()
{
$c = $this->backend->getController();
$renderer = $c->getRenderer();
$form_array = $this->af->getArray();
$app_array = $this->af->getAppArray();
$app_ne_array = $this->af->getAppNEArray();
$renderer->setPropByRef('form', $form_array);
$renderer->setPropByRef('app', $app_array);
$renderer->setPropByRef('app_ne', $app_ne_array);
$message_list = Ethna_Util::escapeHtml($this->ae->getMessageList());
$renderer->setPropByRef('errors', $message_list);
if (isset($_SESSION)) {
$tmp_session = Ethna_Util::escapeHtml($_SESSION);
$renderer->setPropByRef('session', $tmp_session);
}
$renderer->setProp('script', htmlspecialchars(basename($_SERVER['SCRIPT_NAME']), ENT_QUOTES, mb_internal_encoding()));
$renderer->setProp('request_uri', isset($_SERVER['REQUEST_URI']) ? htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, mb_internal_encoding()) : '');
$renderer->setProp('config', $this->config->get());
return $renderer;
}
示例3: makeParts_m
function makeParts_m($attr_list)
{
$cycle = 1;
$forms = array();
$confirms = array();
foreach ($attr_list as $i => $attr) {
$attr = Ethna_Util::escapeHtml($attr);
extract($attr);
$form = FormBuilder::build($attr);
$form = $this->lightweighting($form);
if ($i === 0) {
$group = '0';
}
if ($required === '1') {
$name .= '<em class="required">※</em>';
}
if ($suffix != '') {
$form .= ' ' . $suffix;
}
if ($example !== '') {
$example = nl2br($example);
$form .= <<<EOM
<br />
\t\t\t<em class="example">{$example}</em>
EOM;
}
// =================================================================================
$error = <<<EOM
\t\t\t<?error(\$vars, '{$id}')?>
EOM;
if ($group === '0' && $i > 0) {
$forms[] = <<<EOM
\t\t</div>
\t\t<hr />
EOM;
}
if ($group === '0') {
$cycle ^= 1;
$forms[] = <<<EOM
\t\t<div>
\t\t\t■{$name}<br />
{$error}
EOM;
} else {
$this->insertError($forms, $error);
if ($group === '2') {
$forms[count($forms) - 1] .= '<br />';
}
}
$forms[] = <<<EOM
\t\t\t{$form}
EOM;
// =================================================================================
if ($group === '0' && $i > 0) {
$confirms[] = <<<EOM
\t</div>
\t<hr />
EOM;
}
if ($group === '0') {
$confirms[] = <<<EOM
\t<div>
\t\t■{$name}<br />
EOM;
} else {
if ($group === '2') {
$confirms[count($confirms) - 1] .= '<br />';
}
}
$confirms[] = <<<EOM
\t\t<?=\${$id}_c?> {$suffix}
EOM;
// =================================================================================
}
// endforeach
if ((bool) $forms) {
$forms[] = <<<EOM
\t\t</div>
EOM;
$confirms[] = <<<EOM
\t</div>
EOM;
}
return array($confirms, $forms);
}
示例4: basename
/**
* Smartyオブジェクトを取得する
*
* @access protected
* @return object Smarty Smartyオブジェクト
*/
function &_getTemplateEngine()
{
$c =& $this->backend->getController();
$smarty =& $c->getTemplateEngine();
$form_array =& $this->af->getArray();
$app_array =& $this->af->getAppArray();
$app_ne_array =& $this->af->getAppNEArray();
$smarty->assign_by_ref('form', $form_array);
$smarty->assign_by_ref('app', $app_array);
$smarty->assign_by_ref('app_ne', $app_ne_array);
$message_list = Ethna_Util::escapeHtml($this->ae->getMessageList());
$smarty->assign_by_ref('errors', $message_list);
if (isset($_SESSION)) {
$tmp_session = Ethna_Util::escapeHtml($_SESSION);
$smarty->assign_by_ref('session', $tmp_session);
}
$smarty->assign('script', basename($_SERVER['PHP_SELF']));
$smarty->assign('request_uri', htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES));
return $smarty;
}