Welcome Guest, Not a member yet? Register   Sign In
Importing class file in CI
#1

[eluser]Computerzworld[/eluser]
Hello,
I am having one class that is created in traditional PHP and using adodb for database connection. I want to use this class in my controller. Is it possible to do so? If yes then how? Please tell me. Thanks in advance.
#2

[eluser]xwero[/eluser]
put it in the application/libraries directory and load it like a CI library.
#3

[eluser]Sumon[/eluser]
[quote author="xwero" date="1221764422"]put it in the application/libraries directory and load it like a CI library.[/quote]
xwero,
i have one question in my mind. shall i have to exclude database from my config\autoload?
Code:
$autoload['libraries'] = array('session', 'email');  //removed 'database'
if not then there will be two active database connection. One CI and another adobd. and both are active at the same time. Right?
#4

[eluser]Computerzworld[/eluser]
ya i am facing this issue as sumon has said...
i tried to include my class in CI as library but as soon as I included it the page goes blank...
i don't know what should be the problem behind this...
#5

[eluser]xwero[/eluser]
So you have altered the class to use CI database functions? Then i would recommend you use it as a model.
#6

[eluser]Sumon[/eluser]
[quote author="Computerzworld" date="1221813755"]ya i am facing this issue as sumon has said...
i tried to include my class in CI as library but as soon as I included it the page goes blank...[/quote]
from my experience this is always tough to find out the problem when there are no warning or error but the page is blank. however, i found two situations where the page display blank. First when there is an include file name and the file path or file name is incorrect. and secondly when there is php 5 coding(use of static variable or etc) and the server version is 4. These are from my non CI development experience.




Theme © iAndrew 2016 - Forum software by © MyBB