1

I'm trying to pass the data of a multidimensional array through to an email template with Codeigniter, it loads all of the associative array information fine, but when it comes to the multi-dimensional keys/values it does not identify them.

http://pastie.org/3132406

That is the code for the core functions happening from the controllers to the views.

4
  • Are you running these queries in your view? Commented Jan 5, 2012 at 18:01
  • The only thing run in the view is the $bodyOptions explode and the getProductName function Commented Jan 5, 2012 at 18:04
  • You should never be running queries in your view. That's the point of a framework like codeigniter. You should be running queries in your model (or controller) and then passing the results to your view. In either case, what piece are you exactly having trouble with? What are you getting and what are you expecting? Commented Jan 5, 2012 at 18:10
  • I've just altered the controller and view to do all of the querying on the controller side, but now when the email is sent, none of the exploded $getBuild options are coming through to the view. Also I'm trying to explode one of the passed variables when it's in the view just to echo out a dynamic list. Commented Jan 5, 2012 at 18:15

1 Answer 1

1

To get your $getBuild var into your view you need to make sure you are passing it to the view like this

function my_method() {
    $data['getBuild'] = 'something';
    $this->load->view('myView', $data);
}

Then in your view you can access it like this

<h1><?php echo $getBuild ?></h1>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.