Eidolon::Core::Loader - Eidolon driver loader.
This code must be placed in one of your application controllers. For example, in lib/Example/Controller/Default.pm:
lib/Example/Controller/Default.pm
sub default : Default { my ($r, $tpl); $r = Eidolon::Core::Registry->get_instance; $tpl = $r->loader->get_object("Eidolon::Driver::Template"); if ($tpl) { $tpl->parse("index.tpl"); $tpl->render; } }
The Eidolon::Core::Loader package is the central part of Eidolon abstraction layer. It provides the unified interface for manipulations with vital application objects (drivers). You can load a new driver and gain access to loaded drivers with this package.
The driver being loaded must be inherited from Eidolon::Driver class to pass driver validation procedure.
The object of Eidolon::Core::Loader is mounted in application registry as $r->loader, so it can be used later by any application component.
$r->loader
Class constructor.
Loads a $class driver and initializes it with given @params (if any).
$class
@params
Returns an object of the loaded driver. If driver with given $class isn't loaded undef will be returned.
undef
Eidolon, Eidolon::Application, Eidolon::Driver, Eidolon::Core::Exceptions
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Anton Belousov, <abel@cpan.org>
Copyright (c) 2009, Atma 7, http://www.atma7.com
To install Eidolon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Eidolon
CPAN shell
perl -MCPAN -e shell install Eidolon
For more information on module installation, please visit the detailed CPAN module installation guide.