ある関数の変数を他の関数に渡したいのですが、どうすればいいのですか。他の関数codeigniterにパラメータを渡す
public function blog() {
$user_session_email = $this -> session -> userdata('user_email','name','id');
if(!$user_session_email) {
redirect('/');
}
$user_data = $this -> users_model -> MyAccount([
'id' => $this -> session -> userdata('id'),
'name' => $this -> session -> userdata('name'),
'email' => $this -> session -> userdata('user_email'),
]);
$data["persoanl"] = $user_data;
$returned_result = $this -> users_model -> load_messages();
$messages["message"] = $returned_result['message'];
$post_id = $this -> input -> post('post_id');
$return_comments = $this -> users_model -> return_comments();
$messages['comments'] = $return_comments;
$this -> load -> view('users/inc/header', $data);
$this -> load -> view('users/inc/blog_form', $data);
$this -> load -> view('users/blog', $messages);
$this -> load -> view('users/inc/footer');
}
私は
public function load_messages() {
$returned_result = $this -> users_model -> load_messages();
$messages["message"] = $returned_result["message"];
$return_comments = $this -> users_model -> return_comments();
$messages['comments'] = $return_comments;
$this -> load -> view('users/blog', $messages);
}
これは次のとおりです。public function load_messages(){'inside model ?? –
それはモデルとコントローラの両方にあります –