Locating self | Dragonfly web framework

Locating Self

There was a young man who said, "Though it seems that I know that I know, what I would like to see is the 'I' that knows 'me', when I know that I know that I know." -- Alan Watts

The SET_DF_SELF function sets the DF_SELF and DF_SELF_DIR global symbols. As described in the section on creating your own routes, it is the responsibility of the route to call this function and therefore, if the route fails to perform this duty, these two symbols will be nil.

All other symbols listed here are guaranteed to be set to their proper values, and all of the routes that come with Dragonfly call SET_DF_SELF.

DF_SELF

This symbol contains the absolute path (on the server) to the main file responsible for providing an response to the requested URL, for example:

/home/www/rundragonfly.com/views/locating_self.html

DF_SELF_DIR

Contains the absolute path to the (on the server) to the directory containing the file represented by DF_SELF. This is a handy symbol, often used by scripts in combination with the add-to-load-path function (see the Core API for more info).

DF_PAGE

DF_PAGE is useful when writing templates, it tells us the full resource portion of the URL. For example, here's it current value:

/locating_self

CONTINUE »

Rendered in 0 milliseconds. Used 84 KB of memory, 59 KB for Lisp Cells.