Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2008, 04:20 AM
Junior Member
 
Join Date: Jan 2008
Posts: 13
Default Action with slash

I want to implement the parameter in action which has slash /
e.g. http:// domain.com/controller/action -->
http:// domain.com/video/videostore/local/diehard.mov

here, video is controller and videostore/local/diehard.mov is the location of the video storage path. that's why I should use slash.

I have setup the router path
$route_2 = new Zend_Controller_Router_Route(
':controller_name/:video_path/*',
array(
'controller' => 'videoctrl',
'action' => 'videofilepath'
));

Is it possible to use slash as parameter? Thanks a lot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:12 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Probably not.

Is the path something you can store in the script, or does it change? If it does change, can you pass it some other data that you can use to determine the path? An id or something else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 02:49 AM
Junior Member
 
Join Date: Jan 2008
Posts: 13
Default

Thx for you help. but, what's your meaning of "change"?

If I reformat the passing URI and set the second parameter and third ... parameters as single variable. The first parameter is also the controller. Is it ok?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 03:28 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

By change, I mean... Is the path always the same for every video, or is does it depend on something else (which user is calling your method, etc)? If it doesn't change, then storing it as a constant or other variable may be a better way to go.

If it does change, then perhaps there's another type of parameter you could be passing that would allow you to figure out what the path should be, so that only the video name, + some other parameter could give you enough info to figure out the path.

HTH,

Eric
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 03:58 PM
Junior Member
 
Join Date: Jan 2008
Posts: 13
Default

Thanks for your help.
My case is so straight forward. No other factor affect the path of the video.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-29-2008, 01:31 PM
Member
 
Join Date: Aug 2007
Location: Sweden
Posts: 52
Send a message via MSN to Leif.Högberg
Default

I'll answer in two parts, first i'll reask the question that was asked by xentek above. And second I'll give a solution that you can use assuming the answer to the question above is negative.

So what xentek was asking above is that if you have two requests for two different videos would the two seperated requests both begin with the path 'videostore/local/'? Example:
http:// domain.com/video/videostore/local/diehard.mov
http:// domain.com/video/videostore/local/diehard2.mov
If the above is true, then what you should do is hard code the path ('videostore/local/') in a variable inside your controller so that the requests can be written as:
http:// domain.com/video/diehard.mov
http:// domain.com/video/diehard2.mov

Now if the above is false the solution would be to encode parameter somehow before creating the link.

One such solution would be using base64 encoded strings (see base64_encode/base64_decode)
If encoding the parameter it would now look like:
http:// domain.com/video/VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==

If SEO is a factor or you for some reason think that url is confusing you could use urlencode, or any other form of encoding, instead.

Hope this helps..

Last edited by Leif.Högberg : 02-29-2008 at 01:33 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:31 PM.