N
N
Nikita Gusakov2013-03-12 01:37:13
symfony
Nikita Gusakov, 2013-03-12 01:37:13

How to create a Symfony2 application?

Perhaps a strange question, comes from the lack of experience in using frameworks. Generally.
As I understand it, symfony has such an entity as an application, there are bundles, components.
If you imagine a regular site - there are two applications - admin + site.
We don’t touch the bundles yet, the components - you just need to create an application, there is a component - the console. However, how to use it if the application is not installed? Is it really impossible to assemble by hand, without symfony/framework-standard-edition?
If you need to create it this way - how to create two applications correctly so that they do not conflict + symfony is not downloaded twice.
Now composer.json looks like this:

{<br>
    "require" : {<br>
        "php"                : ">=5.3.3",<br>
        "symfony/symfony"    : ">=2.2",<br>
        "twig/twig"          : ">=1.8"<br>
    },<br>
    "minimum-stability": "dev",<br>
    "extra": {<br>
        "symfony-app-dir": "app",<br>
        "symfony-web-dir": "web",<br>
        "symfony-assets-install": "symlink"<br>
    }<br>
}<br>

Also, a question about routing, before reading the documentation, I had the idea that all pages are in the database, it is indicated by which route they are available, that is, /contacts or /catalog and the page type is indicated - material (contacts) or module (users or catalog) . If the module - further generation is transferred to the module. Here, all routing is written in yaml/xml/php - hence the question, to break the idea of ​​​​routing logic, or is it possible to implement it dynamically? .. The main question is how to edit symfony-style routing from the admin panel to the end user.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Romanenko, 2013-03-12
@slimus

You seem to be confused about the definitions. Admin + site is all accessing the same database? If so, make 2 bundles (Acme\AdminBundle, Acme\SiteBundle) and spread the logic there.
As for the routes, the question is also not entirely clear. Want to store in the database - please. Symphony 2.x has routing files where all paths are specified. In the simplest case, it will suffice to describe there.

A
Anton, 2013-03-12
@sHinE

Not all questions, of course, the answer but still.
A bundle is a part of the system that can be taken and completely transferred to another site. Those. some fairly isolated functionality - like on knpbundles.com Therefore, the site can generally be one bundle if you have a self-written admin panel, and not on some kind of bundle generator.
Regarding routing, it is important for you to understand that routes do not point directly to pages in the database, but to controllers that can already take something from the database, or maybe not. Answering your question regarding dynamically set routes by the user, it is possible: the controller will catch everything after / and determine by this value what should be output from the database.
I can’t say about the relevance at the moment (although it is unlikely that something has fundamentally changed) - there is such a tutorial in English tutorial.symblog.co.uk/ on creating a blog.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question