more linking and WS from Peter

This commit is contained in:
nlopess
2005-05-27 16:25:02 +00:00
parent 3086de700b
commit 26b3e5489e
78 changed files with 1400 additions and 727 deletions

View File

@@ -2,11 +2,11 @@
<!-- $Revision$ -->
<refentry id="api.register.block">
<refnamediv>
<refname>register_block</refname>
<refpurpose></refpurpose>
<refname>register_block()</refname>
<refpurpose>dynamically register block functions plugins</refpurpose>
</refnamediv>
<refsect1>
<title />
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>register_block</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
@@ -15,7 +15,8 @@
<methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
</methodsynopsis>
<para>
Use this to dynamically register block functions plugins.
Use this to dynamically register
<link linkend="plugins.block.functions">block functions plugins</link>.
Pass in the block function name, followed by the PHP
function callback that implements it.
</para>
@@ -33,18 +34,18 @@
</para>
<para>
<parameter>cacheable</parameter> and <parameter>cache_attrs</parameter>
can be omitted in most cases. See <link
can be omitted in most cases. See <link
linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link>
on how to use them properly.
</para>
<example>
<title>register_block</title>
<title>register_block()</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty->register_block("translate", "do_translation");
$smarty->register_block('translate', 'do_translation');
function do_translation ($params, $content, &$smarty, &$repeat)
function do_translation ($params, $content, &$smarty, &$repeat)
{
if (isset($content)) {
$lang = $params['lang'];
@@ -67,6 +68,14 @@ Hello, world!
]]>
</programlisting>
</example>
<para>
See also
<link linkend="api.unregister.block">unregister_block()</link>
and
<link linkend="plugins.block.functions">Plugin Block Functions</link>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file