[wp-hackers] Plugin developer "toolbox"
Michael Van Winkle
mike at mikevanwinkle.com
Thu Mar 24 14:55:17 UTC 2011
Chris, just FYI, you might take a look at PodsCMS. It's a framework that
does a lot of this already. http://www.podscms.org/
And the WPDB handles most table interaction fairly well. Though I don't
believe there's a method for creating / dumping tables.
Also, I think Scribu has a set of tools but I haven't used it.
Mike
On Thu, Mar 24, 2011 at 9:49 AM, Chris Taylor - stillbreathing.co.uk <
mrwiblog at gmail.com> wrote:
> Hi all,
>
> I've just started on a new plugin called WP IDE which will provide
> option for creating plugins within WordPress using a
> syntax-highlighted editor, and other features associated with desktop
> IDEs. The IDE will contain a form to generate the basic code for a
> general-purpose plugin, including creating classes with custom
> database tables and all the CRUD code, empty admin screens etc. As
> part of that development I'm creating a "toolbox" of classes that will
> help me to create plugins more easily. So far I've started work on:
>
> 1) A FormBuilder class: allows you to create forms with fieldsets and
> form elements, then generate the HTML for those. This class will also
> handle HTML5 form elements, and will warn about non-standard
> attributes. [1]
>
> 2) A Pagination class: allows you to paginate items
>
> 3) A DataTable class: allows you to create tables of data easily [2]
>
> 4) A PluginOptions class: allows you to save options for a plugin
> easily, enforcing rules about the data saved
>
> I have a few questions. Firstly is there anything like this already
> available. Secondly, while I'll no doubt think of other "tools" that
> will make my plugin development easier in the future, what could you
> add to this list? Thirdly, do any of you have other methods, code
> libraries etc to help you stop writing boilerplate code?
>
> WordPress provides a lot of functions to make a lot of writing a
> plugin easier (user management, database access etc) but a set of
> classes like this may be useful to many of us.
>
> regards,
>
> Chris
>
> [1] Some example code:
>
> $form = new FormBuilder("myform");
> $fieldset1 = new FormGroup("fieldset1", "cssclass1");
> $username = new FormItem("text", "username", "Enter your username");
> $fieldset1->addItem($username);
> $fieldset2 = new FormGroup("fieldset2", "cssclass2");
> $password = new FormItem("password", "password", "Enter your password");
> $fieldset2->addItem($password);
> $form->addGroup($fieldset1);
> $form->addGroup($fieldset2);
> $form->paged = true;
> echo $form->getHTML();
>
> [2] I did something like this a long while ago:
> http://www.stillbreathing.co.uk/experiments/datatable/
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
Mike Van Winkle
708-289-3136
mike at mikevanwinkle.com
http://www.mikevanwinkle.com
http://www.twitter.com/mpvanwinkle
http://www.facebook.com/mpvanwinkle
"All excellent things are as difficult as they are rare." -Spinoza
More information about the wp-hackers
mailing list