Codeigniter URL에 문제가 있습니다.Codeigniter 이미지 및 소스 URL
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {
function __construct()
{
parent::__construct();
}
public function index()
{
$data['tiung'] = 'index';
$this->load->view('welcome_message',$data);
}
public function dor($bus)
{
$data['tiung'] = $bus;
$this->load->view('welcome_message',$data);
}
}
및 전망 "welcome_message.php": 나는 컨트롤러 "welcome.php"가 나는이 사용하는 매개 변수와 함께 컨트롤러 기능 'DOR'를 액세스하려면
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome to CodeIgniter</title>
</head>
<body>
sesuatu <?php echo $tiung?>
<img src="fragor.jpg" width="720" height="246" alt=""/>
ladalah
</body>
</html>
:
localhost/hostname/index.php/welcome/dor/something
및 작동하지만 문제는 이미지가로드되지 않습니다. 나는 webroot 폴더, 'application'폴더, 심지어 'views'폴더에 이미지 파일을 저장하려고 시도했다. 하지만 여전히 이미지를로드 할 수 없습니다. 이미지 파일을 어디에 두어야합니까?
자산 폴더 나 CSS 폴더, 다음 ('자산/fragor.jpg') SITE_URL에 같은 SITE_URL의 연료 소모량을 사용; – Rooster