W
W
wolf-98302017-04-30 20:59:21
symfony
wolf-9830, 2017-04-30 20:59:21

How to write your own functionality within one Bundle?

Task:
The entire functionality of the application is based on tabs between which the user switches (Menu, Settings, information, etc.). I really want to squeeze out a beautiful solution within one Bundle on the simfony framework, but I have little experience in this framework, so I can’t organize the code.
Suggested solution:
I want to create a Tab class with the necessary properties (link, activity, inscription, etc.) and a TabStack class that will contain an array of Tab objects and a register method. Register tabs in SourceBundle.php so that when switching to each controller, these tabs appear on the page (they will be displayed in the main Bundl template). But I don’t quite understand in which Bundl directory you can store the code that implements the functionality.
Can you develop my idea? Or are there better and more flexible offers?
PS
I make the application for my own purposes as part of the training.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Pavlov, 2017-05-04
@lexxpavlov

What's the problem? Well thought out. Place the Tab and TabStack classes in the Tab folder, make TabStack a service, use it in the controller (or in the template).
> and the register method. Register tabs in SourceBundle.php
Why register? so that different tabs appear in different controllers? I would think about tab tags - each tab has specific tags that indicate where to use them. And in the controller get by tags.
How many tabs do you have?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question