Plugg のプラグインの作り方について
投稿者: gondayu | 投稿日時: 2009/5/24 12:32 | 閲覧: 12874回
いつもお世話になります。
ブログ:プラグインの作り方 - 1.プラグインの基本構造 と Plugg に標準添付のプラグインのソースコードを見て HelloWorld を作ってみています。
以下の手順で作成してみましたが、プラグインとして認識されない模様です。
どこか間違っていると思いますのでご指摘して頂ければ幸いです。
よろしくお願い致します。
1.HelloWorldディレクトリを作成
xoops_trust_path/modules/Plugg/plugins/HelloWorld
2. PluginInfo.php を作成
<?php
class Plugg_HelloWorld_PluginInfo extends Plugg_PluginInfo
{
public function __construct($library, $path, $application)
{
parent::__construct($library, $path, $application);
$this->_version = '1.0.0';
$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。)';
$this->_nicename = $this->_('HelloWorld!)';
}
}
3. Plugin.php を作成
<?php
class Plugg_HelloWorld_Plugin extends Plugg_Plugin
{
}
4.Plugg 管理画面のプラグインで確認
インストール可能なプラグイン一覧に表示されると思いますが、うまく表示できません。
#何度か更新も実行してみましたが表示できません。
コメント(4)
新しいものから |
古いものから |
ネスト表示 |

Re: Plugg のプラグインの作り方について
投稿者: onokazu | 投稿日時: 2009/5/24 14:59
早速ありがとうございます。
引用:
2. PluginInfo.php を作成<?php class Plugg_HelloWorld_PluginInfo extends Plugg_PluginInfo { public function __construct($library, $path, $application) { parent::__construct($library, $path, $application); $this->_version = '1.0.0'; $this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。)'; $this->_nicename = $this->_('HelloWorld!)'; } }
上の
$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。)';
$this->_nicename = $this->_('HelloWorld!)';
ですが、
$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。');
$this->_nicename = $this->_('HelloWorld!');
となるのではないかと思います。
Re: Plugg のプラグインの作り方について
ありがとうございます。
<?php
class Plugg_HelloWorld_PluginInfo extends Plugg_PluginInfo
{
public function __construct($library, $path, $application)
{
parent::__construct($library, $path, $application);
$this->_version = '1.0.0';
$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。');
$this->_nicename = $this->_('HelloWorld!');
}
}
上記のようにシングルクォートを収支しました。
が、インストール可能なプラグイン一覧には表示されません。
# 再度更新も実行しています。
引用:
早速ありがとうございます。
引用:2. PluginInfo.php を作成<?php class Plugg_HelloWorld_PluginInfo extends Plugg_PluginInfo { public function __construct($library, $path, $application) { parent::__construct($library, $path, $application); $this->_version = '1.0.0'; $this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。)'; $this->_nicename = $this->_('HelloWorld!)'; } }
上の$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。)'; $this->_nicename = $this->_('HelloWorld!)';
ですが、$this->_summary = $this->_('Hello World!と言う文字列を出力するプラグイン。'); $this->_nicename = $this->_('HelloWorld!');
となるのではないかと思います。
Re: Plugg のプラグインの作り方について
Re: Plugg のプラグインの作り方について