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

[eluser]seismic[/eluser]
I already read carefuly the user guide Smile Anyway Theprodigy thnx.
There is no mention how to input the "variable text" or the "variable file" in the div of template.
Stuffradio what about if "some value" will be a big article (one of many) taken from the file(html essence with h1,h2,p etc symbols) and it depends from the parameter taken from the link? (i know how to get the variable from the link already).
For example i have 2 articles here.

Default Controller:
Code:
<?php
class Test extends Controller {  
  function index($var) {
    parent::Controller();    
    $this->load->helper('url');
    $this->load->view('template/view_index', $var);
  }
}
?>


view/view_index.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;title&gt;metrohacker&lt;/title&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt;
&lt;meta name="description" content="Your website description goes here" /&gt;
&lt;meta name="keywords" content="your,keywords,goes,here" /&gt;
&lt;/head&gt;

&lt;body&gt;
<div id="outer">

<div id="left">
Main Menu
<ul>
&lt;!-- How do you create the links here with files: article01, article02, ... ?
i would like to make link like: www.example.com/article01 --&gt;
<li><a href="php echo base_url(); ?&gt;article01">ArticleHardware</a></li>
<li><a href="php echo base_url(); ?&gt;article02">ArticleSoftware</a></li>
</ul>
</div>


<div id="right">
&lt;!-- How do you put the content of various files depends of parameter here? --&gt;
&lt;?PHP
$this->load->view( $var ) ?&gt;
</div>

</div>
&lt;/body&gt;
&lt;/html&gt;

Should I store article/files in the view folder (in eg. view/articles/article01)?
What extension should i use? What extension do you prefer?
What about Model doing here? Should i use the Model class somewhere here?


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