Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重複の可能性: codeigniter : ビューに含まれるビューにデータを渡す
ビューからその中の別のビューに変数を渡すにはどうすればよいですか?(codeigniter)
ありがとう
つまり、あるビューで変数を設定し、そのビュー内で別のビューを呼び出し、そこで最も簡単な方法でそれを使用して、ビューを呼び出すコントローラーに設定します。
$data['var'] = 'value'; $this->load->view('view file',$data);
その後、すべてのサブビューでそれに到達できます。