0
我正在經歷的笨文檔和代碼這一點讓我困惑,爲什麼方法參數初始化爲「家」,你可以看到如下:
public function view($page = 'home') // why page='home' ?
{
if (! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page); // Capitalize the first letter
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);
}
有人能告訴我,爲什麼該方法的參數是如上所述初始化?