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.

  1. 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} 
  1. 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; 
  1. implement fn_get_my_custom_data function in func.php file.

code:

function fn_get_my_custom_data () {return 'hello addon';} 
  1. 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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -