我是 codeigniter 的新手,我在 codeigniter 中使用在線教程為我的登錄表單創建了一個驗證碼。加載登錄頁面時出現以下錯誤:> 致命錯誤:調用未定義的函數 base_url() $config = array( 'img_path' => 'captcha_images/', 'img_url' => base_url().'captcha_images/', 'img_width' => '150', 'img_height' => 50, 'word_length' => 8, 'font_size' => 16 ); $captcha = create_captcha($config);i dont have any folder named 'captcha_images', all i have is a controller for captcha,config and the view in login. As am new to this, is it because i dont have a folder or i didnt call any library? please help me with this. thanks in advance
1 回答

阿波羅的戰車
TA貢獻1862條經驗 獲得超6個贊
轉到?application/config/autoload.php
?下面寫下這一行(您會在第 90 行找到 codeigniter 不錯的文檔)?$autoload['helper'] = array('url');
這將自動加載 url 幫助程序。?base_url() function is defined in url helper
您可以為特定控制器手動加載它
$this->load->helper('url');
在控制器構造函數中寫入此行或
Controller action function
- 1 回答
- 0 關注
- 156 瀏覽
添加回答
舉報
0/150
提交
取消