Answer the question
In order to leave comments, you need to log in
URL in MVC. Is it necessary?
I recently got acquainted with the MVC scheme and immediately thought about the possibility of applying the approach in my project.
But there is a point that I don't understand. For example, I have articles on my site. As I see the URL of the article:
mysite.ru/articles/cat_name/article_name.html
(that is, the principle is the same as in the file system)
But for example, the address for adding an article:
mysite.ru/articles?add
According to the MVC concept, I should use addresses:
mysite.ru/articles/show/cat/cat_name/article/artic...
mysite.ru/articles/add
But I am absolutely sure that the first address is a specific enumeration. But if I make the addresses the way I see them, then the controller/action/parameter/value principle doesn't work. It is so?
How to be in that case? Maybe the MVC scheme just doesn't suit me?
Answer the question
In order to leave comments, you need to log in
If there is no pre-designed adaptability or change in transparency on hover, then what prevents you from using these illustrations just as a background, where to place text blocks? When reducing the screen width, move the background to the appropriate side so that it is darkened and center the text block.
my blind
point blank in this picture I don’t see inclined stripes
, would you give a link to the original or something
What is this article you read that now you are interfering with url concepts with mvc? Can I get a link?) And where is Roskomnadzor looking ...
But seriously, usually applications use a router in which you manually map any arbitrary path pattern to any controller.
MVC as a pattern does not set the url scheme at all, MVC may not be for the web at all.
Specific implementations may use one or another scheme for url, but this is the choice of the authors of these implementations and has nothing to do with the pattern itself.
According to your opinion, this is not suitable, since you have to take care of the robots of Yandex
and
Google
--.html this is where it didn't go
Also if a user or a robot opens pages
mysite.ru/<category name>/<subcategory>
It should see content here
mysite.ru/<category name>
here
With this structure
mysite.ru /articles/show/cat/cat_name/article/artic...
The user and the robot will not see the content
of mysite.ru/articles/show/cat/cat_name/article/ here will not see
mysite.ru/articles/show/cat/cat_name / we'll show something here.
mysite.ru/articles/show/cat/ there is no content here but there should be
mysite.ru/articles/show/ and there is no content here either.
As a rule, there should not be empty directories.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question