github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

robertkrimen / CatalystX-InjectComponent

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.
  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Version bump to 0.024 
robertkrimen (author)
Wed Oct 14 18:55:54 -0700 2009
commit  e0e3a52c5a167645ea11a9e551fd3666d2f63176
tree    54a04314b82edf2bcb706d2e8fae5f7c582c8681
parent  d67808fcc67040c83868553c4a57473fbab5c9e8
CatalystX-InjectComponent /
name age
history
message
file .cvsignore Loading commit data...
file .gitignore
file .screenrc
file Changes
file GNUmakefile
file MANIFEST
file Makefile.PL
file README
directory lib/
directory t/
directory xt/
README
NAME
    CatalystX::InjectComponent - Inject components into your Catalyst
    application

VERSION
    Version 0.024

SYNOPSIS
        package My::App;

        use Catalyst::Runtime '5.80';

        use Moose;
        BEGIN { extends qw/Catalyst/ }

        ...

        after 'setup_components' => sub {
            my $class = shift;
            CatalystX::InjectComponent->inject( into => $class, component => 'MyModel' );
            if ( $class->config->{ ... ) {
                CatalystX::InjectComponent->inject( into => $class, component => 'MyRootV2', as => 'Controller::Root' );

                            }
            else {
                CatalystX::InjectComponent->inject( into => $class, component => 'MyRootV1', as => 'Root' ); # 
                Controller:: will be automatically prefixed
            }
        };

DESCRIPTION
    CatalystX::InjectComponent will inject Controller, Model, and View
    components into your Catalyst application at setup (run)time. It does
    this by creating a new package on-the-fly, having that package extend
    the given component, and then having Catalyst setup the new component
    (via "->setup_component")

So, how do I use this thing?
    You should inject your components when appropiate, typically after
    "setup_compenents" runs

    If you're using the Moose version of Catalyst, then you can use the
    following technique:

        use Moose;
        BEGIN { extends qw/Catalyst/ }

        after 'setup_components' => sub {
            my $class = shift;

            CatalystX::InjectComponent->inject( into => $class, ... )
        };

METHODS
  CatalystX::InjectComponent->inject( ... )
        into        The Catalyst package to inject into (e.g. My::App)
        component   The component package to inject
        as          An optional moniker to use as the package name for the derived component

    For example:

        ->inject( into => My::App, component => Other::App::Controller::Apple )
            
        The above will create 'My::App::Controller::Other::App::Controller::Apple'

        ->inject( into => My::App, component => Other::App::Controller::Apple, as => Apple )

            The above will create 'My::App::Controller::Apple'

ACKNOWLEDGEMENTS
    Inspired by Catalyst::Plugin::AutoCRUD

AUTHOR
    Robert Krimen, "<rkrimen at cpan.org>"

BUGS
    Please report any bugs or feature requests to
    "bug-catalystx-injectcomponent at rt.cpan.org", or through the web
    interface at
    <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CatalystX-InjectComponen
    t>. I will be notified, and then you'll automatically be notified of
    progress on your bug as I make changes.

SUPPORT
    You can find documentation for this module with the perldoc command.

        perldoc CatalystX::InjectComponent

    You can also look for information at:

    *   RT: CPAN's request tracker

        <http://rt.cpan.org/NoAuth/Bugs.html?Dist=CatalystX-InjectComponent>

    *   AnnoCPAN: Annotated CPAN documentation

        <http://annocpan.org/dist/CatalystX-InjectComponent>

    *   CPAN Ratings

        <http://cpanratings.perl.org/d/CatalystX-InjectComponent>

    *   Search CPAN

        <http://search.cpan.org/dist/CatalystX-InjectComponent/>

ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
    Copyright 2009 Robert Krimen, all rights reserved.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server