Symfony as a helper for Wordpress plugin development

依然范特西╮ 提交于 2020-01-12 22:55:06

问题


I have seen several integrations between wordpress and symfony, but they are made with the goal of managins static pages content inside wordpress and symfony acting as the controller.

Wordpress plugin development api seems really basic and primitive and you have no way o code with the MVC pattern out of the box. So the big question is, what would be an starting point to create plugins in wordpress, and create admin sections in it, but using Symfony power to manage database access, form creation and validation, etc .....


回答1:


I had briefly considered a similar approach for integrating Lithium with WordPress, but ran into a great deal of hurdles that made another approach seem more worthwhile: create an MVC framework that was specifically designed to work inside of WordPress.

It's not yet as full-featured as Symfony, Rails, etc, but WP MVC has similar architecture to the major MVC frameworks and should be easy to pick up if you're familiar with them. It ties in directly with existing WordPress functionality. When you create scaffolding for a resource, for example, the code that's created includes an admin controller and admin views (which look similar to WordPress's native index/add/edit views for posts), as well as the appropriate WordPress routing and a public controller and public index/show views to display the resource on the public side, within the active theme.

There's more info on it on its WordPress Plugins page, and its brief tutorial may make it seem less abstract.



来源:https://stackoverflow.com/questions/7437815/symfony-as-a-helper-for-wordpress-plugin-development

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