Editing Extensions and Widgets Creation
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
'''Basic Provisions:''' | '''Basic Provisions:''' | ||
# All extensions must be placed in separate folder. | # 1. All extensions must be placed in separate folder. | ||
# The class file name must be the same as the folder name. | # 2. The class file name must be the same as the folder name. | ||
# Templates must be placed in folder 'views'. | # 3. Templates must be placed in folder 'views'. | ||
//additional | //additional | ||
if you want to use widgets in extensions | if you want to use widgets in extensions | ||
1. Add method getWidgets with $type parameter and describe widgets in array | 1. Add method getWidgets with $type parameter and describe widgets in array | ||
example: | example: | ||
return [ | return [ | ||
Line 25: | Line 21: | ||
in this case ShoppingCart (in subfolder \ShoppingCart) is widget ( ShoppingCart.php) can be used in customizing Themes | in this case ShoppingCart (in subfolder \ShoppingCart) is widget ( ShoppingCart.php) can be used in customizing Themes | ||
2. to show additional settings for widget use method showSettings | 2. to show additional settings for widget use method showSettings | ||
example: | example: | ||
Line 37: | Line 31: | ||
extension installer: | extension installer: | ||
1) extends \common\classes\modules\ModuleExtensions | 1) extends \common\classes\modules\ModuleExtensions | ||
2) install (example) | 2) install (example) | ||