Welcome Guest, Not a member yet? Register   Sign In
neverending css problem
#1

[eluser]alex[/eluser]
Hi there. This is my second try to make work a view with a css style sheet. I've written another post trying to use a CSS framework and I finally maked it work properly but when I've used ANY CI funcion into the view, I just screwed it up (I couldn't see the view lines under the calling of CI function). Let me make it clear: if I used a CI function in the line number 10 (of the view), when I tryied to see that view, I couldn't see any content under the 10th line. I though that was a problem between the css framework (YAML) and CI then I just downloaded a css template and when I add a CI function in that template I have the same problem: it just desappear the view under the calling of CI function.
Can anybody tell me what I'm doing wrong? I don't even need to modify the template, just change the content using CI functions, that's all.

Thanks in advance
Alejandro



p.s: I'm using CI 2.0.2 under Ubuntu 10.10
#2

[eluser]danmontgomery[/eluser]
post some code
#3

[eluser]alex[/eluser]
ok. here we go:
CONTROLLER:

Code:
<?php

class Portada extends CI_Controller {

    function index()
    {
        $this->load->view('portada_vista');
    }
}
?>

VIEW:
Code:
<head>
<base href="<?php echo base_url(); ?>"/>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>

.
.
.

<div class="formulario">

   &lt;?php echo validation_errors(); ?&gt;

   &lt;?php echo form_open('form'); ?&gt;

   <h5>Username</h5>
   &lt;input type="text" name="username" value="" size="50" /&gt;

   <h5>Password</h5>

   &lt;input type="text" name="password" value="" size="50" /&gt;


   <div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>

   &lt;/form&gt;

</div>
.
.
.


But I want to make it clear that if I take off the CI functions, the view (with the css template) works fine


Thanks!
#4

[eluser]John_Betong_002[/eluser]
Try this:

Code:
&lt;link href="&lt;?php echo base_url();?&gt;css/style.css" rel="stylesheet" type="text/css" media="screen" /&gt;
&nbsp;
&nbsp;
I hope your config['base_url'] set correctly Smile

If not try this:

Code:
$config['base_url'] = 'http://' .$_SERVER['SERVER_NAME'] .'/';
&nbsp;
&nbsp;
#5

[eluser]alex[/eluser]
KMN:
the problem was that I wasn't loading the proper library in my controller...

this is how the controller should be:


Code:
&lt;?php

class Portada extends CI_Controller {

    function index()
    {

        $this->load->helper(array('form', 'url'));

        $this->load->library('form_validation');

        $this->load->view('portada_vista');
    }
}
?&gt;


Thank you anyway for your time, dude

alex!




Theme © iAndrew 2016 - Forum software by © MyBB