Welcome Guest, Not a member yet? Register   Sign In
Dynamic Content in CI
#9

[eluser]Phil Sturgeon[/eluser]
Ok fine, I'll throw in.

Now you have your articles/pages/whatever loading dynamically using URI parameters, you now need to link to these dynamically. The best way to do this, is to retrieve a list from the database, which should hold id and title already.

model:

Code:
// add me
  function get_all($arg)
  {
    $query = $this->db->select('id, title')->get('site_pages');
    return $query->result();
  }

view:

Code:
<HTML><head></head>

<body>
<div id="outer">

<div id="left">
<div class="navheader">Main Menu</div>
    <ul>
    &lt;?php foreach( $pages as $page): ?&gt;
    <li>&lt;?php echo anchor('test/funkcja/'.$page->id, $page->title);?&gt;</li>
    &lt;?php endforeach; ?&gt;
    </ul>
</div>
</div>

<div id="right">
&lt;?PHP
echo $zmienna;
?&gt;
</div>

</div>

&lt;/body&gt;
&lt;/html&gt;

All of these basic concepts are shown here and in a thousand other places on the internet.


Messages In This Thread
Dynamic Content in CI - by El Forum - 12-09-2009, 08:36 AM
Dynamic Content in CI - by El Forum - 12-09-2009, 08:45 AM
Dynamic Content in CI - by El Forum - 12-09-2009, 11:18 AM
Dynamic Content in CI - by El Forum - 12-09-2009, 11:29 AM
Dynamic Content in CI - by El Forum - 12-09-2009, 12:22 PM
Dynamic Content in CI - by El Forum - 12-09-2009, 01:11 PM
Dynamic Content in CI - by El Forum - 12-09-2009, 01:16 PM
Dynamic Content in CI - by El Forum - 12-11-2009, 03:30 AM
Dynamic Content in CI - by El Forum - 12-11-2009, 04:40 AM
Dynamic Content in CI - by El Forum - 12-11-2009, 01:11 PM
Dynamic Content in CI - by El Forum - 12-12-2009, 05:15 AM
Dynamic Content in CI - by El Forum - 12-20-2009, 11:20 PM
Dynamic Content in CI - by El Forum - 12-21-2009, 08:38 AM
Dynamic Content in CI - by El Forum - 12-21-2009, 09:31 AM
Dynamic Content in CI - by El Forum - 12-21-2009, 06:02 PM
Dynamic Content in CI - by El Forum - 12-21-2009, 06:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB