• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot normally load different content in one view.

#1
[eluser]dimaomni[/eluser]
Hi all,

In general:
I have three column site. Each column is located in own view. Left column has menu. I want to display different content in middle column when I click on links.

What is best practice for this task?


I try do it by 2 ways:
- Send via GET view's file name and insert this value to $this->load->view($contentName);
and it worked, however displayed page were incorrect displayed.

- then I tried in middle column(separate view) to use require "". and nothing change as for me.

controller cmain:
Code:
public function index($ilinkId)
  {
    
    $data['content'] = $ilinkId;
    $this->load->view('front/vheader');
    $this->load->view('front/vcontent', $data);
    $this->load->view('front/vleftmenu');
    $this->load->view('front/vrightmenu');
    $this->load->view('front/vfooter');

view vcontent:
Code:
<?php
if ($content == NULL)
    {
       $content = "vgreeting";
    }                          
require "content/".$content.".php ";
?>

view vleftmenu:
Code:
<li>&lt;?php echo anchor('front/cmain/index/vabout', 'About');?&gt;</li>

Now it seems that css doesn't load when I click on the link. Why ???

file structure(short):
/site
|
|_images
| |_a lot of
|-style
| |_ style.css
|
|__application
| |_controllers
| | |_front
| | |_cmain.php
| |_view
| | |_front
| | |_vcontent.php ...etc
|_index.php


thank you in advance!


Messages In This Thread
Cannot normally load different content in one view. - by El Forum - 06-30-2011, 05:11 AM
Cannot normally load different content in one view. - by El Forum - 06-30-2011, 05:19 AM
Cannot normally load different content in one view. - by El Forum - 06-30-2011, 06:10 AM
Cannot normally load different content in one view. - by El Forum - 06-30-2011, 09:40 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.