Bu Mysore, Karnataka, Hindistan Syed Harun değildir.
Assume:
Root Folder Name: ci_test
CSS file name : mystyles.css";
Controller file name: Start.php
view file name: test_view.php
Solution:
Suggestion for WAMP (hope it will be easy to fix the same in xampp):
Root / sistem / uygulama / css kaydetmek
Uygulama klasöründe yeni bir CSS dizin (sadece dosyaları yönetmek ve doğru bir şekilde klasör) oluşturma
How to connect back to CSS file?
in system/application/config/config.php
Edit "$config['base_url'] = http://localhost/" to
$config['base_url'] = "http://localhost/ci_test";
Sandık yeni bir satır
$config['css'] = "system/application/css/mystyles.css";
"Sistem / uygulama / kontrolörleri / start.php" aşağıdaki örnek kodu eklemek bir Denetleyicisi oluşturun:
class Start extends Controller {
var $base;
var $css;
function Start(){
parent::Controller();
$this->base = $this->config->item('base_url');
$this->css = $this->config->item('css');
}
function hello(){
$data['css'] = $this->css;
$data['base'] = $this->base;
$data['mytitle'] = 'Welcome to this site';
$data['mytext'] = "Hello, now this is how CSS work!";
$this->load->view('test_view', $data);
}
}
Sandık "sistem / uygulama / izleme / test_view.php" aşağıdaki örnek kodu eklemek bir görünüm dosyası:
<html>
<head>
<title>Web test Site</title>
<base href= <?php echo "$base"; ?> >
<link rel="stylesheet" type="text/css" href="<?php echo "$base/$css";?>">
</head>
<body>
<h1><?php echo $mytitle; ?> </h1>
<p class='test'> <?php echo $mytext; ?> </p>
</body>
</html>
şimdi tarayıcınızın ur adres çubuğuna bu enter "http://localhost/ci_test/index.php/start/hello/"