[Catalyst] Virtual file system

vti mbit at ukr.net
Mon Dec 18 12:27:57 GMT 2006


Hello.

I was wondering if there is an elegant way to make web-navihation looks like your hard drive. For example I have materials that could be organazied that way. 

\ root
 -> personal
    -> story1
    -> story2
 -> public
    -> ...
       -> ..

Where material belongs_to material, and has_many materials.

And to have example.com/materials/...

So i made up with:

sub root : Chained('/') PathPart('materials') CaptureArgs(0) {
}

sub path : Chained('root') PathPart('') {
    my ( $s, $c, @path ) = @_;
# here is checking through all the path like foreach ( @path ) if it
# exists in database

And if we come up with the right path we just show it.

When i start web server, i get "/materials/..." in "[debug] Loaded Chained actions: section".

Everything seems like great, but how to organize basic CRUD? For example
i want to add material in some 'folder':

/materials/personal/.../add

But if i understand how Chains work there is no way of doing that. And i have to make somethins like:

sud add: Regex('add$')

And it doesn't work for, because I am using language chain, and i don't want to mix up with Chains and regulat paths.

Appreciate your help

Thanks for the great framework.

-- 
vti -- Viacheslav Tikhanovskii

And Jehu the son of Hanani the seer went out to meet him, and said to
king Jehoshaphat, Shouldest thou help the ungodly, and love them that
hate the LORD?	therefore is wrath upon thee from before the LORD.
		 -- 2 Chronicles 19:2



More information about the Catalyst mailing list