Questions tagged [yii-routing]

Routing in Yii Framework's MVC implementation. Yii is a free, open source PHP web application framework, and it is released under the New BSD License.

yii-routing is a tag suitable for any questions regarding routing in Yii's MVC implementation, url handling, or any other matter affecting or affected by routing in Yii.

43 questions
0
votes
0 answers

How To Access The Action Within Controller

I have a default controller named SiteController with some actions in it like: -index -aboutcompany When I open my site in browser like: localhost/lucky The index action is working properly. On index.php (view) i made a link: echo…
Lalitesh Upadhyaya
  • 311
  • 1
  • 4
  • 14
0
votes
2 answers

Yii can't route module's url

I have a Yii project, with some modules. One of them is called facebook. We will use this, to manage our facebook app, but I have some trouble with the routing. I have the following route saved, and it works only without extra…
seniorpreacher
  • 666
  • 2
  • 11
  • 31
0
votes
1 answer

Yii dataProvider theme main.php

In my SiteController.php public function actionIndex() { // renders the view file 'protected/views/site/index.php' // using the default layout 'protected/views/layouts/main.php' //$this->render('index'); $dataProviderUser=new…
K213
  • 311
  • 6
  • 19
0
votes
3 answers

Error on rendering yii view

The following URL part works as expected on my Windows WAMP machine (running using AMPPS), but fails on the Linux production host: index.php?r=customchocolates/index I get the following error: Unable to resolve the request…
Mina
  • 610
  • 7
  • 21
0
votes
1 answer

Yii routing when using multiple modules

We recently reinstalled our production server, where we have a Yii project running with multiple modules. The routing part was working well before the re-installation. We checked the Nginx configs several times for problems, but everything looks…
seniorpreacher
  • 666
  • 2
  • 11
  • 31
0
votes
1 answer

Make a controller indexcontroller in yii

I am planning to make a blog in yii. I have a table named article and its corresponding model,view,contoller is generated using gii. I want the posts to be displayed in the home page so I set defaultController='article' Although posts are…
0
votes
2 answers

How to write a URL rule in Yii framework?

title, array(Yii::app()->createUrl('forum/thread', array('id'=>$value->thread_id)))); ?> i got a link forum/thread/2 in my urlManager rules 'thread/' => 'forum/thread', how to change the rule and method…
Dima
  • 7
  • 5
0
votes
1 answer

Yii - Dynamically Loading a Controller

I have had a good play around with the Yii Framework and now I want to take it a bit deeper and what I want to do is set up an application where several different URLs would point to the same controller. Normally domain.com/content will point to…
mr mojo risin
  • 555
  • 4
  • 15
0
votes
1 answer

Disabling a controller page from being viewed

I am an absolute newbie in the world of Yii and MVC. My question is : Say if I have made a CRUD of some model and I have modified the "_form.php" partial to be used from some place else, for example a comment form which is used from the "post" view,…
Sankalp Singha
  • 4,461
  • 5
  • 39
  • 58
0
votes
1 answer

Is there a way to write a URL rule in Yii to redirect all requests to non-existing controllers to an existing one?

I need to be able to access user profiles via www.website.com/username. I have no idea how to write a rule for the rule manager to work this way. I would have a UserProfile controller to which i would like the first parameter of the url to be…
Keeper Hood
  • 594
  • 5
  • 17
0
votes
1 answer

PHP views relate controllers

I would like to implement controllers that connect to any specific views like MVC does. I'm not using any framework that provided in PHP. So, I need some guide and advice on doing it. I have some controllers and views. For my views,i would like to…
Nich
  • 1,112
  • 1
  • 14
  • 29
-1
votes
2 answers

Calling unknown method: yii\web\UrlManager::addRules()

I have worked in Yii 1 and now trying to use Yii2. I have installed composer and then installed basic app. But now I am getting this error when I try to access the basic app. How can I solve this issue? Error is: Unknown Method –…
Awais Mustafa
  • 151
  • 2
  • 9
-2
votes
1 answer

Change file to correct URL in Yii framework

Index path of my yii application is "site.com/www/index.php". How to write htaccess file to open my application by url: "site.com" ?
1 2
3