logan
07-20-2010, 08:25 AM
I am new to vivvo and just finished reading the documentation of module development.
I wanted to test the new module that I have from the documentation and I made a directory in root by the name of my_boxes.
In this directory I have a file box_hello.php with the code :
<?php
/**
* @see 'lib/vivvo/plugin/vivvo_plugin.php'
*/
require_once(VIVVO_FS_FRAMEWORK . 'vivvo_plugin.php');
/**
* Box Hello
*
* @version 0.1
* @author Your name here
*/
class box_hello extends module {
public $_default_template_file = 'system/box_default/box_hello.tpl';
public function generate_output($params = array()) {
$this->set_template($params);
if ( isset($params['string']) ) {
$string = $params['string'];
} else {
$string = 'Hello world!';
}
$this->_template->assign('my_var', $string);
}
}
?>
Then I registered it in configuration table.
Now, when I put the code following in homepage/default.tpl, the desired output is not shown.
<vte:box module="box_hello">
<vte:params>
<vte:param name="string" value="foo" />
</vte:params>
<vte:template>
<hr />
Output: <vte:value select="{my_var}" />
<hr />
</vte:template>
</vte:box>
Kindly help me.
Logan
I wanted to test the new module that I have from the documentation and I made a directory in root by the name of my_boxes.
In this directory I have a file box_hello.php with the code :
<?php
/**
* @see 'lib/vivvo/plugin/vivvo_plugin.php'
*/
require_once(VIVVO_FS_FRAMEWORK . 'vivvo_plugin.php');
/**
* Box Hello
*
* @version 0.1
* @author Your name here
*/
class box_hello extends module {
public $_default_template_file = 'system/box_default/box_hello.tpl';
public function generate_output($params = array()) {
$this->set_template($params);
if ( isset($params['string']) ) {
$string = $params['string'];
} else {
$string = 'Hello world!';
}
$this->_template->assign('my_var', $string);
}
}
?>
Then I registered it in configuration table.
Now, when I put the code following in homepage/default.tpl, the desired output is not shown.
<vte:box module="box_hello">
<vte:params>
<vte:param name="string" value="foo" />
</vte:params>
<vte:template>
<hr />
Output: <vte:value select="{my_var}" />
<hr />
</vte:template>
</vte:box>
Kindly help me.
Logan