print Tutorial 1: Building a simple guest book

Customer facing templates

A template for the default view has already been created. This is going to be customised very simply to just output the entries using "print_r" (it is an exercise for the reader to make a decent layout).



	
		
		Scorpio Framework - {$oMap->getDescription()}
		
	

	
		

guestbook

{$entries|printr}

Post

And the form:



	
		
		Scorpio Framework - {$oMap->getDescription()}
		
	

	
		

post to guestbook

{if $oModel->getErrorMessage()}
Error: {$oModel->getErrorMessage()}
{/if}
Name
Email Address
Comment
 

Now all that is left to do is update the controllerMap file in the base site or dev.base site so that you can access the guestbook and to then preview it in your browser.

You should be able to list and then post to the guestbook, and had the error messages echo'd out to the posting page.

This is all very simple and a lot more could be done (e.g. make it using ajax, better error checking etc.) but this should give a good idea of how you can very rapidly prototype components for a site and how you can re-use the logic in different contexts.