{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9806","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9806/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9806/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9806/events","html_url":"https://github.com/yiisoft/yii2/issues/9806","id":109211346,"number":9806,"title":"Yii2 - Render actionView inside index.php of a view","user":{"login":"phuongktax","id":11583729,"avatar_url":"https://avatars.githubusercontent.com/u/11583729?v=3","gravatar_id":"","url":"https://api.github.com/users/phuongktax","html_url":"https://github.com/phuongktax","followers_url":"https://api.github.com/users/phuongktax/followers","following_url":"https://api.github.com/users/phuongktax/following{/other_user}","gists_url":"https://api.github.com/users/phuongktax/gists{/gist_id}","starred_url":"https://api.github.com/users/phuongktax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuongktax/subscriptions","organizations_url":"https://api.github.com/users/phuongktax/orgs","repos_url":"https://api.github.com/users/phuongktax/repos","events_url":"https://api.github.com/users/phuongktax/events{/privacy}","received_events_url":"https://api.github.com/users/phuongktax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T01:22:35Z","updated_at":"2015-10-01T07:53:17Z","closed_at":"2015-10-01T07:53:17Z","body":"In my index.php, I want to display some information of view.php, so I use\r\n\r\n```php\r\n$this->render('view',array('id'=>$model['id']) ); \r\n```\r\n\r\nwhere  $model['id'] comes from the loop.\r\n\r\nIn my actionView :  \r\n\r\n```php\r\npublic function actionView($id)\r\n    {\r\n        $project = Users::findOne($id);\r\n        $list = $project->getProjects()->asArray()->all();\r\n        $list2 = $project->getGroups()->asArray()->all();\r\n\r\n        return $this->render('view', [\r\n            'model' => $this->findModel($id)->toArray(),\r\n            'projects' => $list,\r\n            'groups' => $list2          \r\n        ]);\r\n    }\r\n```\r\n\r\nneeds parameter $id, however the result in my index view is \"Undefined variable: groups\"\r\nI think that I have to pass the  $model['id']  into   actionView($id), how to do it? Many thanks..."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/144647196","html_url":"https://github.com/yiisoft/yii2/issues/9806#issuecomment-144647196","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9806","id":144647196,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T07:53:17Z","updated_at":"2015-10-01T07:53:17Z","body":"Please [use forums for questions](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/). Thanks."}}