【发布时间】:2018-06-14 21:31:58
【问题描述】:
我使用教程https://jadb.wordpress.com/2011/04/22/social-engine-4-modules/创建了一个新模块
它工作正常。
后来我使用教程在新模块中创建了一个小部件。 https://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/
在模块创建期间未创建小部件文件夹。所以我为小部件创建了文件夹。 我还添加了 Controller.php 和 index.tpl 文件。
在我将教程中提到的代码添加到 content.php 文件后,我的新小部件出现在布局编辑器的管理端。 在我将小部件添加到页面并保存后,我在页面上看不到它的内容。
我在这里添加了我的文件内容。我的模块名称是LoginPhonenumber
小部件名称是hione。
content.php
<?php
return array(
array(
'title' => 'Hi One',
'description' => 'hi123',
'category' => 'Login Phonenumber',
'type' => 'widget',
'name' => 'login-phonenumber.hione',
'requirements' => array(
'no-subject',
),
),
) ?>
Controller.php
<?php
class LoginPhonenumber_Widget_HioneController extends
Engine_Content_Widget_Abstract
{
public function indexAction()
{
echo "hiiiiiiiiiiiiiiii";
}
}
?>
index.tpl
<?php echo "Welcome";?>
谁能告诉我问题出在哪里。
【问题讨论】:
-
你能同时显示Controller.php、index.tpl和content.php文件吗?
-
@KirkHammett 我用这些文件内容编辑了问题。你能查一下吗?
标签: php zend-framework widget socialengine