|
#description and small samples of WebGoo elements, they separate on the nouns and on the verbs The NounsTemplateTemplate can be defined manually and it looks like this: <template id="template:hiuser" type="cdata">
<![CDATA[
<p>Hi, <b>{user}</b>, how are you today.</p>
]]>
</template>DatasetDataset can be defined manually: <data-set id="data:user">
<name>Partick</name>
<country>Germany</country>
</data-set>Or it can be generated from the module: <data-set id="data:counter" module="counter" method="getData" /> ModuleModule is a package of logic, for programmers it's like a class that you can use from WebGoo. So let's show how you can instantiate the module, and use it. Modules are written in the hosting programming language. <!-- define a module, the type is counter -->
<module id="module:counter" type="counter" />
<!-- module can create us data-set -->
<data-set id="data:counter" module="module:counter" method="getData" />
<!-- action can be called on module too -->
<do-action module="module:counter" method="action_count" />
<!-- module can be used as display -->
<display module="module:counter" method="show_counter" /> So you can initilize the module, module can return you data (data-set), it can give be used to display something and you can call an action on it. The VerbsDisplayDisplays things. <!-- display file -->
<display file="styles/intro_text.html" type="cdata" />
<!-- display file, in this case php (like php's include it executes the php code) -->
<display file="styles/header" type="php" />
<!-- display template -->
<display template="template:header" />
<!-- display template by merging it with data-set -->
<display template="template:hiuser" data-set="data:user"/>
<!-- display the output of the modules method -->
<display module="counter" method="show_counter" />
<display template="template:counter" data-set="data:counter" />Do Action <do-action module="module:counter" method="action_count" />
|