Welcome Guest, Not a member yet? Register   Sign In
include in library
#8

[eluser]Craig A Rodway[/eluser]
base_url() is not what you need.

Using base_url() (which will result in http://example.com/include/calendar/datepicker.php for example) will not work to include that class if you want to use the PHP class object itself and its functions (eg. new datepicker();).

When you include via http (as you are doing) you are simply including the output (if any) of that page as if you viewed it in a web browser - you do not get access to any of the classes or functions or PHP code (hence why you can't load the datepicker object). That is why you need to include it's filesystem path, as shown in esra's last example:

Code:
require(BASEPATH.'include/calendar/datepicker.php');

This is why you see your test echo, but cannot create a new object using $picker = new datepicker();.


Messages In This Thread
include in library - by El Forum - 01-01-2008, 07:30 PM
include in library - by El Forum - 01-01-2008, 08:42 PM
include in library - by El Forum - 01-01-2008, 09:02 PM
include in library - by El Forum - 01-01-2008, 09:39 PM
include in library - by El Forum - 01-01-2008, 09:45 PM
include in library - by El Forum - 01-01-2008, 10:53 PM
include in library - by El Forum - 01-02-2008, 06:06 AM
include in library - by El Forum - 01-02-2008, 09:10 AM
include in library - by El Forum - 01-02-2008, 03:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB