dongpiao0731 2018-11-24 06:38
浏览 66

如何在视图页面中调用自己的库

My library name is numbertowords and it's in library folder and i want to call it in view page..How do i call?? i called like this

<?php
$this->load->library('numbertowords');
?>
<?php 
echo $this->numbertowords->convert_number($row['billtotal']); 
echo" Rupees Only"
?>
</h3>

I am getting error like this

A PHP Error was encountered Severity: Notice

Message: Undefined property: CI_Loader::$numbertowords

Filename: Inventory/Bill_Print1.php

Line Number: 233

Backtrace:

File: C:\xampp\htdocs\Yuva3\application\views\Inventory\Bill_Print1.php
Line: 233
Function: _error_handler

File: C:\xampp\htdocs\Yuva3\application\controllers\TipUp_Loan.php
Line: 74
Function: view

File: C:\xampp\htdocs\Yuva3\index.php
Line: 315
Function: require_once


Fatal error: Call to a member function convert_number() on null in C:\xampp\htdocs\Yuva3\application\views\Inventory\Bill_Print1.php on line 233
A PHP Error was encountered
Severity: Error

Message: Call to a member function convert_number() on null

Filename: Inventory/Bill_Print1.php

Line Number: 233

Backtrace:
  • 写回答

2条回答 默认 最新

  • dongyanling9248 2018-11-24 12:05
    关注

    changed my library file name from numbertowords To Numbertowords..

        <?php
    $this->load->library('Numbertowords');
    ?>
    <?php 
    echo $this->numbertowords->convert_number($row['billtotal']); 
    echo" Rupees Only"
    ?>
    </h3>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据