SocialEngine Tutorial

Hello World Module

To create your first 'hello World' module do the following steps:

 

1. Login into admin area

2. Go to Manage - Package & Plugins - Developer SDK  and click on Create Package

3.Fill the form as follows:

  • Select MODULE
  • Name: helloworld           - must be one word. It is the the part of .tar file name
  • Title: My Hello World
  • Description: My first Hello World module
  • Author: Sasa M

When clicked on Create Package .tar file is created. it ontains skeleton directoris and files for programming module. Download the module-helloworld-4.0.0.tar file onto your computer.

 

4. Go to Manage Packages and click the link Install New Packages.

Then upload module-helloworld-4.0.0.tar file. File is uploaded into /temporary/package/sdk/ directory.

Then follow the steps to install empty (not yet programmable) module.

It must be #chmod 777 _R application/modules

If you don't have FTP server select none.

 

5. The module root folder is application/modules/Helloworld . Module has its own MVC structure. Models are inside /Model/ , views in /views/ and controllers in /controllers/ directory.

 

6. CONTROLLER: Put into /controllers/IndexController.php

<?php

class Helloworld_IndexController extends Core_Controller_Action_Standard
{
  public function indexAction()
  {
    $this->view->poruka = 'Hello World <br><br> by Saša';
  }
}

 

7. VIEW: Put into /views/scripts/index/index.tpl

<h1 style="color:#3688EF">My First plugin</h1>
<br>
<span style="color:green; font: 18px Verdana;"><?= $this->poruka ?></span>

 

8. Call the module from browser's address bar:

http://www.socialengine.loc/helloworld/index/

or

http://www.socialengine.loc/helloworld/

 

 

Export social engine module

if you want to export plugin to be installed on another server use:

Admin - manage - Plugins

Developer SDK tab - Build packages

Download module-helloworld-4.o.o.tar file .

 

 

That's all folks!