我正在使用codeigniter开发我们的应用程序.我试图使用base_url()函数,但它显示空结果.我通过自动加载文件使用了autoload helper,但是它似乎也没有用.我也定义了基本常量,但都是徒劳的.请帮忙.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" href="<?php echo base_url();?>/css/template/default.css" type="text/css" />
<script type="text/javascript">
//<![CDATA[
base_url = '<?= base_url();?>';
//]]>
</script>
</head>
Run Code Online (Sandbox Code Playgroud) 以下工作对于codeigniter框架不能正常工作......
它是我的观点:
<?php
echo '<h2>'.$news_item['title'].'</h2>';
echo $news_item['text']."</br></br>";
?>
<a href="<?php site_url("news"); ?>" > Back to Main </a></br></br>
Run Code Online (Sandbox Code Playgroud)