-
Notifications
You must be signed in to change notification settings - Fork 3
Applets
Applet is a special type of block or widget, no need of installation.
Whit this smarty code :
<{widget name="applet-name-you-have"}>
It's very easy you must do this Steps:
###2. Put this file in to /usr/applets/ ###3. Add the code like this in your file `namespace Applet;
class Twitterfollow extends \Application\Applet
{
public function render()
{
return $this->twitter();
}
protected function img()
{
$image = 'follow_me-a.png';
$pach = 'img/images/twitter/';
$img = \XOOPS::url($pach.$image);
return $img;
}
protected function url()
{
$account = 'XoopsProject';
$url = 'http://www.twitter.com/'. $account;
return $url;
}
protected function alt()
{
$alt = 'Follow XoopsProject on Twitter';
return $alt;
}
protected function twitter()
{
$twitter = "
";
return $twitter;
}
} `
###4. you have to add this part in top of your file for load applets
namespace Applet;
###5. after that you have to add class like this :
class YOURCLASSNAME extends \Application\Applet { ..... }
###6. you need render public function like this :
public function render() { ..... }
###7. if you need other functions you can put all functions in your class as protected function