It's because you don't have $sort variable in the view. The variable is passed to the view in admin action, but when you use renderPartial(), you didn't pass this variable to it.
I would like to do something similar. I want to render collection of other controllers view results on my current controller, but it seems to not be working.
[code=I'm trying to do something like this]for (…)
I would like to make one entity with some collection items, sadly active record and views doesn't support such features… Can anyone suggest me what to do?
working through the Blog tutorial has been cool, but I am trying to expand my ability to be flexible with this
for instance:
i have my post model, and i want one of my entries in this model on my index page - how would I go about doing this?
i am fairly certain that it has something to do with render partial, and i am thinking that i need to send some values to the view that i include, but i cant completely figure that out -
basically - i was trying to pull something like this:
i created the _show.php file in my post views but i have no idea how to get this party started
any tips?
say for example that the id for my post is '9' - i want this one to appear somewhere
You need to define $post, either by passing a variable named 'post' when you call render() in your controller action (preferred), or in your view, using code like the following:
In a module, if you want to reference a view outside of the module (this is bad practice!), you can use dot syntax. That is, use the path alias to the view. For example, 'application.views.site.index'
In a module, if you want to reference a view outside of the module (this is bad practice!), you can use dot syntax. That is, use the path alias to the view. For example, 'application.views.site.index'