Using external class in my Controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Using external class in my Controller (/showthread.php?tid=63761) |
Using external class in my Controller - lipa - 12-08-2015 Im working on my first project in CodeIgniter and I wonder How can I use my class from library in my Controller. libraries/Twitterclass.php: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); My Controller: PHP Code: public function microtweets() I want to use his extended class in my controller and work there on this $n value or for example display it in my View. I got few errors in my view for example: Quote:A PHP Error was encountered RE: Using external class in my Controller - ciadmin - 12-08-2015 libraries/Twitterclass.php defines a class Twetterclass? The names need to match. RE: Using external class in my Controller - pdthinh - 12-08-2015 (12-08-2015, 03:58 AM)lipa Wrote: Im working on my first project in CodeIgniter and I wonder How can I use my class from library in my Controller. The Tweeterclass::__construct should be PHP Code: public function __construct($params) { Read more here |