Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

198
Visualizações
How to combine Phaclon\Mvc\Application and Phaclon\Mvc\Micro in one project?

Structure of my project:

├── apps
│   ├── backend <= Micro
│   └── frontend <= Application
├── public
│   ├── css
│   ├── index.php <= Single entry point
│   └── js
└── vendor
    ├── ...

Note: I dont want use two entry point, something like this:

├── apps
│   ├── ...
├── www
│   ├── css
│   ├── index.php <= Entry point for Frontend
│   └── js
├── api
│   ├── index.php <= <= Entry point for Backend

It is still a spare option.

Question:

  1. Tell me where I can see example of such project?
  2. If chosen way of organizing the project is wrong, what is correct one?

In both cases, I would like to get an example code for the following files:

public/index.php // or www/index.php & api/public.php
apps/forntend/Module.php // or something similar
apps/backend/Module.php // or something similar

and how I should organize work with routes, dispatcher, etc.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Why combine them? Just use Phalcon\Mvc\Application alone. Micro doesn't even have dispatcher, modules etc. Phalcon\Mvc\Micro is seperated thing and it shouldn't be used in same application where Phalcon\Mvc\Application.

What exactly you want to achieve?

over 4 years ago · Santiago Trujillo Relatório

0

You can employ different solutions for this. Yes you can do @Juri wrote for sure but if you want your API/Backend to be as slim as possible, then you can use the Micro application.

The trick is to have an abstract bootstrap class which performs all of your initializations (including the application object) and override this with the relevant bootstrap classes for frontend, backend, cli etc.

Have a look at the Phalcon website implementation, in particular the Bootstrap class on how you can achieve this.

The implementation is explained in length in these posts:

https://blog.phalconphp.com/post/building-the-new-phalcon-website-implementation-part-1 https://blog.phalconphp.com/post/building-the-new-phalcon-website-bootstrap-part-2 https://blog.phalconphp.com/post/building-the-new-phalcon-website-middleware-part-3

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda