paulb@507 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
paulb@507 | 2 | <html xmlns="http://www.w3.org/1999/xhtml"><head> |
paulb@507 | 3 | <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" /> |
paulb@507 | 4 | |
paulb@507 | 5 | <title>Manipulating Paths</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/" /> |
paulb@507 | 6 | <link href="styles.css" rel="stylesheet" type="text/css" /></head> |
paulb@507 | 7 | <body> |
paulb@507 | 8 | <h1>Manipulating Paths</h1><p>Whilst path values are useful in telling |
paulb@507 | 9 | us something about where a particular resource resides or how far the |
paulb@507 | 10 | processing of a resource has progressed, it is sometimes useful to |
paulb@507 | 11 | apply some kind of transformation to the path in order to produce a |
paulb@507 | 12 | reference to another resource or application. Consider the simple case |
paulb@525 | 13 | of <a href="redirection.html">redirecting</a> a user to another resource:</p><p>First we must obtain a reference to the current resource:<br /></p><pre>this_resource = trans.get_path_without_query() # eg. "/app/resource/some-data"</pre><p>We may wish to redirect the user to the main application resource; this is done by removing <code>resource</code> from the end of the path:</p><pre>this_app = trans.update_path("..") # produces "/app/resource"</pre><p>A complete description of this method can be found in the <a href="../apidocs/public/WebStack.Generic.Transaction-class.html#update_path">API documentation</a>.</p></body></html> |