decided in favor of dedicated COMPONENT() macro, updates to documentation
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
|
||||
RENDER(Request& context)
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
<>
|
||||
<section style="border:1px solid #ccc;padding:1em;margin:1em 0;">
|
||||
<? render_component("card:TITLE", context.call, context); ?>
|
||||
<? render_component("card:BODY", context.call, context); ?>
|
||||
<? render_component(":TITLE", context.call, context); ?>
|
||||
<? render_component(":BODY", context.call, context); ?>
|
||||
</section>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:TITLE(Request& context)
|
||||
COMPONENT:TITLE(Request& context)
|
||||
{
|
||||
<>
|
||||
<h3><?= first(context.call["title"].to_string(), "Component Title") ?></h3>
|
||||
</>
|
||||
}
|
||||
|
||||
RENDER:BODY(Request& context)
|
||||
COMPONENT:BODY(Request& context)
|
||||
{
|
||||
<>
|
||||
<p><?= first(context.call["body"].to_string(), "Component Body") ?></p>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
RENDER(Request& context)
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
String lang = first(context.call["lang"].to_string(), "plain");
|
||||
<>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
RENDER(Request& context)
|
||||
COMPONENT(Request& context)
|
||||
{
|
||||
String title = first(
|
||||
context.call["node"]["attrs"]["title"].to_string(),
|
||||
|
||||
Reference in New Issue
Block a user