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


PHP URI::Segment方法代碼示例

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

示例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);
     }
 }
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:8,代碼來源:pages.php

示例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);
     }
 }
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:8,代碼來源:pricing.php

示例4: __construct

 public function __construct()
 {
     if (is_numeric(URI::Segment(3))) {
         $this->layout_id = URI::Segment(3);
     }
 }
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:6,代碼來源:quotations.php

示例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>
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:31,代碼來源:main.blade.php

示例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.');
 }
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:9,代碼來源:galleries.php

示例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'))
開發者ID:shainmcalindon,項目名稱:boothsgardenstudios,代碼行數:31,代碼來源:user.blade.php

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


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