1. /blocksのしたにsampleというフォルダを作成します
2. sampleの下に次のファイルを作成します。
<?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>
<?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";
}
?>
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
print $form->label('content', 'テキスト');
print $form->text('content', 'サンプル',array('style' => 'width: 380px') );
?>
<?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') );
?>
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
if(!empty($content)) print $content;
?>