Welcome Guest, Not a member yet? Register   Sign In
when I load a model within a controller the link and script tags in the view get embedded within the body tag
#1

[eluser]midooh[/eluser]
when I load a model within a controller the link and script tags in the view get embedded within the body tag
I"m a new to codeIgniter I ve tried so many things i dont no the reason please help
#2

[eluser]jedd[/eluser]
[quote author="midooh" date="1254869637"]when I load a model within a controller the link and script tags in the view get embedded within the body tag
I"m a new to codeIgniter I ve tried so many things i dont no the reason please help[/quote]

Show your controller code where you load the model.
#3

[eluser]midooh[/eluser]
class Authi extends Controller {

function Authi()
{
parent::Controller();
$this->load->model("SP/SP_model");

}

function index(){
$data=array(
"main_css_template"=>$this->config->item("global_template"),
"Javascript_library"=>$this->config->item("application_main_JS_library_file"),
"page_title"=>$this->config->item("Main_Page_title"));
$this->load->view("Home/main_page.php",$data);
}

}


even when i load it inside the index function or autoloading it i get the same result
#4

[eluser]jedd[/eluser]
I think perhaps this has not much to do with loading a model in your controller.

In your main_page.php file, how are you you using the $main_css_template and $page_title variables?

In my view, you might need to do something like this:
Code:
echo  link_tag('assets/stylesheets/'. $main_css_template);
#5

[eluser]midooh[/eluser]
I'm sorry i forgot to include it im using something like that
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href=<?php echo $main_css_template; ?> rel="stylesheet" rev="stylesheet" />
[removed]
[removed]
<title><?php echo $page_title; ?></title>
</head>
#6

[eluser]midooh[/eluser]
I have tried it it didnt work link_tag helper
It doesnt get embedded within the body if i load the model within the view
#7

[eluser]jedd[/eluser]
JS gets snipped. So let's focus on the link tag for your stylesheet - you can remove the js references from your code, while we do this testing.

What's the page-source for your viewed web page look like - specifically everything between HTML and /HEAD ?
#8

[eluser]jedd[/eluser]
[quote author="midooh" date="1254879397"]I have tried it it didnt work link_tag helper
[/quote]

More information is better than less information.

Quote:It doesnt get embedded within the body if i load the model within the view

Don't load models from views.
#9

[eluser]midooh[/eluser]
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;link href=&lt;?php echo $main_css_template; ?&gt; rel="stylesheet" rev="stylesheet" /&gt;
[removed]
[removed]
&lt;title&gt;&lt;?php echo $page_title; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<div id="wrapper">
&lt;?php
$this->load->view("Login.php");
$this->load->view("Header.php");
?&gt;
<div id="content">
</div>
</div>
[removed]
// trick for IE7
$("#wrapper")[0].removeChild($("#wrapper")[0].firstChild);
[removed]
&lt;/body&gt;
&lt;/html&gt;
#10

[eluser]midooh[/eluser]
This is the full page the script tag got removed but its as same as the link tag




Theme © iAndrew 2016 - Forum software by © MyBB