本文整理汇总了PHP中Converter::str方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::str方法的具体用法?PHP Converter::str怎么用?PHP Converter::str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::str方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
/**
* ============================================================
* OVERWRITE HTTP URL QUERY
* ============================================================
*
* -- CODE: ---------------------------------------------------
*
* echo HTTP::query('offset', 4);
*
* ------------------------------------------------------------
*
*/
public static function query($query = null, $value = 1)
{
if (is_null($query)) {
return Config::get('url_query');
}
if (func_num_args() === 2) {
$query = array($query => $value);
}
$query = !empty($query) ? array_merge($_GET, $query) : $_GET;
$results = array();
foreach ($query as $k => $v) {
if ($v === false || is_array($v)) {
// TODO: accept array value
unset($_GET[$k]);
continue;
}
$value = $v !== true ? '=' . Text::parse(Converter::str($v), '->encoded_url') : "";
$results[] = $k . $value;
}
return !empty($results) ? '?' . implode('&', $results) : "";
}
示例2: array
<label class="grid-group">
<span class="grid span-1 form-label"><?php
echo $speak->value;
?>
</span>
<span class="grid span-5">
<?php
echo Form::textarea('value', Converter::str(Request::get('value', Guardian::wayback('value', $page->value))), null, array('class' => 'textarea-block'));
?>
</span>
</label>
示例3: captcha
/**
* ============================================================
* CAPTCHA IMAGE
* ============================================================
*
* -- CODE: ---------------------------------------------------
*
* echo Guardian::captcha();
*
* ------------------------------------------------------------
*
*/
public static function captcha($bg = '333333', $color = 'FFFFAA', $width = 100, $height = 30, $padding = 0, $size = 16, $length = 7, $font = 'special-elite-regular.ttf')
{
$c = array('bg' => $bg !== '333333' ? Converter::str($bg) : false, 'color' => $color !== 'FFFFAA' ? (string) $color : false, 'width' => $width !== 100 ? (int) $width : false, 'height' => $height !== 30 ? (int) $height : false, 'padding' => $padding !== 0 ? (int) $padding : false, 'size' => $size !== 16 ? (int) $size : false, 'length' => $length !== 7 ? (int) $length : false, 'font' => $font !== 'special-elite-regular.ttf' ? (string) $font : false);
$param = array();
foreach ($c as $k => $v) {
if ($v !== false) {
$param[] = $k . '=' . urlencode($v);
}
}
$param = !empty($param) ? '?' . implode('&', $param) : "";
return '<img class="captcha" width="' . ($width + $padding * 2) . '" height="' . ($height + $padding * 2) . '" src="' . Config::get('url') . '/captcha.png' . $param . '" alt="captcha"' . ES;
}
示例4: array
$html .= '</span>';
$html .= '</label>';
} else {
if ($type === 'e') {
$html .= '<label class="grid-group grid-group-editor">';
$html .= '<span class="grid span-2 form-label">' . $title . '</span>';
$html .= '<span class="grid span-4">';
$html .= Form::textarea('fields[' . $key . '][value]', Converter::str(isset($field[$key]) ? $field[$key] : $value['value']), Converter::toText(isset($value['placeholder']) ? $value['placeholder'] : $value['value']), array('class' => array('textarea-block', 'code')));
$html .= '</span>';
$html .= '</label>';
} else {
// if($type === 's') {
$html .= '<label class="grid-group grid-group-summary">';
$html .= '<span class="grid span-2 form-label">' . $title . '</span>';
$html .= '<span class="grid span-4">';
$html .= Form::textarea('fields[' . $key . '][value]', Converter::str(isset($field[$key]) ? $field[$key] : $value['value']), Converter::toText(isset($value['placeholder']) ? $value['placeholder'] : $value['value']), array('class' => 'textarea-block'));
$html .= '</span>';
$html .= '</label>';
}
}
}
}
}
}
}
}
echo !empty($html) ? $html : Cell::p(Config::speak('notify_empty', strtolower($speak->fields)));
} else {
echo Cell::p(Config::speak('notify_empty', strtolower($speak->fields)));
}
Weapon::fire('unit_composer_3_after', array($segment, $fields));
示例5: array
?>
</span>
<span class="grid span-5">
<?php
echo Form::text('placeholder', Converter::toText(Guardian::wayback('placeholder', $file->placeholder)), null, array('class' => 'input-block'));
?>
</span>
</label>
<label class="grid-group">
<span class="grid span-1 form-label"><?php
echo $speak->value;
?>
</span>
<span class="grid span-5">
<?php
echo Form::textarea('value', Converter::str(Guardian::wayback('value', $file->value)), null, array('class' => array('textarea-block', 'MTE')));
?>
</span>
</label>
<label class="grid-group">
<span class="grid span-1 form-label"><?php
echo $speak->description;
?>
</span>
<span class="grid span-5">
<?php
echo Form::text('description', Converter::toText(Guardian::wayback('description', $file->description)), Config::speak('manager.placeholder_description_', strtolower($speak->field)), array('class' => 'input-block'));
?>
</span>
</label>
<div class="grid-group">