We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How created models and controllers in multi-modules site

Hi All,

I try to develop multi-module site with frontend and backend module

Initially I created project starting command in Pholcon Development Tool (see https://forum.phalcon.io/discussion/2408/two-different-themes-for-admin-and-front-side-of-site):

phalcon create-project store —type=modules and got next structure

  • .phalcon
  • apps
  • /frondend
  • //config
  • //controllers
  • //models
  • //views
  • /Module.php
  • config
  • nbproject
  • public
  • .htaccess
  • index.html

After that I manually created

  • /backend
  • //config
  • //controllers
  • //models
  • //views
  • /Module.php

and added in apps directory.

I have two question I don’t find in —help command:

How I can create right module for instant with name “admin” but phalcon dev tool generate only “frontend” module.

How I can create model in necessary directory (choose right module). When I start command phalcon create-model --name=users --doc model created in /backend but I need in /frontend, how can I choose it. I use Phalcon DevTools (1.3.1) .

With best regards, Alexey



43.9k
Accepted
answer
edited Jun '14

maybe, while invoking "phalcon model" command, use the

--modelsDir=apps/backend/models

(or something like that) switch



2.4k

Hi le51, Thank you for you unswer.

When I try command

phalcon scaffold --help

I get message unknown command.

Controller also created only in backend module.

With best regards, Alexey



2.4k

Hi,

Anybody know about devision?

Alexey