2016-10-06 8 views

答えて

1

$this->uri->segment(n);は、状況によっては本当に便利なURLの一部を取得するために使用されます。そのうちの一つは次のようになります。

あなたはこのようなurlを持っている場合:

http://example.com/users/profile/1 

はあなたが行うことができます:

$this->uri->segment(3); //the third segment starting from /users so counting begin after the domain name 

を通過したプロファイルIDを取得し、あなたのコントローラでこれを使用するために、またはモデル