D
D
dk-web2015-09-12 11:11:27
JavaScript
dk-web, 2015-09-12 11:11:27

Embedding admin in php MVC?

Brr, unravel, pliz ...
So I did everything according to science).
And how is the admin panel built in with such a concept? Separate "site"? Or a general concept?
So I got something like this...
mysite.ru
mysite.ru/city1
mysite.ru/cityN
mysite.ru/admin? - make this admin a separate directory (as I used to have) and write a separate kernel, controllers, etc. to it. or to build in the general heap? It’s just that then I don’t quite understand right away how to restrict access to this controller and method ... so the usual htaccess and htpasswd are in the directory and everything is clear ...
How "by science then"?)
P.s. well, in order not to produce questions .... it remains to add an auxiliary class (conditional) helper - a certain set of functions that helps in development and is used in many models - various formatting, etc. Is it strong if you connect it and inherit controllers and models from it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stockholm Syndrome, 2019-04-10
@sain_Fa

.thenand they .finallyonly hang handlers and no matter in what order they are called
, callback, which will hang the method .finally, will always be called last

R
Robur, 2019-04-11
@Robur

It's just a heavily simplified version of a promise that doesn't work like the real thing.
Here's what's going on that interests you:

if (this.onFinally) {
                this.thenCbs.forEach(cb => {
                   data = cb(data)
                })
                this.onFinally()
            }

D
Dmitry Sidorenko, 2015-09-12
@dk-web

Here's a great example for you: guide.yii2.org-info.by/guide-en-tutorial-advanced-...

backend - web application of the administrative part. (this is the admin panel)
common - common files for all applications. (common to all)
frontend - user's web application. (this is the site itself)

Instead of an auxiliary class, you can use a ready-made framework, where there are a lot of such classes =)
And you will connect them using namespaces, in addition, only those that are needed in a particular controller or model.
I advise you to familiarize yourself with various frameworks / admins, see how they did it and make it even better :)
Well, here are the popular frameworks for review:
  • Yii2
  • Laravel
  • Symphony
  • zend framework

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question