<?php/** ...* - period - If defined, get pages by time period. ::fn_create_periods</li>* ...*/
変数を記述して、この関数で変数が使用される理由を明確にします。
例:
<?php/** * Processes cart data after calculating all prices and other data (taxes, shippings etc) * * @paramarray $cart Cart data * @paramarray $cart_products Cart products * @paramarray $auth Auth data * @paramstring $calculate_shipping // 1-letter flag * A - calculate all available methods * E - calculate selected methods only (from cart[shipping]) * S - skip calculation * @parambool $calculate_taxes Flag determines if taxes should be calculated * @parambool $apply_cart_promotions Flag determines if promotions should be applied to the cart */fn_set_hook('calculate_cart', $cart, $cart_products, $auth, $calculate_shipping, $calculate_taxes, $apply_cart_promotions);
?><?php/** * Change SQL parameters for product data select * * @paramint $product_id Product ID * @paramstring $field_list List of fields for retrieving * @paramstring $join String with the complete JOIN information (JOIN type, tables and fields) for an SQL-query * @parammixed $auth Array with authorization data * @paramstring $lang_code Two-letter language code (e.g. 'en', 'ru', etc.) * @paramstring $condition Condition for selecting product data */fn_set_hook('get_product_data', $product_id, $field_list, $join, $auth, $lang_code, $condition);?>
HINT
コメントは、フックの直前に配置する必要があります。
TPL(テンプレート)フック
Smarty テンプレートの場合
{** Dynamic menu item (on the navigation) *}
{hook name="index:dynamic_menu_item"}
...
{/hook}
{** Hooks for CSS styles *}
{hook name="index:styles"}{/hook}
/** * Hook の説明 */var hook_data = {'append_obj_content': append_obj_content,// int Id of bla bla'var_prefix': prefix,// string Prefix of var'object_html':unescape(append_obj.html()),// string Object'var_id': id,// int ID of var'item_id': js_items[id] // int Item ID};$.ceEvent('trigger','ce.picker_add_js_item', [hook_data]);