O
O
Outsider V.2015-04-09 22:33:09
css
Outsider V., 2015-04-09 22:33:09

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

6 answer(s)
A
AskJs, 2018-03-20
@MegaPuxapb

jsfiddle.net/zwXaf/2
jsfiddle.net/alfinpaul/5a7rhh0L/940

V
Vladimir Varlamov, 2018-03-20
@bes_internal

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.

D
Dmitry, 2018-03-20
@demon416nds

my blind
point blank in this picture I don’t see inclined stripes
, would you give a link to the original or something

T
Timofey, 2015-04-10
@Audiophile

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.

D
Dmitry, 2015-04-09
@dxp

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.

A
Alexander N++, 2015-04-09
@sanchezzzhak

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 question

Ask a Question

731 491 924 answers to any question