Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building a Plugin-in

2,096 views

Published on

Learn how to build a plugin-in ProdigyView.

Published in: Technology, Art & Photos
  • Be the first to comment

  • Be the first to like this

Building a Plugin-in

  1. 1. Building A Plug-in
  2. 2. OverviewObjectiveLearn how to build a plugin-in ProdigyView.Requirements Installed version of ProdigyView with a database Understanding of the overview of plug-ins vs applications Understanding of how to install a plug-in Understanding of the DEFINESEstimated Time12 minutes www.prodigyview.com
  3. 3. Follow Along With Code Example1. Download a copy of the example code at www.prodigyview.com/source.2. Install the system in an environment you feel comfortable testing in.3. Proceed to plugins/HelloWorldPlugin.php www.prodigyview.com
  4. 4. Plugin StructureThe structure of a plug-in is very easy to build because a plug-indoes not have a structure. When building a plug-in, all youneed to do is put contents in the entry file specified in theinstallation. Plug-ins can be Procedural Code Objects/Class An add-on to an object/class HTML
  5. 5. HelloWorldPlugin FileLooking into the HelloWorldPlugin file, we have the following:
  6. 6. Procedural FunctionThe function in the file is a straight procedural function. Onceincluded, it can be called anymore in your code.
  7. 7. Extending ValidationThe second part of the plugin is creating an anonymousfunction and adding a custom rule to the PVValidator class. Ifyou are unsure of how this work, reference the tutorial onCustom Validation.
  8. 8. Switch FilesNow to see the plug-in in action, first make sure it isinstalled. Read the tutorial on installing a plug-in if you areare unsure how. Then we can head over to our examplefile.
  9. 9. Plugin ExampleLooking in our plug-in file, we have this.
  10. 10. PVBootstrap::bootSystemCalling the bootSystem method will call another method in thebootstrap called loadPlugins that will include that plug-ins thatare enabled.We also do not want to initialize the validator or it will overwriteour rule.
  11. 11. Calling the Procedural FunctionFirst thing we can test is called the procedural function.And to do that, all we have to do is call it.Remember that because this function is procedural, it is acallable from anymore in the code. Be careful whenmaking many procedural functions in plug-ins becausename conflicts can occur.
  12. 12. Validator Test Our next test is see if our rule was added in the validator. Pass some values in and see if it validates.That’s all there is to plug-ins. Very easy to install and use.
  13. 13. API ReferenceFor a better understanding of plug-ins, visit the api byclicking on the link below.PVPlugins More TutorialsFor more tutorials, please visit:http://www.prodigyview.com/tutorials www.prodigyview.com

×