當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utils::escape方法代碼示例

本文整理匯總了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);
 }
開發者ID:bohwaz,項目名稱:featherbb,代碼行數:15,代碼來源:AdminUtils.php

示例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";
 }
開發者ID:breeswish,項目名稱:php-marked,代碼行數:14,代碼來源:Renderer.php

示例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();
 }
開發者ID:bohwaz,項目名稱:featherbb,代碼行數:19,代碼來源:Error.php

示例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');
開發者ID:sarrian,項目名稱:wowarmory,代碼行數:31,代碼來源:search.php

示例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>
開發者ID:beshad,項目名稱:DROP_OFF_PROJECT_FRI1039,代碼行數:31,代碼來源:orderlist-view.php

示例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>
開發者ID:beshad,項目名稱:DROP_OFF_PROJECT_MON14DEC,代碼行數:30,代碼來源:orderlist-view.php

示例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()) {
開發者ID:richjava,項目名稱:fttl-mvc,代碼行數:31,代碼來源:add-edit-view.php

示例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>

開發者ID:Wooddu,項目名稱:MMNZ,代碼行數:29,代碼來源:signup-view.php

示例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);
 }
開發者ID:beaver-dev,項目名稱:featherbb-marketplace,代碼行數:15,代碼來源:View.php

示例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 
}
?>
開發者ID:Wooddu,項目名稱:MMNZ,代碼行數:30,代碼來源:home-view.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()) {
開發者ID:beshad,項目名稱:mvc_moreFieldsAdded,代碼行數:31,代碼來源:add-edit-view.php

示例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>
開發者ID:tgdn,項目名稱:cs139,代碼行數:30,代碼來源:list_delete.php

示例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' : '';
    ?>
>
                    &nbsp;
                    <input type="text" value="<?php 
    echo Utils::escape($item['content']);
    ?>
">
                    &nbsp;
                    <a href="#">Remove</a>
                </li>
                <?php 
}
?>
            </ul>
        </div>
    </div>
</div>

<?php 
require 'includes/scripts.php';
開發者ID:tgdn,項目名稱:cs139,代碼行數:31,代碼來源:list_view.php

示例14: __construct

 public function __construct($message, $code = 400, $backlink = true)
 {
     parent::__construct(Utils::escape($message), $code);
     $this->backlink = (bool) $backlink;
 }
開發者ID:featherbb,項目名稱:featherbb,代碼行數:5,代碼來源:Error.php

示例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 
}
?>


開發者ID:beshad,項目名稱:dropoff_practice_28NOV_2227,代碼行數:28,代碼來源:find-update-view.php


注:本文中的Utils::escape方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。