mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
initial import for API
This commit is contained in:
57
docs/en/programmers/api-functions/api-connect.xml
Normal file
57
docs/en/programmers/api-functions/api-connect.xml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.connect">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>connect</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>connect</methodname>
|
||||||
|
<methodparam><type>object</type><parameter>smarty</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>connect</methodname>
|
||||||
|
<methodparam><type>object</type><parameter>smarty</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>bool</type><parameter>reset</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
connect() is required on every invocation of SmartyValidate. Pass your
|
||||||
|
$smarty object as the parameter. This sets up SmartyValidate with $smarty
|
||||||
|
and auto-registers the default form. Passing the optional second param as
|
||||||
|
true, the default form registration will get reset.
|
||||||
|
</para>
|
||||||
|
<example>
|
||||||
|
<title>connect</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
$smarty = new Smarty();
|
||||||
|
SmartyValidate::connect($smarty);
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
49
docs/en/programmers/api-functions/api-disconnect.xml
Normal file
49
docs/en/programmers/api-functions/api-disconnect.xml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.disconnect">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>disconnect</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>disconnect</methodname>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
This clears the SmartyValidate session data. Call this after you are
|
||||||
|
completely finished with SmartyValidate (ie. do NOT call between form
|
||||||
|
submissions.)
|
||||||
|
</para>
|
||||||
|
<example>
|
||||||
|
<title>disconnect</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::disconnect();
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
48
docs/en/programmers/api-functions/api-is-form-registered.xml
Normal file
48
docs/en/programmers/api-functions/api-is-form-registered.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.is.form.registered">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>is_form_registered</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_form_registered</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Test if a form has been registered for validation.
|
||||||
|
</para>
|
||||||
|
<example>
|
||||||
|
<title>is_form_registered</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
if(!SmartyValidate::is_form_registered('myform')) { ... do something ... }
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.is.registered.criteria">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>is_registered_criteria</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_registered_criteria</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_registered_criteria</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Tests to see if a criteria function has been registered.
|
||||||
|
</para>
|
||||||
|
¶meter.form;
|
||||||
|
<example>
|
||||||
|
<title>is_registered_criteria</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
if(SmartyValidate::is_registered_criteria('test_password')) { ... }
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.is.registered.transform">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>is_registered_transform</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_registered_transform</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_registered_transform</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Tests to see if a transform function has been registered.
|
||||||
|
</para>
|
||||||
|
¶meter.form;
|
||||||
|
<example>
|
||||||
|
<title>is_registered_transform</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
if(SmartyValidate::is_registered_criteria('test_password')) { ... }
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
57
docs/en/programmers/api-functions/api-is-valid.xml
Normal file
57
docs/en/programmers/api-functions/api-is-valid.xml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.is.valid">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>is_valid</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_valid</methodname>
|
||||||
|
<methodparam><type>bool</type><parameter>formvars</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>bool</type><methodname>is_valid</methodname>
|
||||||
|
<methodparam><type>bool</type><parameter>formvars</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Tests if the current form is valid. You MUST supply the form variable array
|
||||||
|
to this function, typically $_POST. You can optionally pass a form name as
|
||||||
|
the second parameter. Call this after the form is submitted.
|
||||||
|
</para>
|
||||||
|
¶meter.form;
|
||||||
|
<example>
|
||||||
|
<title>is_valid</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::is_valid($_POST);
|
||||||
|
SmartyValidate::is_valid($_POST, 'myform');
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
68
docs/en/programmers/api-functions/api-register-criteria.xml
Normal file
68
docs/en/programmers/api-functions/api-register-criteria.xml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.register.object">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>register_object</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>register_criteria</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>register_criteria</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Registers a function to use with "isCustom" criteria type. All functions
|
||||||
|
must be registered before they can be used. You can optinally pass a form
|
||||||
|
name in the case you are validating more than one form at a time. Static
|
||||||
|
method calls are also supported such as foo::bar. You can also register a
|
||||||
|
method of an object instance such as foo->bar, but you must first register
|
||||||
|
the object with SmartyValidate. See the <link linkend="api.register.object">register_object()</link> method.
|
||||||
|
</para>
|
||||||
|
¶meter.form;
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
|
<para>
|
||||||
|
The register_function() method has been deprecated, use register_criteria() instead.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
<example>
|
||||||
|
<title>register_criteria</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::register_criteria('test_password');
|
||||||
|
SmartyValidate::register_criteria('test_password','myform');
|
||||||
|
SmartyValidate::register_criteria('myobj::test_password');
|
||||||
|
SmartyValidate::register_criteria('myobj->test_password');
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
51
docs/en/programmers/api-functions/api-register-form.xml
Normal file
51
docs/en/programmers/api-functions/api-register-form.xml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.register.form">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>register_form</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>register_form</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Register a form to be validated. Each form must be registered before it can
|
||||||
|
be validated. You do not have to register the 'default' form, that is done
|
||||||
|
automatically by SmartyValidate. If you register a form that is already
|
||||||
|
registered, it will be "reset", meaning you will lose previously stored data!
|
||||||
|
</para>
|
||||||
|
<example>
|
||||||
|
<title>register_form</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::register_form('myform');
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
@@ -9,17 +9,25 @@
|
|||||||
<title />
|
<title />
|
||||||
<methodsynopsis>
|
<methodsynopsis>
|
||||||
<type>void</type><methodname>register_object</methodname>
|
<type>void</type><methodname>register_object</methodname>
|
||||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
<methodparam><type>string</type><parameter>obj_name</parameter></methodparam>
|
||||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||||
<methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam>
|
|
||||||
<methodparam><type>boolean</type><parameter>format</parameter></methodparam>
|
|
||||||
<methodparam><type>array</type><parameter>block_methods</parameter></methodparam>
|
|
||||||
</methodsynopsis>
|
</methodsynopsis>
|
||||||
<para>
|
<para>
|
||||||
This is to register an object for use in the templates. See the
|
Register an object with SmartyValidate for use in isCustom criteria.
|
||||||
<link linkend="advanced.features.objects">object section</link>
|
Typically do this right after issuing <link linkend="api.connect">connect()</link>.
|
||||||
of the manual for examples.
|
See the <link linkend="api.register.criteria">register_criteria()</link>
|
||||||
|
method for more details.
|
||||||
</para>
|
</para>
|
||||||
|
<example>
|
||||||
|
<title>register_object</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::register_object('myobj',$myobj);
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
58
docs/en/programmers/api-functions/api-register-transform.xml
Normal file
58
docs/en/programmers/api-functions/api-register-transform.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<!-- $Revision$ -->
|
||||||
|
<refentry id="api.register.transform">
|
||||||
|
<refnamediv>
|
||||||
|
<refname>register_transform</refname>
|
||||||
|
<refpurpose></refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsect1>
|
||||||
|
<title />
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>register_transform</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<methodsynopsis>
|
||||||
|
<type>void</type><methodname>register_transform</methodname>
|
||||||
|
<methodparam><type>string</type><parameter>func_name</parameter></methodparam>
|
||||||
|
<methodparam choice="opt"><type>string</type><parameter>form</parameter></methodparam>
|
||||||
|
</methodsynopsis>
|
||||||
|
<para>
|
||||||
|
Registers a function to use with "transform" parameter. All functions must
|
||||||
|
be registered before they can be used. You can optinally pass a form name
|
||||||
|
in the case you are validating more than one form at a time. By default,
|
||||||
|
'trim' is already registered.
|
||||||
|
</para>
|
||||||
|
¶meter.form;
|
||||||
|
<example>
|
||||||
|
<title>register_transform</title>
|
||||||
|
<programlisting role="php">
|
||||||
|
<![CDATA[
|
||||||
|
<?php
|
||||||
|
SmartyValidate::register_transform('strtoupper');
|
||||||
|
SmartyValidate::register_transform('strtoupper','myform');
|
||||||
|
?>
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
</example>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:t
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
indent-tabs-mode:nil
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:nil
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
|
vim: et tw=78 syn=sgml
|
||||||
|
vi: ts=1 sw=1
|
||||||
|
-->
|
Reference in New Issue
Block a user