本文整理汇总了PHP中URI::Segment方法的典型用法代码示例。如果您正苦于以下问题:PHP URI::Segment方法的具体用法?PHP URI::Segment怎么用?PHP URI::Segment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::Segment方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_pricing_view
public function post_pricing_view()
{
$price = QuotationPriceAdjustments::find(URI::Segment(4));
$update_layout = array('friendly_name' => trim(Input::get('friendly_name')), 'note' => trim(Input::get('note')));
$price->update($price->id, $update_layout);
return Redirect::to('/user/quotations/pricing_view/' . $price->id)->with('success', 'Update successfull');
}
示例2: __construct
public function __construct()
{
$this->filter('before', array('admin'));
$this->filter('before', array('valid_page'))->except(array('index', 'create'));
if (is_numeric(URI::Segment(4))) {
$this->page_id = URI::Segment(4);
}
}
示例3: __construct
public function __construct()
{
$this->filter('before', array('admin'));
if (is_numeric(URI::Segment(4))) {
$this->studio_id = URI::Segment(4);
$this->layout_id = URI::segment(4);
}
}
示例4: __construct
public function __construct()
{
if (is_numeric(URI::Segment(3))) {
$this->layout_id = URI::Segment(3);
}
}
示例5:
"><a href="/faqs">FAQ's</a></li>
<li class="<?php
if (URI::Segment(1) == 'contact') {
?>
active<?php
}
?>
"><a href="/contact">Contact Us</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</nav><?php
}
?>
<?php
if (URI::Segment(1) == 'user') {
?>
<div class="main-margin"></div><?php
}
?>
<main role="main" id="main">
@yield('content')
</main>
</div>
</div>
<footer class="footer">
<div class="container">
<div class="strapline">
<p class="strapline-top">The UK's no.1 supplier of</p>
<p class="strapline-bottom">Zero maintenance &</p>
示例6: post_removeimage
public function post_removeimage()
{
$image_id = URI::Segment(4);
$image = Image::find($image_id);
$gallery = Image::find($image_id)->gallery()->first();
// delete post
$image->delete();
return Redirect::to('user/galleries/view/' . $gallery->id)->with('success', 'The image has been removed from the gallery.');
}
示例7:
?>
active<?php
}
?>
" href="#" data-toggle="dropdown">Quotating <b class="caret"></b></a>
<ul class="dropdown-menu">
<!-- to do - make dynamic -->
<li><a class="<?php
if (URI::Segment(3) == 'pricing') {
?>
active<?php
}
?>
" href="/user/quotations/pricing/">Pricing</a></li>
<li><a class="<?php
if (URI::Segment(3) == 'quotes') {
?>
active<?php
}
?>
" href="/user/quotations/view/">View Quotations</a></li>
</ul>
</li>
</ul>
</div>
</nav>
</div>
<div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
@if (Session::get('error'))
示例8: function
Route::filter('before', function () {
// Do stuff before every request to your application...
});
Route::filter('after', function ($response) {
// Do stuff after every request to your application...
});
Route::filter('csrf', function () {
if (Request::forged()) {
return Response::error('500');
}
});
Route::filter('auth', function () {
if (Auth::guest()) {
Session::flash('error', 'You do not have access level to be there.');
return Redirect::to('user');
}
});
Route::filter('admin', function () {
if (Auth::user()->administrator == 0) {
Session::flash('error', 'You do not have access level to be there.');
return Redirect::to('user');
}
});
Route::filter('valid_client', function () {
$client_id = URI::Segment(4);
$user = User::Find($client_id);
if (!is_numeric($user->id)) {
Session::flash('error', 'Unknown user.');
return Redirect::to('user/clients/');
}
});