URLが次のようなサイトのユーザープロファイルを作成しようとしています
mysite.com/user/ChrisSalij
現在、私のコントローラーは次のようになっています。
<?php
class User extends Controller {
function user(){
parent::Controller();
}
function index(){
$data['username'] = $this->uri->segment(2);
if($data['username'] == FALSE) {
/*load default profile page*/
} else {
/*access the database and get info for $data['username']*/
/*Load profile page with said info*/
}//End of Else
}//End of function
}//End of Class
?>
現時点では、に行くたびに404エラーが発生します。
mysite.com/user/ChrisSalij
これは、ChrisSalijというメソッドがあることを期待しているからだと思います。私も$this->uri->segment();
コマンドを誤用していると思いますが
どんな助けでもいただければ幸いです。ありがとう