php - how to create custom cscart block -
i know how can send data template block have created. need know controller responsible sending data template block.
- create own custom template block addon directory ex:my_changes. path /design/addons/my_changes/blocks/my_addon.tpl
code:
{** block-description:my_addon **} {$test_variable|fn_print_r}
- setup schema block.
path:/app/addons/my_changes/schemas/block_manager/blocks.post.php
code:
if ( !defined('area') ) { die('access denied'); } $schema['my_addon'] = array ( 'content' => array( 'test_variable' => array( 'type' => 'function', 'function' => array('fn_get_my_custom_data') ), ), 'templates' => array( 'addons/my_changes/blocks/my_addon.tpl' => array(), ), 'wrappers' => 'blocks/wrappers', ); return $schema;
- implement fn_get_my_custom_data function in func.php file.
code:
function fn_get_my_custom_data () {return 'hello addon';}
- go admin panel, design -> layout, create new block-> create new block tab, find block "_block_my_add_on" there.
this it. hope makes clear how associate controller cscart block.
Comments
Post a Comment