[Nitro] Basic Stuff...

George Moschovitis george.moschovitis at gmail.com
Wed Jun 22 06:19:25 EDT 2005


> 1) How does the controller connect to the view? In the blog example does
> each function in the controller correspond to a view file with the same
> filename as the function name? (like in rails?)

yeap the controller works more or less like in rails. So if you have a
file called my_action.xhtml you can add a method

def my_action

in the controller.

unlike Rails you can also have parameters in the action, ie:

def my_action(oid)

so when you call 


oid is initialized to 2 and you dont have to do request['oid'] just oid.

But this needs better explaining, wait for a tutorial...

please also note that you never add the .xhtml extension in urls, in a
way Nitro provides
implicit nice urls.
> 2) Must there be one controller per table in the db? (I guess not based on
> the examples, but I must ask)

Not, controllers have nothing to do with DB.
> 3a) Where is the api for the Rendering? what is a shader? and why does it
> get passed the LocalizationShader?

Ignore this for the moment. Better documentation is coming.

> 3b) The dispatcher starts 3 controllers? Is the first a default AKA :root?
> and the rest are named 'xml' and 'api'. Are these specific names denoting
> something? What is the ApiController for? I can not see it being used
> somewhere. What is the XmlController for? Why do we need 3?

:root is special and denotes '/'

if you use the url:


then the xxxx action in the controller mapped to :root is called

if you use the url:


then the xxx action in the controller mapped to xml is called

I think this is similar to Rails too...

> 4) What conf. directives are there and where is the info about them?

Please be patient. I will update the configuration system to be more
self explanatory...



More information about the Nitro-general mailing list