This topic is locked
[SOLVED]

 Help Creating New Plugin Control

3/4/2013 9:00:00 AM
PHPRunner General questions
W
wildwally author

I have a need for a month picker and have found a jquery version on the web for use at this site. The download contents only include a single js file. I've created a folder in the PHPRunnerplugin/edit folder called MonthPicker and inserted the js file. I've also created a php.file called monthpicker.php which contains thecode

$this->pageObject->AddJSFile("jquery.mtz.monthpicker.js");


I've gone into PHPRunner and the control shows up in the list but when i try to load the page to test i get this error Fatal error: Class 'EditMonthPicker' not found. Reading the instruction on how to create a plugin it says changes need to be made in the file, but i have no idea what those changes need to be. Any help would be appreciated.

Sergey Kornilov admin 3/4/2013

As a first step you need to check the tutorial at http://xlinesoft.com/blog/2012/09/07/how-to-create-your-own-edit-control-plugin/ that explains how Edit plugins work and how to create your own. Then study ColorPicker or SignaturePad edit plugins that come with PHPRunner to see what naming conventions are, what class names and file names conventions are.
The error message means that expected PHP class name wasn't found.

W
wildwally author 3/4/2013

I've read through the provided instructions and examples and still having difficulty understanding whats taking place, maybe because i'm dealing with other work and i'm not sure whats happening with it.
Just so I'm understanding a little more - I've cleared the error I had. I noticed i didn't have the class in the PHP file. THe page loads with no errors but the field is not present. So I'm still missing something but think I'm getting closer.
Now I've included and pointed the site to the js file. Reading through the documentation I'm assuming I still need another js file to initiate the control - referencing the example its called the constructor. What I'm not seeing and I could be overlooking it is in the example of the color picker whats calling the EditColorPicker.js file that contains the constructor?

W
wildwally author 3/4/2013

Ok, I read it many more time and evaluated what was done with the color picker and then read things again. For some reason what i was reading wasn't sinking in as you providing a step by step instructions. The last time i read it through the whole thing with no interuptions or jumping to other pages and it sank in. I'm dense at times - wife probally says more time than others lol.
Anyway I was able to get it to work.
Thanks - this opens up all kinds of opprotunities to get myself in more trouble.

Sergey Kornilov admin 3/4/2013

Thanks for the update.
Just wanted to add that in couple of weeks we'll launch a marketplace where developers can sell plugins they developed. The time you have spent learning plugins internal working may pay for itself many times over.