As programmers we often hear that proverb
that says "don't try to reinvent the wheel", it is surely something
that comes to mind when your customers ask you to create a website for your
company and they say "I want something like WordPress". Yes, many of
us have been through that and have been at that crossroads of «Should I simply
use WordPress and adapt a template to the needs of the client? Should I spend a
little more time developing an application from scratch with Laravel? Well,
today we will give a solution to this problem, using the best of these two
tools, WordPress CMS and Laravel's simplicity to generate a website.
Combining wordpress with other frameworks
will allow you to easily shoot yourself in the foot. If all your customers want
is an editor, then you can just use tinymce without dragging the whole
WordPress into it, but if they come after the workflow and flexibility, then it
will be pointless to try to make WordPress what it is not. You are more likely
to spend more time than you expect from development, and even then produce
something that will not fully satisfy your customers. Therefore, it would be
good to use Laravel individually to reap ultimate e-commerce package benefits.
The point is in WordPress, although it does
not have a clear routing system, in principle, it performs the same operation.
It takes a URL and maps it to a set of query variables. The good thing is that
he uses regular expressions for these not-quite routes and there are many of
them . The total number of rules ranges from about a hundred minimum to
thousands for a complex site.
This system is quite possible to replace
(probably it will not be particularly clean, bordering on a crazy hack from the
point of view of WP). The main task is that you have to spend a lot of effort
on the parity of characteristics, that is, your router does not violate 90% of
the things that "just work" in WP. If you are not worried about the
function paradigm, you can very well just make a small subset of them and
ignore the rest.
Any advantage of using only wordpress for
the site, rather than using an external structure for it? Is there a way to
connect the Laravel routing system using the WordPress rewriting system?
When approaching it this way, it was easier
for me to think of the WP administration area as a more structured content
repository and fewer page management CMS. Many other WP plugins will not work
too well, as many produce output. You will either have to figure out a way to
get this output, or print it yourself, or create your own functionality.
But you will have two applications for
support. In my case, at least it really made sense only if you were going to
create several websites or applications that were all downloaded from the WP
content repository.
Do you think this would be a good approach
to this?
Yes, if it requires an application or
domain. I really enjoyed using my own routing and views, and even more so
control. And I didn’t have to touch any WP text code, which is a huge bonus.
Any advantage of using only WordPress for
the site, rather than using an external structure for it?
Absolutely one application for support and
much less code for writing. All routing is built into WP. But you are stuck
with how WP routes things unless you delve into its rewriting mechanism and
crack it, which can ruin other plugins that you can run.
Insightful informative blog.
ReplyDeleteHelpful and creative.
Thanks for sharing.
Looking forward for reading more...
Web design in Abu Dhabi