I created a new module using the tutotorial https://jadb.wordpress.com/2011/04/22/social-engine-4-modules/
Its working as fine.
later i created a widget in the new module using the tutorial. https://jadb.wordpress.com/2011/01/17/socialengine-4-create-a-widget/
The widget folder was not created during the module creation time. so i created folder for widgets. and also i added Controller.php and index.tpl files.
After i added the code mentioned in the tutorial to content.php file ,my new widget appeared on the admin side in layout editor. After i add my widget to page and save it, I don't see it's content on page.
I have added my file contents here. my module name is LoginPhonenumber
and widget name is 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";?>
Can anyone tell me where is the problem.
I suggest you to change your module's name: none of core modules uses kind of naming similar to login-phonenumber
. All modules are named as one single word:
As you can see, even if module name contains more than one word, they're named as a single word, without dashes. In case if you'll use module with dash inside you'll most probably receive next warning:
WARN (4): exception 'Engine_Content_Exception' with message 'Widget's module is not enabled or not installed: "login-phonenumber"'
which allows us to understand that SocialEngine can't identify a module with such name, even if its name in database as login-phonenumber
.