Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda