Where do you place your custom entry point definitions?

眉间皱痕 提交于 2019-12-11 06:37:50

问题


I add all my custom entrypoints in this file: \custom\Extension\application\Ext\EntryPointRegistry\customEntryPoint.php

Is there a better way or place to handle this?


回答1:


Your location is the recommended location as per the 6.5 documentation. All of the files within custom/Extension/application/Ext/EntryPointRegistry/ are compiled into the file custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php when a Quick Repair and Rebuild is done.

As you've tagged this with SuiteCRM, I assume you're using their fork of the 6.5 CE. However, if you want to use your code with later versions (7.7+) of SugarCRM, take note that they have noted their intention to deprecate Entry Points in the near future in favour of extending "Endpoints" for their REST API (v10).




回答2:


That is the best way to handle your custom entry points.




回答3:


There are two best-practice options that utilize the Extension framework in SugarCRM 6.x. Which to use depends on the use of the entry point. The entry point you've specified is best general-purpose, application-wide entry points.

  • File Location: custom/Extension/application/Ext/EntryPointRegistry/customEntryPoint.php

  • Provides for an entry point URL like index.php?entryPoint=customEntryPoint

If instead you find that an entry point could be more focused to a single Sugar module, you can make it module-specific. An example use case might be creating a webhook-type functionality to allow a third party payment service to interact directly with a custom Invoice module. The advantage here is organization; custom code placement is as specific and granular as possible.

  • File Location: custom/Extension/modules/abc_InvoiceModule/Ext/EntryPointRegistry/third_party_webhook.php
  • Provides for an entry point URL like index.php?module=abc_InvoiceModule&entryPoint=third_party_webhook


来源:https://stackoverflow.com/questions/43489844/where-do-you-place-your-custom-entry-point-definitions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!