Welcome Guest, Not a member yet? Register   Sign In
Cannot normally load different content in one view.
#4

[eluser]CodeIgniteMe[/eluser]
In your view file
[quote author="dimaomni" date="1309450263"]
Code:
<?php
if ($content == NULL)
    {
       $content = "vgreeting";
    }                          
require "content/".$content.".php ";
?>
[/quote]
You should change
Code:
require "content/".$content.".php ";
to
Code:
require "application/view/front/content/{$content}.php";
or
Code:
$this->load->view("front/content/$content");
// $content is parsed first and returns the string value. Notice I used "" instead of ''
// You do not need to include ".php" extension because CI automatically does it for you.
In CI, everything is included/required from the index.php files and not from the view files themselves. This is done in the Server-side.

When you include CSS files in your browser, you are then doing a Client-side include, which should start from the base path of your site. Try this.
Code:
<link href="<?=base_url()?>"style/style.css rel="stylesheet" />
Remember to enable short_open_tags if you want this PHP syntax.


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



Theme © iAndrew 2016 - Forum software by © MyBB