mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 15:32:36 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@326561 c90b9560-bf6c-de11-be94-00142212c4b1
142 lines
4.1 KiB
XML
142 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 4d81bf20250c93fdfb7b114c5d8abe13f311fba4 Maintainer: tatai Status: ready -->
|
|
<refentry xml:id="function.bbcode-set-flags" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>bbcode_set_flags</refname>
|
|
<refpurpose>Establece o cambia las opciones del analizador</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>bbcode_set_flags</methodname>
|
|
<methodparam><type>resource</type><parameter>bbcode_container</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer>BBCODE_SET_FLAGS_SET</initializer></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
Establece o cambia las opciones del analizador
|
|
</para>
|
|
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>bbcode_container</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Resource BBCode_Container , retornado por
|
|
<function>bbcode_create</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El flag que se debe aplicar a las opciones de bbcode_container
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Una de las constantes BBCODE_SET_FLAGS_* para aplicar, eliminar un set
|
|
de flag o reemplazar el set de flag por <parameter>flags</parameter>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de uso de <function>bbcode_set_flags</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/*
|
|
* Preparando el set de reglas
|
|
*/
|
|
$arrayBBCode=array(
|
|
'b'=> array('type'=>BBCODE_TYPE_NOARG,
|
|
'open_tag'=>'<b>', 'close_tag'=>'</b>'),
|
|
'u'=> array('type'=>BBCODE_TYPE_NOARG,
|
|
'open_tag'=>'<u>', 'close_tag'=>'</u>'),
|
|
'i'=> array('type'=>BBCODE_TYPE_NOARG,
|
|
'open_tag'=>'<i>', 'close_tag'=>'</i>'),
|
|
);
|
|
/*
|
|
* Emparejando BBCode anidado incorrectamente
|
|
*/
|
|
$texto = "[i] Analizador [b] Autocorrección [/i] en el trabajo [/b]\n";
|
|
$BBHandler = bbcode_create($arrayBBCode);
|
|
echo bbcode_parse($BBHandler, $text);
|
|
// Habilitamos reapertura de elementos cerrados automáticamente
|
|
bbcode_set_flags($BBHandler, BBCODE_CORRECT_REOPEN_TAGS, BBCODE_SET_FLAGS_SET);
|
|
echo bbcode_parse($BBHandler, $texto);
|
|
|
|
/*
|
|
* Desemparejado de BBCode anidado incorrectamente
|
|
*/
|
|
$texto = "[i] Analizador [b] Autocorrección [/i] en el trabajo\n";
|
|
echo bbcode_parse($BBHandler, $texto);
|
|
// Habilitamos cierre automático de etiquetas pendientes
|
|
bbcode_set_flags($BBHandler,
|
|
BBCODE_CORRECT_REOPEN_TAGS | BBCODE_AUTO_CORRECT,
|
|
BBCODE_SET_FLAGS_SET);
|
|
echo bbcode_parse($BBHandler, $texto);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
<i> Analizador <b> Autocorrección </b></i> en el trabajo
|
|
<i> Analizador <b> Autocorrección </b></i><b> en el trabajo </b>
|
|
<i> Analizador [b] Autocorrección </i> en el trabajo
|
|
<i> Analizador <b> Autocorrección </b></i><b> en el trabajo
|
|
</b>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|