表示するだけのブロック作成

1. /blocksのしたにsampleというフォルダを作成します

2. sampleの下に次のファイルを作成します。

Filename: db.xml

<?xml version="1.0"?>
<schema version="0.3">
        <table name="btContentLocal">
                <field name="bID" type="I">
                        <key />
                        <unsigned />
                </field>
                <field name="content" type="X2">
                </field>
        </table>
</schema>

Filename: controller.php

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));

class SampleBlockController extends BlockController {

	protected $btName = "サンプルブロック";
	protected $btDescription = "サンプルで作成したなにもしないブロックです。";
	protected $btTable = 'btContentLocal';
	protected $btInterfaceWidth = "500";
	protected $btInterfaceHeight = "80";
		
}
?>

Filename: add.php

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));

print $form->label('content', 'テキスト');
print $form->text('content', 'サンプル',array('style' => 'width: 380px') );

?>

Filename: edit.php

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));

print $form->label('content', 'テキスト');
print $form->text('content', htmlentities($content, ENT_QUOTES,"UTF-8"), array('style' => 'width: 380px') );

?>

Filename: view.php

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));

if(!empty($content)) print $content;
?>