mirror of
https://github.com/php/doc-ja.git
synced 2026-03-25 15:42:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@325742 c90b9560-bf6c-de11-be94-00142212c4b1
143 lines
4.1 KiB
XML
143 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 4d81bf20250c93fdfb7b114c5d8abe13f311fba4 Maintainer: takagi Status: ready -->
|
|
<refentry xml:id="function.bbcode-set-flags" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>bbcode_set_flags</refname>
|
|
<refpurpose>パーサのオプションを設定あるいは変更する</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>
|
|
パーサのオプションを設定あるいは変更します。
|
|
</para>
|
|
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>bbcode_container</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<function>bbcode_create</function> が返す BBCode_Container リソース。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>flags</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
bbcode_container オプションに適用するフラグのセット。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
BBCODE_SET_FLAGS_* 定数のいずれか。
|
|
指定したフラグを設定する、あるいは解除する、あるいは置き換えるのいずれかを指定します。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>bbcode_set_flags</function> の使用例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/*
|
|
* ルールセットを準備します
|
|
*/
|
|
$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>'),
|
|
);
|
|
/*
|
|
* 入れ子構造が間違っている BBCode
|
|
*/
|
|
$text="[i] Parser [b] Auto Correction [/i] at work [/b]\n";
|
|
$BBHandler=bbcode_create($arrayBBCode);
|
|
echo bbcode_parse($BBHandler,$text);
|
|
// 閉じた要素を自動的に再開させます
|
|
bbcode_set_flags($BBHandler,BBCODE_CORRECT_REOPEN_TAGS,
|
|
BBCODE_SET_FLAGS_SET);
|
|
echo bbcode_parse($BBHandler,$text);
|
|
|
|
/*
|
|
* 入れ子構造が間違っており、閉じタグが足りない BBCode
|
|
*/
|
|
$text="[i] Parser [b] Auto Correction [/i] at work\n";
|
|
echo bbcode_parse($BBHandler,$text);
|
|
// 閉じていないタグを自動的に終了させます
|
|
bbcode_set_flags($BBHandler,
|
|
BBCODE_CORRECT_REOPEN_TAGS|BBCODE_AUTO_CORRECT,
|
|
BBCODE_SET_FLAGS_SET);
|
|
echo bbcode_parse($BBHandler,$text);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
<i> Parser <b> Auto Correction </b></i> at work
|
|
<i> Parser <b> Auto Correction </b></i><b> at work </b>
|
|
<i> Parser [b] Auto Correction </i> at work
|
|
<i> Parser <b> Auto Correction </b></i><b> at work
|
|
</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
|
|
-->
|
|
|