本文整理汇总了PHP中Uri::Current方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::Current方法的具体用法?PHP Uri::Current怎么用?PHP Uri::Current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uri
的用法示例。
在下文中一共展示了Uri::Current方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: after_load
public function after_load(Model_Url $url)
{
if (Uri::Current() != Uri::Create('core/404')) {
if (strpos($url->url, Uri::Create('assets/screenshots')) !== false) {
if ($url->custom == false) {
$url->custom = $url->url;
$url->url = 'Image URL';
} else {
$url->custom = $url->url;
$url->url = 'Image : ' . $url->short_url;
}
}
}
}
示例2: after
public function after($response)
{
$response = parent::after($response);
if (Uri::Current() != Uri::Create('login')) {
if (Settings::get('maintenance_mode') === true) {
if (!Auth::member(5)) {
$this->template->content = View::Forge('core/maintenance');
} elseif (Uri::Current() != Uri::Create('admin/settings')) {
// YOUR GOOD
Response::Redirect(Uri::Create('admin/settings'));
}
}
}
return $response;
}
示例3:
<?php
echo View::Forge('core/menu');
?>
<style>
.meelab{
margin-bottom: 20px;
}
</style>
<div class="container">
<?php
if (Uri::Current() === Uri::Create('admin')) {
?>
<div class="row meela-pods">
<div class="col-lg-12" style="font-size: 40px;width: 100%;display: block;text-align: center;padding-left: 0px ;padding-right: 0px;">
<?php
if (empty($style) === false) {
?>
<div style="font-size:15px;" class="alert alert-danger">Please change the random length for your URLs!</div>
<?php
}
?>
<div class="pod-3 meela-bg">
<span class="title">Unique URLs Left</span>
<?php
$threshold = Settings::get('url_limit_threshold');
if (empty($threshold) === true) {
$threshold = 1000;
}
if ($urls_left < $threshold) {
示例4:
</footer>
<div class="hide" id="dialog" title="Confirmation Required" >
Are you sure you want to continue?
</div>
<!-- Placed at the end of the document so the pages load faster -->
<?php
Casset::js('jquery.zclip.min.js');
Casset::js('bootstrap.min.js');
Casset::js('sortable.js');
Casset::js('jquery-ui-1.10.3.custom.min.js');
Casset::js('bootstrap-switch.min.js');
Casset::js('base.js');
if (Uri::Current() === Uri::Base() && isset($image_js) === true) {
Casset::add_path('image', APPPATH . 'modules/image/');
Casset::js('image::image.js');
}
Casset::js('jquery.colorbox-min.js');
echo Casset::render_js();
?>
<script>
var text_input = document.getElementById ('urlbox');
if (text_input != null)
{
text_input.focus ();
text_input.select ();
}
示例5:
<div class="navbar navbar-meela shadow <?php
if (Uri::Base() == Uri::Current() || Uri::Base() . 'home' == Uri::Current()) {
echo "nav-remove top-minus-80";
} else {
echo "navbar-fixed-top";
}
?>
">
<div class="container">
<!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php
$site_name = \Settings::Get('site_name');
if (empty($site_name) === true) {
$site_name = 'Mee.La';
}
?>
<!-- Be sure to leave the brand out there if you want it shown -->
<a class="navbar-brand" href="<?php
echo Uri::Base();
?>
" title="<?php
echo $site_name;
?>
"><?php
echo $site_name;
示例6:
">Dashboard</a>
</li>
<li <?php
echo Uri::Current() == Uri::Create('user/urls') ? 'class="active"' : '';
?>
>
<a href="<?php
echo Uri::Create('user/urls');
?>
">My URLs</a>
</li>
<?php
if (Module::loaded('image') === true) {
?>
<li <?php
echo Uri::Current() == Uri::Create('user/images') ? 'class="active"' : '';
?>
>
<a href="<?php
echo Uri::Create('user/images');
?>
">My Images</a>
</li>
<?php
}
?>
<?php
if (Auth::member(5)) {
?>
<li>
示例7:
} else {
?>
<td>
<a data-text="This URL will be removed!" class="confirm" href="<?php
echo Uri::Create('url/delete/' . $url->id);
?>
">
<i class="icon-remove"></i></a> <a target="_blank" id="url_<?php
echo $url->id;
?>
" href="<?php
echo $url->url;
?>
">
<?php
if (Auth::member(5) && Uri::Create('admin/urls') == Uri::Current()) {
$url_parts = parse_url($url->url);
$host = $url_parts['host'];
?>
<a class="confirm" data-text="All URLs LIKE <?php
echo $host;
?>
will be blocked!" href="<?php
echo Uri::Create('admin/add_blocked/' . str_replace('.', '-', $host) . '');
?>
">
<i class="icon-ban-circle"></i>
</a>
<?php
}
?>
示例8: isset
<div class="col-lg-4 pull-right">
<form method="get">
<div class="<?php
echo isset($search) === true ? 'input-group' : '';
?>
">
<input placeholder="Search for Users" class="form-control" name="search" type="text" value="<?php
echo isset($search) === true ? $search : '';
?>
">
<?php
if (isset($search) === true) {
?>
<span class="input-group-addon">
<a href="<?php
echo Uri::Create(Uri::Current());
?>
"> <i class="icon-remove"></i></a>
</span>
<?php
}
?>
</div>
</form>
</div>
<?php
if (empty($users) === false) {
echo htmlspecialchars_decode($pagination);
?>
<form method="post">
示例9: action_view
public function action_view($all = null)
{
$limit = 25;
if (empty($all) === false) {
// check for admin
if (!Auth::member(5)) {
Response::Redirect(Uri::Create('user'));
}
}
// Total Urls
$data['total_urls'] = Model_Url::query();
if (empty($all) === true) {
$data['total_urls']->where('user_id', static::$user_id);
}
$data['total_urls'] = $data['total_urls']->count();
if (Uri::Current() == Uri::Create('admin')) {
$keys = \Settings::Get('character_set');
if (empty($keys) === true) {
$keys = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
}
$random_length = \Settings::Get('random_url_length');
if (empty($random_length) === true) {
$random_length = 5;
}
$url_sample_space = DB::select(DB::expr('count(id) as count'))->from('urls')->where(DB::expr('char_length(short_url)'), $random_length)->limit(1)->execute()->as_array();
$data['urls_left'] = Controller_Dashboard::mathFact(strlen($keys)) / (Controller_Dashboard::mathFact(strlen($keys) - $random_length) * Controller_Dashboard::mathFact($random_length)) - $url_sample_space[0]['count'];
}
// Total Hits
$data['total_hits'] = DB::select(DB::Expr('SUM(hits) as hits'))->from('urls');
if (empty($all) === true) {
$data['total_hits']->where('user_id', static::$user_id);
}
$data['total_hits'] = $data['total_hits']->execute()->as_array();
$data['total_hits'] = reset($data['total_hits']);
$data['total_hits'] = $data['total_hits']['hits'];
// No Clicks
$data['no_clicks'] = Model_Url::query()->where('hits', 0);
if (empty($all) === true) {
$data['no_clicks']->where('user_id', static::$user_id);
}
$data['no_clicks'] = $data['no_clicks']->count();
// Total Custom Urls
$data['total_custom_urls'] = Model_Url::query()->where('custom', 1);
if (empty($all) === true) {
$data['total_custom_urls']->where('user_id', static::$user_id);
}
$data['total_custom_urls'] = $data['total_custom_urls']->count();
// Created Today Urls
$data['created_today'] = Model_Url::query()->where('created_at', '>=', strtotime('today 12:01 AM'));
if (empty($all) === true) {
$data['created_today']->where('user_id', static::$user_id);
}
$data['created_today'] = $data['created_today']->count();
// Most visted Urls
$data['most_visited'] = Model_Url::query();
if (empty($all) === true) {
$data['most_visited']->where('user_id', static::$user_id);
}
$data['most_visited']->order_by('hits', 'desc')->limit($limit);
$data['most_visited'] = $data['most_visited']->get();
// Created Today Urls
$data['recently_created'] = Model_Url::query();
if (empty($all) === true) {
$data['recently_created']->where('user_id', static::$user_id);
}
$data['recently_created']->order_by('created_at', 'desc')->limit($limit);
$data['recently_created'] = $data['recently_created']->get();
if (empty($all) === true) {
$data['recently_viewed'] = Model_Url::query()->order_by('updated_at', 'desc')->where('updated_at', '!=', 'created_at')->where('user_id', static::$user_id)->limit($limit)->get();
} else {
$data['recently_viewed'] = Model_Url::query()->order_by('updated_at', 'desc')->where('updated_at', '!=', null)->limit($limit)->get();
}
// Short URL Stats string for google graphs
$m = date("m");
$de = date("d");
$y = date("Y");
$new_results = '';
if (empty($all) === true) {
$date_vist_counts = DB::query('
SELECT
COUNT(url_stats.id) as hits,
DAY(FROM_UNIXTIME(url_stats.created_at)) as day,
MONTH(FROM_UNIXTIME(url_stats.created_at)) as month,
YEAR(FROM_UNIXTIME(url_stats.created_at)) as year
FROM `url_stats`
INNER JOIN `urls` ON urls.id = url_stats.url_id
WHERE url_stats.created_at >= ' . strtotime('12:01 AM TODAY - 15 days') . '
AND urls.user_id = ' . static::$user_id . '
GROUP BY year,month,day')->execute()->as_array();
$date_created_counts = DB::query('
SELECT
COUNT(id) as created,
DAY(FROM_UNIXTIME(created_at)) as day,
MONTH(FROM_UNIXTIME(created_at)) as month,
YEAR(FROM_UNIXTIME(created_at)) as year
FROM `urls`
WHERE created_at >= ' . strtotime('12:01 AM TODAY - 15 days') . '
AND user_id = ' . static::$user_id . '
GROUP BY year,month,day')->execute()->as_array();
} else {
//.........这里部分代码省略.........