Questions tagged [yii-url-manager]

The management of URL-addresses in web applications in the Yii framework.

The management of URL-addresses in web applications in the (Yii) framework. It involves two aspects:

  • The application needs to parse the query the user enters in the form of URL, for individual parameters;
  • The application must provide a method for forming address URL, with which it will work correctly.

In the Yii applications these problems are solved using a class CUrlManager.

The project API docs: http://www.yiiframework.com/doc/guide/1.1/en/topics.url

216 questions
3
votes
1 answer

How to setup Yii2 module on subdomain correctly?

I have a project on Yii2 advances app. And I have created a module named 'sale' on front end, Where I have extended layouts of frontend. And now I just want to access that module as a subdomain like http://sale.example.com . I have created…
Anil Chaudhari
  • 801
  • 14
  • 30
3
votes
1 answer

Yii 1: UrlManager does not call the correct action in module controller

i am creating an API module in an application and i have to set some rules in urlManager, however when i set a single rule and test it if it's working, it calls the index action instead of the desired action. in Controller
Oscar Reyes
  • 4,223
  • 8
  • 41
  • 75
3
votes
1 answer

Yii2 url routing to get a string parameter

I have a url like this http://localhost/yii2/category/my-custom-string-parameter I need to get the text my-custom-string-parameter And I setup the rules like this 'urlManager' => [ 'class' => 'yii\web\UrlManager', …
adeade
  • 317
  • 5
  • 12
3
votes
1 answer

YII2 urlManager rule with unlimited GET parameters

In YII2, how do we write a urlManager rule for any controller/action to accept any number of get parameters. I have tried //* but it didn't work. I am getting 404 page. Any help is appreciated
3
votes
2 answers

yii2 url managment/ correct registration of css and js files in a view

I've urlmanager turned on, and probably because of this fact I cannot register css and js fiels properly. when I add $this->registerCssFile('views/A_view/A.css'); my file is attached
David
  • 4,332
  • 13
  • 54
  • 93
3
votes
3 answers

Getting error Invalid Call – yii\base\InvalidCallException when customizing urlManager component in Yii 2

I have set up the Yii 2 basic app and under config/web.php I use: urlManager' => [ 'class' => 'yii\web\UrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, ] under components. But when I…
ishtiaq ahmed
  • 485
  • 5
  • 9
3
votes
3 answers

seo friendly urls in YII framework with id and name

I've been searching all around Stackoverflow and YII forums, there are many answers, which didn't help me... This is my case. I have controller called: proj and an action called view. It gets: id(int), name(string). The desired name gets sometimes…
Michael Kisilenko
  • 491
  • 2
  • 6
  • 15
2
votes
1 answer

How to create clean url for Default page in Yii2 urlManager

My index rules like as below: [ 'pattern' => 'page/', 'route' => 'site/index', ], it work, but in pagination, firest page is example/page/1, i change rules as below: [ 'pattern' => 'page/', 'route' =>…
Masoud92m
  • 602
  • 1
  • 8
  • 24
2
votes
1 answer

Yii2 rest api - Url manager add parameters

I am working on an api that has 4 levels of users. Admin, reseller, channel and customer. All levels have call rates stored in respective _rate tables. Admin can view rates for all user levels, resellers can view their own rates and all of their…
Kyle
  • 667
  • 6
  • 28
2
votes
3 answers

Yii2: how to redirect old URLs with 301?

I have some URLs from the old version of my site that I want to redirect to their new ones in Yii2 due to SEO purposes, eg. /about-us.php to /about. How do I do that? I can't use .htaccess, and I can't use urlManager rules because HTTP response…
TheStoryCoder
  • 3,403
  • 6
  • 34
  • 64
2
votes
2 answers

Yii2 Rest URL Routing for Regular Controllers

How is it possible to extend yii\rest\UrlRule in a way I can rewrite rules for actions of a controller? For example, I want to generate the following URIs: /user/[username] /user/keywords /user/keyword/[key1]/[key2]/[...] ... Every above actions…
Hamid Ghorashi
  • 1,003
  • 3
  • 14
  • 29
2
votes
1 answer

Yii2 url manager don't parse urls with get parameter

I've created a module named catalogue with, for the moment, two actions in the default controller: actionIndex actionLineProducts in the index view I have some link which run the line-product's action, the url was the result…
MarBer
  • 535
  • 1
  • 5
  • 22
2
votes
0 answers

Yii2 UrlManager route a file name

I have the following rule in my UrlManager: 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'cache' => null, 'rules' => [ 'classic_articles/' =>…
ahervin
  • 461
  • 2
  • 15
2
votes
1 answer

Yiii2 subdomain in url manager not working

I have a Yii2 advanced project. I have MyCompanyController.php in the frontend controllers and I want to add a subdomain to this controller so I did this : 'urlManager' => [ 'rules' => [ '/' => 'site/index', …
Amir Mohsen
  • 853
  • 2
  • 9
  • 23
2
votes
3 answers

Multiple Variables to be passed in URL - Yii2

I want to generate URL's that can handle multiple parameters as follows. www.mysite.com/index.php/controller/param1/param2/param3/param4/mySlug But still be able to be flexible and pass over less…
ahervin
  • 461
  • 2
  • 15
1
2
3
14 15