// +---------------------------------------------------------------------- namespace crmeb\services\easywechat\wechatTemplate; use EasyWeChat\Core\AccessToken; use Pimple\Container; use Pimple\ServiceProviderInterface; class ServiceProvider implements ServiceProviderInterface { public function register(Container $pimple) { $pimple['wechat.access_token'] = function ($pimple) { return new AccessToken( $pimple['config']['app_id'], $pimple['config']['secret'], $pimple['cache'] ); }; $pimple['new_notice'] = function ($pimple) { return new ProgramTemplate($pimple['wechat.access_token']); }; } }