stalkmadude
-
Posts
4 -
Joined
-
Last visited
Posts posted by stalkmadude
-
-
Thanks Jayson for the help, WIth that would I be able to avoid writing new for each classes?
-
I've given a try by moving to __construct but no luck. Could you please explain with small demo?
Edit: I think i got it working Could you explain me a method so that I don't need to keep writing new ClassName everytime?
-
Hello,
I'm having hard time with spl_autoload_register function specially when its inside a class. I would appreciate any help
This is my index.php
<?php require('./loadclasses.php'); ?>
loadclasses.php
<?php class loadclasses { function autoLoader($className) { $fileName = str_replace("_", PATH_SEPARATOR, $className); include($fileName); } spl_autoload_register('autoLoader'); }
But i keep getting this error
Parse error: syntax error, unexpected 'spl_autoload_register' (T_STRING), expecting function (T_FUNCTION) in d:\xampp\htdocs\welcomemanager\loadclasses.php on line 11
I am running php 5.4 version on xmapp
thanks again!
-
hello everyone im new member here willing to learn
spl_autoload_register and class
in PHP Coding Help
Posted
That's not what I meant I meant I want to avoid typing the above code for every new class, something like Zend Framework.