本文整理汇总了PHP中Utils::escape方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::escape方法的具体用法?PHP Utils::escape怎么用?PHP Utils::escape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils
的用法示例。
在下文中一共展示了Utils::escape方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: breadcrumbs_admin
/**
* Generate breadcrumbs from an array of name and URLs
*/
public static function breadcrumbs_admin(array $links)
{
foreach ($links as $name => $url) {
if ($name != '' && $url != '') {
$tmp[] = '<span><a href="' . $url . '">' . Utils::escape($name) . '</a></span>';
} else {
$tmp[] = '<span>' . __('Deleted') . '</span>';
return implode(' » ', $tmp);
}
}
return implode(' » ', $tmp);
}
示例2: code
public function code($code, $lang = null, $escaped = false)
{
if (isset($this->options['highlight'])) {
$out = $this->options['highlight']($code, $lang);
if ($out != null && $out !== $code) {
$escaped = true;
$code = out;
}
}
if (!$lang) {
return '<pre><code>' . ($escaped ? $code : Utils::escape($code, true)) . "\n</code></pre>";
}
return '<pre><code class="' . $this->options['langPrefix'] . Utils::escape($lang, true) . '">' . ($escaped ? $code : Utils::escape($code, true)) . "\n</code></pre>\n";
}
示例3: error
protected function error($msg, $http_status = null, $no_back_link)
{
// Did we receive a custom header?
if (!is_null($http_status)) {
header('HTTP/1.1 ' . $http_status);
}
$http_status = (int) $http_status;
if ($http_status > 0) {
$this->feather->response->setStatus($http_status);
}
// Overwrite existing body
$this->feather->response->setBody('');
if (!defined('FEATHER_HEADER')) {
$this->feather->template->setPageInfo(array('title' => array(Utils::escape($this->feather->config['o_board_title']), __('Info'))));
}
$this->feather->template->setPageInfo(array('msg' => $msg, 'no_back_link' => $no_back_link))->addTemplate('message.php')->display();
// Don't display anything after a message
$this->feather->stop();
}
示例4: define
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**/
define('__ARMORY__', true);
define('load_characters_class', true);
define('load_mangos_class', true);
define('load_items_class', true);
define('load_search_class', true);
if (!@(include 'includes/armory_loader.php')) {
die('<b>Fatal error:</b> unable to load system files.');
}
header('Content-type: text/xml');
$advancedItemsSearch = false;
$findGearUpgrade = false;
if (isset($_GET['searchQuery'])) {
$search->searchQuery = Utils::escape($_GET['searchQuery']);
}
if (isset($_GET['source'])) {
$advancedItemsSearch = true;
$search->get_array = $_GET;
}
if (isset($_GET['pi']) && is_numeric($_GET['pi']) && $_GET['pi'] > 0) {
$findGearUpgrade = true;
$itemID = (int) $_GET['pi'];
}
if (isset($_GET['rrt']) && $_GET['rrt'] == 'hm') {
$search->heirloom = true;
}
if (!isset($_GET['searchQuery']) && !isset($_GET['source']) && !isset($_GET['pi']) && !isset($_GET['rrt'])) {
$xml->LoadXSLT('error/error.xsl');
$xml->XMLWriter()->startElement('page');
示例5: foreach
foreach ($allOrders as $eachOrder) {
?>
<?php
if ($_SESSION['user_id'] == $eachOrder->getUserId()) {
?>
<tr>
<td> <?php
echo $eachOrder->getId();
?>
</td>
<td> <?php
echo $eachOrder->getBusinessId();
?>
</td>
<td> <?php
Utils::escape(Utils::formatDateTime($eachOrder->getDate()));
?>
</td>
<td> <?php
echo $eachOrder->getStatus();
?>
</td>
<td> <?php
echo $eachOrder->getAssignedTo();
?>
</td>
<td> <?php
echo $eachOrder->getOrderDetails();
?>
</td>
</tr>
示例6:
echo Utils::escape($eachOrder->getBusinessId());
?>
</td>
<td> <?php
Utils::escape(Utils::formatDateTime($eachOrder->getDate()));
?>
</td>
<td> <?php
echo Utils::escape($eachOrder->getStatus());
?>
</td>
<td> <?php
echo Utils::escape($eachOrder->getAssignedTo());
?>
</td>
<td> <?php
echo Utils::escape($eachOrder->getOrderDetails());
?>
</td>
</tr>
<?php
}
?>
<?php
}
?>
</tbody>
</table>
</div>
</div>
示例7:
}
?>
<form action="#" method="post">
<fieldset>
<div class="field">
<label>First name:</label>
<input type="text" name="flight_booking[first_name]" value="<?php
echo Utils::escape($flightBooking->getFirstName());
?>
"/>
</div>
<div class="field">
<label>Date:</label>
<input type="date" name="flight_booking[date]" value="<?php
echo Utils::escape($flightBooking->getDate()->format('Y-m-d'));
?>
"/>
</div>
<div class="field">
<label>No of passengers:</label>
<select name="flight_booking[no_of_passengers]">
<?php
for ($i = 1; $i < 6; ++$i) {
?>
<option value="<?php
echo $i;
?>
"
<?php
if ($i == $flightBooking->getNoOfPassengers()) {
示例8:
?>
" required>
<span id="firstnameError" class="error">Please enter your first name</span>
</div>
<div>
<label for="lastname">Last Name</label>
<input onblur="validateForm('lastname')" id="lastname" type="text" name="member[last_name]"
value="<?php
echo Utils::escape($member->getLast_name());
?>
" required>
<span id="lastnameError" class="error">Please enter your last name</span>
</div>
<div>
<label for="email">Email</label>
<input onblur="validateEmail()" id="email" type="text" name="member[email]"
value="<?php
echo Utils::escape($member->getEmail());
?>
" required>
<span id="emailError" class="error">Please enter your email</span>
<span id="emailNotValid" class="error">Not a valid Email</span>
</div>
<div id="sign_up">
<input type="submit" name="sign_up" value="Sign Up" class="submit" />
</div>
</form>
<script src="../scripts/formvalidation.js"></script>
</body>
示例9: addAsset
public function addAsset($type, $asset, $params = array())
{
$type = (string) $type;
if (!in_array($type, array('js', 'css', 'feed', 'canonical', 'prev', 'next'))) {
throw new \Exception('Invalid asset type : ' . $type);
}
if (in_array($type, array('js', 'css')) && !is_file($this->app->forum_env['FEATHER_ROOT'] . $asset)) {
throw new \Exception('The asset file ' . $asset . ' does not exist');
}
$params = array_merge(static::getDefaultParams($type), $params);
if (isset($params['title'])) {
$params['title'] = Utils::escape($params['title']);
}
$this->assets[$type][] = array('file' => (string) $asset, 'params' => $params);
}
示例10:
?>
"><img class="item_img" src="<?php
echo Utils::escape($item->getImg_url());
?>
" alt="item"></a>
<div class="tags">
<a class="item_button" href="index.php?page=detail&item_id=<?php
echo Utils::escape($item->getItem_id());
?>
"><?php
echo Utils::escape($item->getItem_name());
?>
</a>
<div class="price">
<p class="price"><?php
echo '$' . Utils::escape($item->getItem_price());
?>
</p>
</div>
</div>
</div>
<?php
}
?>
<?php
}
?>
示例11:
<form action="#" method="post">
<fieldset>
<div class="field">
<label>First name:</label>
<input type="text" name="flight_booking[first_name]" value="<?php
echo Utils::escape($flightBooking->getFirstName());
?>
"/>
<label>Last name:</label>
<input type="text" name="flight_booking[last_name]" value="<?php
echo Utils::escape($flightBooking->getLastName());
?>
"/>
<label>Flight date:</label>
<input type="date" name="flight_booking[flight_date]" value="<?php
echo Utils::escape($flightBooking->getFlightDate());
?>
"/>
</div>
<div class="field">
<label>No of passengers:</label>
<select name="flight_booking[no_of_passengers]">
<?php
for ($i = 1; $i < 6; ++$i) {
?>
<option value="<?php
echo $i;
?>
"
<?php
if ($i == $flightBooking->getNoOfPassengers()) {
示例12:
/* define variable */
$list = $page->list;
?>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h3 class="text-left">
Delete list <b><?php
echo Utils::escape($list['name']);
?>
</b> ?
</h3>
<form method="post" action="">
<input type="submit" class="btn btn-t-contrast" value="Yes">
<a href="<?php
echo $routes['list_view'] . '?id=' . Utils::escape($list['id']);
?>
" class="btn btn-t-plain">Cancel</a>
</form>
<hr>
</div>
</div>
</div>
<?php
require 'includes/scripts.php';
?>
</body>
</html>
示例13: while
while ($item = $page->items->fetchArray(SQLITE3_ASSOC)) {
?>
<li data-id="<?php
echo $item['id'];
?>
" <?php
echo $item['completed'] == 1 ? 'class="completed"' : '';
?>
>
<input type="checkbox" <?php
echo $item['completed'] == 1 ? 'checked' : '';
?>
>
<input type="text" value="<?php
echo Utils::escape($item['content']);
?>
">
<a href="#">Remove</a>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
<?php
require 'includes/scripts.php';
示例14: __construct
public function __construct($message, $code = 400, $backlink = true)
{
parent::__construct(Utils::escape($message), $code);
$this->backlink = (bool) $backlink;
}
示例15:
<div class="field">
<label>id:</label>
<input type="text" name="user[id]" value="<?php
echo Utils::escape($foundUser->getId());
?>
"/>
<label>name:</label>
<input type="text" name="user[first_name]" value="<?php
echo Utils::escape($foundUser->getFirstName());
?>
"/>
<label>Password:</label>
<input type="text" name="user[user_password]" value="<?php
echo Utils::escape($foundUser->getUserPassword());
?>
"/>
</div>
<div class="wrapper">
<input type="submit" name="update" value="UPDATE RECORD" class="submit" />
</div>
</fieldset>
</form>
<?php
}
?>