#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    335
    Rep Power
    246

    Catalsy :Path vs :Local


    I'm little conused over methods with the access modifier of ':Path'

    I have a new controller and have this code (which is auto generated)
    Code:
    sub index :Path :Args(0) {
        my ( $self, $c ) = @_;    
        $c->response->body('Matched Members::Controller::LibraryDocs in LibraryDocs.;
    }
    As I undestand the action mechanism, that should only run if the url is
    http://mydomain/librarydocs
    and the root.pm 'index' should run if the URL is
    http://mydomain/
    Only now when the root url is accessed, the librarydocs method is running?

    Why?

    Edit->

    infact I added a method in the librarydocs controller
    Code:
    sub test :Path :Args(0){    
        
        my ( $self, $c ) = @_;     
        $c->response->body('Matched HLP_Members::Controller::LibraryDocs test in LibraryDocs.); 
        
        }
    which won't run if I use the url
    http://mydomain/librarydocs/test
    but does run for
    http://mydomain/
    Last edited by 1DMF; October 17th, 2012 at 08:29 AM.
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    335
    Rep Power
    246
    In the end I deleted the LibraryDocs.pm code, copied the Site.pm controller code and recreated the LibraryDocs.pm code and now it is showing in the devel server.

    .-----------------------------------------------------------------+----------.
    | Class | Type |
    +-----------------------------------------------------------------+----------+
    | Members::Controller::LibraryDocs | instance |
    | Members::Controller::Root | instance |
    | Members::Controller::Site | instance |
    | Members::Model::DBLOCAL | instance |
    | Members::Model::Sql | instance |
    '-----------------------------------------------------------------+----------'

    [debug] Loaded Private actions:
    .----------------------+--------------------------------------+--------------.
    | Private | Class | Method |
    +----------------------+--------------------------------------+--------------+
    | /default | Members::Controller::Root | default |
    | /end | Members::Controller::Root | end |
    | /index | Members::Controller::Root | index |
    | /auto | Members::Controller::Root | auto |
    | /librarydocs/index | Members::Controller::LibraryDocs | index |
    | /site/index | Members::Controller::Site | index |
    '----------------------+--------------------------------------+--------------'

    [debug] Loaded Path actions:
    .-------------------------------------+--------------------------------------.
    | Path | Private |
    +-------------------------------------+--------------------------------------+
    | / | /index |
    | /... | /default |
    | /librarydocs/ | /librarydocs/index |
    | /site/ | /site/index |
    '-------------------------------------+--------------------------------------'
    Now onto the next problem! :confused:
    Free MP3 Dance Music Downloads

    To err is human; To really balls things up you need Microsoft!

IMN logo majestic logo threadwatch logo seochat tools logo