Welcome Guest, Not a member yet? Register   Sign In
pass variable into view from controller?
#1

[eluser]Brad K Morse[/eluser]
Possible to accomplish what I am trying to do here:

part of controller function
Code:
$alert = "did not work";
$this->load->view('email-sent-view', $data, $alert);

then outputting it in the email-sent-view

Code:
<p>&lt;?=$alert;?&gt;</p>

I know this can't be done the way I have it currently, but any guidance as to how to accomplish will be appreciated.
#2

[eluser]ignited4now[/eluser]
[quote author="bkmorse" date="1290505521"]Possible to accomplish what I am trying to do here:

part of controller function
Code:
$alert = "did not work";
$this->load->view('email-sent-view', $data, $alert);

then outputting it in the email-sent-view

Code:
<p>&lt;?=$alert;?&gt;</p>

I know this can't be done the way I have it currently, but any guidance as to how to accomplish will be appreciated.[/quote]

Code:
$data['alert'] = "did not work";
$this->load->view('email-sent-view', $data);

In view:
Code:
<p>&lt;?=$alert;?&gt;</p>
#3

[eluser]Brad K Morse[/eluser]
Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB