An autoloader is a feature to allow classes and functions from different files to be included automatically when they are first called. This saves the need to explicitly include all of the files, or create a monstrous global functions/classes file.
Questions tagged [autoloader]
388 questions
0
votes
2 answers
Code Igniter Auto Load With custom name
i want to know is there way that I can pass my custom class name in autoload class
Example:
in a controller i know we can do this
$this->load->library('parser','','my_parser')
but what i want to know is there way that i can pass custom name…

ahmad05
- 438
- 2
- 6
- 23
0
votes
2 answers
How to autoload a custom class in Zend Framework 2?
I'm using zend framework2 skeleton, and I'm trying to add my own classes behind vendor folder. The problem is: I don't know how to prepare the classes to be loaded on demand (autoloaded) only when I'll instantiate one of them from any module.
I…

ebr
- 37
- 3
0
votes
1 answer
Autoloader Error after updating to Zend Framework 2.2.5
As a warning I am not a programmer. I inherited an application which uses Zend Framework and needs to be updated and I'm trying to do my best here. I will really appreciate if you can provide detailed information to troubleshoot the issue. …

vGeek
- 1
0
votes
2 answers
Why isn't CodeIgniter autoloading my package?
In my application/config/config.php, I want to autoload my library package:
/*
| -------------------------------------------------------------------
| Auto-load Packges
| -------------------------------------------------------------------
|…

NobleUplift
- 5,631
- 8
- 45
- 87
0
votes
1 answer
Class Comment not found Laravel 4
Im trying to add a comment system to my laravel app.
But I can't seem to get it working.
I have two models
class Post extends \Eloquent {
protected $table = 'posts';
public function comments()
{
return…

boortmans
- 1,138
- 2
- 24
- 40
0
votes
1 answer
PSR-0 Autoload Error
I want use composer for my projects.
My project structure:
src
Easycache
Common
Cache
Cache.php
CacheInterface.php
...
Namespace
namespace…

kemal
- 371
- 2
- 4
- 14
0
votes
2 answers
Auto mapping method parameters to $_POST data (MVC)
Imagine I have a URL that loads a controller if the name matches (Ignoring any security issues with this at the moment hehe)
public function Load( $controller, $action = "Index" )
{
…

Jimmyt1988
- 20,466
- 41
- 133
- 233
0
votes
1 answer
ZF2 Autoloader: autodiscover classes
I'm trying to figure out if I can use ZF2's Loader/Autoloader to "auto discover" modules and classes. I am not using ZF2 in its native MVC framework structure, but rather as a library.
Current, I have the following structure:
/Application
…

bear
- 11,364
- 26
- 77
- 129
0
votes
2 answers
How to add custome bundles in symfony which are hosted locally?
Let's assume, I made a custom symfony bundle like a small ORM, and now I want to include this bundle and register it in the AppKernel currently, the bundle in found in the Vendor folder. So, what I did primary is add it in the kernel
new…
anon
0
votes
1 answer
Why does the ZF2 autoloader build the path wrongly?
I have an application with some modules. One of them is CourseSearch. Now I want to add a further one, the SportsPartnerSearch. Since these two modules are very similar to each other, I simply "cloned" / copied the CourseSearch and replaced all…

automatix
- 14,018
- 26
- 105
- 230
0
votes
0 answers
PHP MVC autoloading in the class that creates the controllers
I am trying to add an autoloader to the loader of my MVC to remove all the need for requires and includes.
The autoloader works because I've used it before.
What I need to know is how I can update this code to remove all the 'require's as they…

AdRock
- 2,959
- 10
- 66
- 106
0
votes
1 answer
PHP Composer include file with defined "use namespace as" statements, append to each file
I know you can use Composer's files scheme to include functions or definitions automatically in every file.
I'd like to take this one step further and never have to manually write a use classname as statement again in individual files. This is my…

Ryan Brodie
- 6,554
- 8
- 40
- 57
0
votes
1 answer
Auto loader not looking in the proper places
In relation to WordPress you have two main functions: get_template_directory(), get_stylesheet_directory(), The first of these will look in the theme folder, while the other will look in the child theme directory.
If we combine these, we can make a…

TheWebs
- 12,470
- 30
- 107
- 211
0
votes
1 answer
PSR-0 autoloader: Namespaces and the directory structure
Does the PSR-0 autoloader convention require using namespaces that map to the directory structure?
function autoload($className)
{
$className = ltrim($className, '\\');
$fileName = '';
$namespace = '';
if ($lastNsPos =…

Guido Rossi
- 67
- 6
0
votes
2 answers
Zend Framework 1.x - How do I get data from database?
Here is my project structure: http://img823.imageshack.us/img823/7047/68818300.png
I connected to database by using php.ini:
[production]
phpSetting.display_status_errors = 1
phpSetting.display_errors = 1
bootstrap.path = APPLICATION_PATH…

Killer Whale
- 87
- 2
- 12