A
A
Abr_ya2019-08-15 08:36:39
Yii
Abr_ya, 2019-08-15 08:36:39

Is there a "clean" installation of Yii2?

I'm starting to work with this framework. Already like a lot! Questions begin to arise, "how to do it right?", "how to do it better?". And this is one of them.
At the office The site recommends two installation options:

php composer.phar create-project yiisoft/yii2-app-basic basic
php composer.phar create-project yiisoft/yii2-app-advanced advanced

As I understand it, these are two build options for projects of different scales (by the way, if somewhere you can read well about the common-different in these assemblies, I will be grateful!).
I'm currently taking a course that recommends betting like this:
composer require "yiisoft/yii2:*"
Does this approach make sense? Is it correct to use it? What does it give and what do I lose?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
M
Mylistryx, 2019-08-15
@Abr_ya

composer require "yiisoft/yii2:*" - this way you get a really clean install. In fact, you will only have composer.json, composer.lock files and a vendor folder in which the framework itself with dependencies will lie. You will be able to build the structure of your application yourself, i.e. decide for yourself where you will have controllers, models, views, and so on. This can also be changed in pre-made basic/advanced templates.
Now for the templates:
Basic is an example of the organization described above. Typically used for small applications with a single entry point (/web/index.php). There are both advantages and disadvantages (if you do not change the structure). Of the advantages - it's really simpler, there are no duplication of classes, etc. Of the disadvantages - extensibility only by modules, not a very convenient way to store configs (cannot be overridden with local values). All this can of course be easily fixed.
Advanced - such as an extended version. Not everyone needs it. Allows you to organize multiple entry points (frontend and backend by default) and easily add your own. For example, we copy the backend folder, edit the namespaces in it and voila, we have an API that we configure at the config level and it gives us only JSON. It's more comfortable for me, at least. At the same time, all applications can use common components / models / services, etc. from the common folder.
For a better understanding, I recommend watching / reading everything Elisdn has on the blog (the link was given above), it helped me a lot at one time. Well, I recommend that you first familiarize yourself with his course on the service layer. Getting used to AR, etc. it will be hard to move on to something else. For example, I now use several third-party services as data sources, a SOAP service and my own database (and not just one!). Without a service layer, this would be sooo hard to maintain and maintain in the future. And so - I have a service layer, which is a "black box", and what and how it happens inside me, in principle, does not interest me.
There are now several books and tutorials on the internet teaching how to use Yii2, but out of all of them, I recommend Elisdn! 99% of the courses give a general understanding of the framework, but they drive it into a rigid framework, which in my opinion is very bad. Hence the opinion that Yii2 is dying and everything else.

A
Andrey K, 2019-08-15
@kuftachev

Here's the difference.
https://github.com/yiisoft/yii2-app-advanced/blob/...
In general, the point is that advanced is a demonstration of how you can use essentially several different applications, but with common classes. I don't really see what it's for. But from there you can take work with the user account.
PS I join the advice to teach it is no longer relevant at the moment, except when you know another, but offer a good job on it. Choose between Laravel and Symfony, even though they are both terrible.

A
Ankhena, 2018-01-10
@melkaya94

Options:
1. Move the cross outside the popup (possibly with the addition of a background). (Type top: -30px and/or right: -30px. In this case, the block itself must have the appropriate margin so that all this does not crawl out of the window)
2. Set the internal padding of the popup. (padding: 30px 10px 10px)
3. Do not use absolute positioning for the cross, but set it to float right and margin. Then the content will wrap around the cross.
4. Format the text so that it does not fall under the cross. This is only possible if the text is conditionally constant.
(Indentation values ​​are written only for example, choose the real ones yourself)

A
Anton, 2018-01-10
@karminski

As an example. Wrap the text in a div and give it a right padding.
<div style="padding-right:30px;">Ваш текст</div>

A
Andrey, 2018-01-10
@kvaak

Add padding to the right of the content, set a white background to the cross, lower the scrollable area below, here you need to build on the design, there are a lot of ways

S
Sergey ZSA, 2018-01-10
@serjikz

If you do not want to change externally in any way, then just put it in front of "on" . For desktops, hide it with display: none; and for mobile show the opposite. This will be more than enough. <br>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question