Function : Window

This function is mostly used in window classes. It provides information on the current window url based on three window url pattern which are specified as root, path, base. Every url in spoova framework is rendered based on these named divisions.

Assuming we have url samples:
sample urls
  Localhost:  http://localhost/spoova/docs/functions/core
  
  Remote Url: http://some_site.com/docs/functions/core
                  
Then using the samples as reference:

window('root'): The first path that exists after the domain name. This will be equivalent to "docs"
window('path'): The paths that comes after root path. This will be equivalent to "functions/core"
window('base'): All paths that comes after the assumed domain. This is equivalent to "docs/functions/core"

It is important to mention that the short form of window('root') is window(':') as they both return the same value. Also, in the course of this tutorial, the word domain will be used as a general representation for localhost/spoova and some_site.com.

Binding Paths

The window() function supports path binding which usually involve the prepending of window options returned value with the specified path supplied along with the argument. Examples of these are shown below:

 window('root:user'); http://domain/docs/user
                  
 window(':user'); //same as above
                  
 window(':user.profile'); http://domain/docs/user/profile
                  
 window('base:user'); http://domain/docs/functions/core/user
                  
By default, the window() function converts dots to slashes but this can be prevented by setting the second argument to true as shown below:
 window(':user.profile', true); http://domain/docs/user.profile