As a backend, SonataAdminBundle is used. Implemented:
1. Admin panel (WYSIWYG, ckeditor), image/audio uploading, player.
2. Tags, categories, archives, tag cloud
4. RSS-feed (requires modification)
5. "Smart" caching of everything, content is served very fast
To "ease the soul":
Repeatedly had to work with a list of dates on php (by days, for example) if there is a start and end of the period ($dateStart, $dateEnd). For example, to synchronize working/non-working days for the DatePicker from jQueryUi with the backend. Or if you need to display reports by days.
I suggest several options for solving this problem, both the most obvious way and a more elegant way (as it seemed to me).
Widgets Bundle - a bundle for easy widgets management. (Supports only widgets which require only client-side code for displaying). Includes both client side (for displaying) and admin side (adds admin classes and has a SonataAdminBundle dependency) functionality.
Can be used (for example) for adding counters, banners, advertising network codes (google adsense, etc).
Was created during this blog has been developing.
During developing this blog I invented one more bicycle for Caching Symfony controller. But first of all lets see how did this task arose.
For example, I have a list of categories, archives and tags on a sidebar. It is relatively easy to get last one (one query), but much harder to get list of categories and archives. For getting categories, we need to select trees (categories can be nested) and using subqueries inside queries get number of articles in every category (result is a little bit monster). For getting the archives list, we need iterate over all articles and gather list of years/months. All this actions isn't very sophisticated, but it is better to avoid them.
Can be installed as a firefox plugin or as a standalone application (in this case, firefox was installed as a dependency).
Convenient for quickly creating a website page schema, so as not to draw on paper. It also allows you to add interactivity by linking pages. A simple and fast learning tool.
We will explain the installation and show an example of use.
When developing a medium to large project, there is a problem with localizing numeric/money data. In this note, I will talk about the difficulties of using the Symfony framework, Sonata Admin Bundle, and the client-side. But first, let's discuss the essence of the problem, as it is not very obvious at first glance.
About design patterns, all programmers have heard. Although... Based on the number of jokes about php developers and seeing some pieces of code, maybe some of them (php developers) have no idea what it is.
The simplest way to customize the login form in FOSUserBundle is to use the mechanism of bundle inheritance. (Assuming that in the future it will be necessary to modify not only the login form). Let's show an example of such customization using bootstrap.
Fixtures (Eng. fixtures) - a very useful development tool. Essentially, it is just a set of test data used in dev mode. They are typically not used in prod mode (for production, Data Migrations are usually used).
There are several convenient bundles for working with fixtures in Symfony. The first one is the basic DoctrineFixturesBundle, which is dedicated to this article.
When creating a bundle, it is useful to configure it, which will be used as a library (and not only).
Of course, you can put everything in parameters, thus avoiding configuration, but that would not be kosher. =)
Proper practice is to describe the configuration in config.yml, and to extract some necessary parameters into parameters.yml:
Recently, I discovered for myself that apart from writing code and learning new technologies/using external APIs, there are things that are much more challenging.
These are things that need to be understood when developing medium to large projects. But even for relatively small projects, this is important.
In the Symfony framework, there is an interesting system of bundle inheritance. It is interesting because it works like object-oriented inheritance, but in reverse. When a bundle is inherited, modifications also affect the parent bundle. This is very convenient: if you don't like a certain component or you want to extend/replace its implementation, you can use the mechanism of bundle inheritance without modifying the parent bundle. However, when using the parent bundle, the new functionality will be used.
OOP in this Ruby of yours is quite different from OOP in our proletarian php =). For example, let's take something as trivial as class fields. Despite the fact that methods are encapsulated, fields are not. (In other words, access modifiers cannot be applied to fields). All fields are protected.