Hi guys, I code follwong link in anyonymous function,which should transfer to another CRUD in another folder with another Controller. What I actually get will be shown up in attachement_0. As U can see there,this GridView is a mixture of both tables. I want to get content of just one table,as u can see in attachement_1
The only way to get a valid url is definig it as string, but thiswill render both models as explained above Problem is not link,'cause after loading page again,pushing return in browser url strip, script will be loaded propably. Return value won’t load script propably(look at my thumbnails attached[size=“3”]…[/size])
I may be wrong, but you seem to have got the url manager config completely messed up.
Would you please show us your config for ‘urlManager’?
'components' => [
...
'urlManager' => [
'enablePrettyUrl' => true,
'rules' => [
... what rules do you have ? ...
],
'showScriptName' => false, // do you have this line?
],
...
I have a lot of rules,in frontend as well as in backend. My link problem has nothing to do with rules, 'cause I principally can see all sites necessary. Here is my config:
I believe he is expecting the page to look like shot #1, but when he clicks on the link it display content shown shot #2. I think it is more related to the layout/view problem.
You are using a relative url in string format for the 2nd parameter of Html::a(), but you should use a route in array format for it.
Generally speaking, we should not use a url in string format to render a link, unless it point to an external url. All the internal links in the app should be constructed using routes.
This will not work! I already explained, that I am using prettyUrl=> true. Furthermore, I published all my Urlmanager rules. So, if I code as U suggested, following url will be created:
[/b]Please note, that script being loaded by link is in another folder, using another controller/model. The only common ground is application in frontend
For upper reasons, following code of umneeq (see above) already had to be discarded:
I already know this guide.i’ve read it month ago defining url-rules in manager. Nevertheless, if I coded defining url as an array in 2nd parameter of a-Tag…
This will give me the same result compared with defining url as string
I will get content of table dateianhang, but header is of table bewerber. Look at attachement,please (view_link_0.jpg)
[size="2"]I have to reload script manually in Browser in order to get content and header propably(view link_1.jpg) [/size]
As it seems,link being defined in anonymous function won’t load whole script, just content of table dateianhang is shown up. Setting link outside of Gridview will load script as it should be…
This is [color="#212121"][font="inherit"][size="2"]unacceptable[/size][/font][/color][size="2"]. So, this problem is still unsolved…[/size]
U are right. After having removed static class Pjax, script will be loaded propably. This will mean,that I will get traffic,which actually shold be avoided. I have to ask my chief for another design, if he wants to use AJAX,right?
Where does ur guess come from? Without U, I never got this depenencie(s). Thx a lot for this!!
I have been bitten by this like 100 times, I used to do ruby work at my previous company (yellowpages) we used pjax heavily. I figured it when i saw your namespaces and I noticed yii\widgets\Pjax I knew it had to be pjax.
I am glad you got it working. I think you can still get it working with pjax enabled you have to tune a bit as softark pointed out.