Following is the process to register/Create service in awesome enterprise:
- nowLocate “Awesome core” which is situated in “Awesome enterprise” wp-admin menu.
- In that Choose – “service” and edit service core.
- Syntax:
-
1234[services.service_nameservice_label='Service Label'post_type='service_post_type'desc='Service Desc' /]
- Example:
-
1[services.add dc_star service_label='DC star' post_type='dc_star' desc='DC star Service' /]
- Here dc_star service is created, with label DC star, post_type = ‘dc star’.
- while calling, service name plays crucial role, hence be specific while declaring service name.
_________________________________________________
Create module and template in Service
- After creating service option will get displayed in wp-admin left side bar option | Service – Awesome Enterprises
- click on your created service, you can recognize your service by service label you mentioned while creating it.
- Now create you own module as per your requirement in that service.
- Remember, service is collection of modules which works in generic operation.
- Such as, you just have to pass json, array or parameters to service and it will perform the action as per coded.
- If any condition to be given to input data, make it possible in calling module.
- Do not emboss service to condition it as then it can not be generalize.
- E.g:
- In dc star service, Module is created as dc_star_module with one array parameter.
- Always create main template after creating module i.e best practice in awesome.
- hence calling dc_star_module will be:
-
1[dc_star.<strong>dc_star_module</strong> args="{template.args}" ]
-
- Same as module, templates can be created in service with in the module
- If template is not defined then awesome will execute main template of called module.
- E.g
- let create add template in dc_star_module
- so while calling add template syntax will change as
-
123[service_name.module_slug.template_slug parameters="" /]<strong>[dc_star.dc_star_module.add args="{template.args}" ]</strong>