致命错误:在Codeigniter中调用未定义的函数base_url()

时间:2019-06-29 09:22:45

标签: php codeigniter base-url

你好,我是CodeIgniter和PHP的新手,我试图在第一时间进行设置,但是会出现以下错误。

我使用了wammp,并且在'www'中有文件夹名称'taxiapp' 请帮我:

在我的dashboard.php和autoloaded.php和config.php下面

  

(!)致命错误:未捕获错误:在第17行(C)\ wamp64 \ www \ TaxiApp \ application \ views \ dashboard.php中调用未定义函数base_url()(!)错误:调用未定义函数base_url( )在第17行的C:\ wamp64 \ www \ TaxiApp \ application \ views \ dashboard.php中调用堆栈#TimeMemoryFunctionLocation 10.0005405632 {main}()... \ dashboard.php:0

<!DOCTYPE html>
<?php
ini_set('display_startup_errors', true);
error_reporting(E_ALL);
ini_set('display_errors', true);
?>
<html>
<head>
<meta charset="UTF-8" />
<meta name="google-translate-customization" content="e6d13f48b4352bb5- 
f08d3373b31c17a6-g7407ad622769509b-12"></meta>

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>Dashboard - 24/7 Taxi</title>

<!-- bootstrap -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url();? 
>application/views/css/bootstrap/bootstrap.min.css" />
<!-- RTL support - for demo only -->
<script src="<?php echo base_url();?>application/views/js/demo-rtl.js"> 
</script>
<!-- 
If you need RTL support just include here RTL CSS file <link 
rel="stylesheet" type="text/css" href="css/libs/bootstrap-rtl.min.css" />
And add "rtl" class to <body> element - e.g. <body class="rtl"> 
-->'

autloader.php

$autoload['helper'] = array('url');

config.php

$config['base_url'] = 'http://172.20.10.3/TaxiApp/';

1 个答案:

答案 0 :(得分:-1)

保留cssjs文件夹以及application文件夹,并相应地更改hrefsrc的值。

TaxiApp

-应用程序

-css

-js