|
MY_Cart.php
PHP复制代码
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Cart extends CI_Cart {
public function __construct ($params = array())
{
parent ::__construct ($params);
}
public function pt () {
echo 'Oh,year!';
}
}
复制代码
控制器文件
PHP复制代码
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Page extends CI_Controller {
public function index ()
{
$this->load->library('cart');
$this->cart->pt();
}
}
复制代码
Fatal error: Call to undefined method CI_Cart::pt() in D:\wamp\www\ci\application\controllers\page.php on line 8
|
|