Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!