Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Expanded docs about tal:on-error

  • Loading branch information...
commit 329b1dcb865da76f46b94a137dfb85e16636c424 1 parent c04d2c1
Kornel authored

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. +9 6 doc/en/book.xml
15 doc/en/book.xml
@@ -861,10 +861,11 @@ title="google search engine">the google search engine</a>
861 861 <title><sgmltag>tal:on-error</sgmltag></title>
862 862
863 863 <para>
864   - This attribute replaces the tag by the <sgmltag>tal:on-error</sgmltag> expression
865   - evaluation if a path error is detected in the tag content, or if
866   - any <acronym>PHP</acronym> exception is thrown in the tag content.
867   - </para>
  864 + When any runtime error occurs while generating the element, the element will be replaced with result of <emphasis>expression</emphasis> in the <sgmltag>tal:on-error</sgmltag> attribute.</para>
  865 +
  866 + <para>
  867 + Runtime errors are references to non-existent variables/paths/macros and any <acronym>PHP</acronym> exceptions thrown in the tag content.</para>
  868 +
868 869
869 870 <informalexample><programlisting language="xml"><![CDATA[<span tal:on-error="string:No username defined here"
870 871 tal:content="user/name">the user name here</span>
@@ -872,7 +873,7 @@ title="google search engine">the google search engine</a>
872 873
873 874 <para>
874 875 If an error occurs accessing '<varname>name</varname>' or '<varname>user</varname>', the error string
875   - will be shown at the tag's place.
  876 + will be shown instead of the <code>&lt;span></code> element.
876 877 </para>
877 878
878 879 <para>
@@ -886,6 +887,8 @@ title="google search engine">the google search engine</a>
886 887 </span>
887 888 ]]></programlisting></informalexample>
888 889
  890 + <note><para>Due to optimizations performed by <acronym>PHPTAL</acronym>, <sgmltag>tal:on-error</sgmltag> on element containing element with <sgmltag>metal:fill-slot</sgmltag> may not catch errors that happened inside the slot.</para></note>
  891 +
889 892 </section>
890 893
891 894 </section><!-- end of TAL namespace -->
@@ -897,7 +900,7 @@ title="google search engine">the google search engine</a>
897 900
898 901 <informalexample><programlisting language="xml"><![CDATA[<html xmlns:metal="http://xml.zope.org/namespaces/metal" …>]]></programlisting></informalexample>
899 902
900   - <note><para>PHPTAL does not enforce this requirement.</para></note>
  903 + <note><para><acronym>PHPTAL</acronym> does not enforce this requirement.</para></note>
901 904
902 905
903 906 <para>

0 comments on commit 329b1dc

Please sign in to comment.
Something went wrong with that request. Please try again.