|
| 1. "Quick tools" are the function library |
Quick tools" are collections of functions that can be called in one line. In the C# version they are objects with static methods and in the PHP5 version they are just lists of functions without objects. In both cases they allow you to type thing like this if(qstr.AreEqual(idCode,"main")) to compare two value case-insensitively or this qstr_LowercaseFirstCharacter($variableName). Quick tools are divided into the following categories:
- qstr = string functions, e.g. removing all characters before a specific character, forcing a colon at the end of a string, etc.
-
qdat = date functions, e.g. returning a nice date such as "Sunday, November 7th, 2004", etc.
-
qfil =file i/o functions, e.g. checking whether or not a file exists, converting the contents of a file to an array of strings, etc.
-
qsys = system functions, e.g. getting query string variables, form variables, redirecting the browser, posting system messages for the user, etc.
-
qxml = XML functions, e.g. returning a node based on an xpath, parsing an XML and XSL file and returning a string, parsing an XML string and an XSL string and returning a string, etc.
If you ever need any "richer" functionality, then you want to make a class in the \systemClasses. The qtIncludeFiles file in the qtools directory is just an umbrella file which includes all the other quick tool files so that every page you create has access to all functions from any group.
| Learn more: | Browse through every file in the \qtools directory and when you see a function that is interesting, do a global search on its name through your Datapod files to find out where and how it is used. |
Eitschpi: When does Datapod for PHP5 come? post question or comment |
|
|
| |
|
| 2. Simplified fonts and font assignment |
Fonts are defined in the .css file in the /css directory. The main fonts are:
- ReadThis - normal text
- LookAtThisFirst - labels, headers
- FinePrint - tiny dark print
- MinorDetail - tiny light print
This takes care of about 80% of your needs and enables you to have wide-reaching control of the layout (skins), e.g. to be able to change ALL the normal, reading text of a site to a softer or larger font just by changing one style in the CSS file.
Notice how you use a special notation with brackets to easy define fonts (these characters are replaced with SPAN tags in the Output class right before everything is sent out to the browser.
|
|
| |
|
| 3. A lot of code generation going on |
In the Datapod-for-C# there are menu items which allow you to:
- create item - generates singular and plural OOP classes as well as files to handle online editing of the data as well as generation of database tables simply by asking you the fields you want in your item
- create form - generates an HTML form and the handling code simply by asking you the fields you want on the form
- create place - the simplest version of code generation (and the first code generation functionaliy that I make when I begin a Datapod version for a new platform, e.g. PHP 5), it simply creates the .aspx (or .php5) file along with putting an entry in the database table "Places" (pages).
- create class - this speeds up the development of simple classes if I need to encapsulate some functionality quick
| Learn more: | In the C# Datapod, try out all of the above steps. All except create class have pretty detailed instuctions |
|
|
| |
|
| 4. Global text variables available for developer and users |
In the Render() method of the Output class you will find a block where text prefixed with a tilde is replaced with other text. This enables both developers and normal users (who enter data in text boxes in HTML forms) to use these variables. I use these variables for internal links, long-but-standard license texts. You could limit which variables can be used by which users simply by checking for the accessGroup before replacing the text.
| Learn more: | create a variable of your own by adding a replacement statement in the output class |
|
|
| |
|
| 5. Output class is central |
The first functionality I create in any Datapod version on any platform is the Output class. The concept is that you have a "output object" which you keep adding to and then at the end you call Render() on it which sends the collected text out to the browser. This allows you to do variable replacement, gives you tight control on skins (e.g. see the "print view" functionality on each page in Datapod-for-C#), allows dynamic javascript insertions (only when used on the page), allows tight security based on access groups, you can wrap deep functionality in little methods on the output class so that you can say things like output.AddCommentBox() and a comment box pops up at that point, etc.
| Learn more: | Create a page with this basic structure and see how easy it is. |
|
|
| |