-
Notifications
You must be signed in to change notification settings - Fork 27
create custom exception/error handling mechanism #192
Conversation
Feel free to merge, when you like it. You can see the purpose of this PR in the Frontend Test. |
Btw: depending when you want to tag, i will implement both (alternate locale too) in the Sandbox this or next night. Lastest monday Morning in train. |
@wouterj I will leave review with you, ok? just make sure to only merge things that are certain to have no big side effects at this point in the RC phase. |
But if "activated" in an cms with PHPCR it will provide a big help for error pages. And an example to extend it for the use with other persistence implementations. |
break; | ||
} | ||
} | ||
$group = null !== $group ? $group : 'default'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$group = $group ?: 'default';
As said, I don't understand the name "BestMatcher". I also think the 2 current BestMatchers are redundant and one can fullfill the job as good as 2 can. |
We should also have a way to switch of core best matchers imo |
BestMatcher@dbu and i came to that name. They are responsible for computing the best matches for a wrong url or just a typo. Why are ther two?Cause both are doing a different job and are registered separately by a tag. You can add your own matcher and call them what ever you want and let them do what ever you want. Btw: different matchers mean different groups. I would suggest to create a grouped output, like <div>
<ul>
{% for group, matchs in best_matches %}
{% for match in matchs %}
<li>{{ group }} - {{ match.name }}</li>
{% endfor %}
{% endfor %}
</ul>
</div> The presentation model/controller creates an array like that as data for the template. switch core ofYes and No. First the complete behavior is activated, when you add our Controller/Presentation as exception controller in the twig config. Second, the core ones are actived only, when choosing |
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Cmf\Bundle\SeoBundle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this class acts as controller, i would put it in the Controller namespace of our bundle
i would add configuration options for |
maybe we could have just one matcher class here, a ancestor mapper with a limit. to get a parent mapper you would use the ancestor with limit 1 ;-) maybe rather than BestMatcher we could call this thing SuggestionProvider? its giving suggestions what page you might wanted to look at when you hit a 404 page. |
Right it does nothing. But would have head aches with your config example. By enabling/disabling all i would just suppress the loading of a service Definition file, by enabling them as Single services i would have to create them manuallyin the extension class of suppress them in compiler Pass, where i do not have the config. = |
So you would see ancenstors as all children of a common parent? And again we would leave the meaning of grouped providers. By having them separate i you need the constraints: give me an array and a group name. And i pass that to the template. But with different logic in the providers? Maybe a ass. array with identifiers/groups as keys and nested array for the route suggestions? = |
So...
|
* | ||
* @var array|SuggestionProviderInterface[] | ||
*/ | ||
protected $chainOfSuggestions = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestionProviders or suggestionProviderChain?
As this is a huge feature, I'll properbly not make it into 1.2 (which is released this week) |
yeah, rather get it right than rush it in. @lsmith77 also raised the question if this actually belongs into the |
No problem, so i would be the first with a feature for 1.3 g But will finish the open issues here this evening i think. Then it will be your decission where to Merge. |
I would see it in SeoBundle as it is good for both SEO and for UX. Last can infect others to look into the CMF. Especially both SuggestionProvider, which are able to serve content right from the Heart of the CMF. = |
looks sane to me. in conflict with master though. as discussed, lets wait with merging until after the release and bump the version for this one. |
👍 |
this will have to wait for the next release cycle. btw also needs a rebase |
Ok. |
ae3c121
to
2d41743
Compare
spice up tests to see both parent and ancestor little CS fix more CS fixes enabling core matcher/provider rename BestMatcher -> SuggestionProvider move presentation model -> controller, fix last namings (matcher -> suggest provider), fix tests suggestion provider are able to add suggestions to the same group now, lists are merged change name Ancestor -> Sibling for suggestion provider, fix adder for suggestion provider in controller - provider on equal groups are possible now. enable both suggestion provider separately
2d41743
to
9d2e042
Compare
rebased and squashed. Created a 1.1 branch too. So feel free to merge when ok. |
create custom exception/error handling mechanism
cool! @ElectricMaxxx did you do a doc PR as well? if not, can you please open an issue so we don't forget this? undocument features are unlucky... |
done in symfony-cmf/symfony-cmf-docs#606 |
As a follow up from #177
Would like to spice up the frontend test only by adding one more level in the routes/contents created in the FixtureLoader to see both ancestor and parent suggestions.