Welcome Guest, Not a member yet? Register   Sign In
Not able to pass data to a view
#1

[eluser]Giuseppe Caruso[/eluser]
Hi all,
a first alert: it's a newbie question, sorry for that, I am just starting learning CI.

I am trying to pass some data from a controller to a view, but I get nothing.

In the controller "start.php" I have the "showfolders" function I wrote like this:
Code:
function showfolders() {
        $this->load->helper('directory');
        $map = directory_map('.');
        $this->load->view('showfolders', $map);
    }

While the "showfolders.php" view is:
Code:
<html>
    <head>
    <title>showfolders</title>
    </head>
    <body>
    <dl>
    &lt;? foreach ($map as $k => $v) {
        echo "<dt>$k</dt>
              <dd>$v</dd>"
    } ?&gt;
    </dl>
    <pre>
    &lt;? print_r($map) ?&gt;
    </pre>
    &lt;/body&gt;
&lt;/html&gt;

Yep, *VERY* basic, I am just at the first chapters of books I got… 
But, visiting the URI "/start/showfolders/" I am not able to show any data.
Thanks you all for you patience. Smile


Messages In This Thread
Not able to pass data to a view - by El Forum - 09-16-2010, 04:39 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 05:46 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 05:48 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:09 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:19 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 06:48 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 07:03 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 08:03 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 09:52 AM
Not able to pass data to a view - by El Forum - 09-16-2010, 02:49 PM
Not able to pass data to a view - by El Forum - 09-16-2010, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB