Skip to content

Instantly share code, notes, and snippets.

@GreatPotato
Created April 13, 2018 12:55
Show Gist options
  • Save GreatPotato/2bc626fa203cf604bc98045eb00ff9e1 to your computer and use it in GitHub Desktop.
Save GreatPotato/2bc626fa203cf604bc98045eb00ff9e1 to your computer and use it in GitHub Desktop.
<?php
class MyModule_Module extends Core_ModuleBase
{
protected function createModuleInfo()
{
return new Core_ModuleInfo(
'MyModule',
'Whatever...',
'Aaron Hodges'
);
}
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onExtendCustomerModel', $this, 'extend_customer_model');
}
public function extend_customer_model()
{
$customer->define_column('phone', 'Phone')->validation()>required('Please specify a phone number')->fn('trim');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment