Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function in WidgetClass extends Widget not returning value #39

Closed
oceanmountain opened this issue Feb 26, 2013 · 2 comments
Closed

function in WidgetClass extends Widget not returning value #39

oceanmountain opened this issue Feb 26, 2013 · 2 comments

Comments

@oceanmountain
Copy link

I was trying to return a function in my widget to display certain members. However, when I put this in MyWidget and looped through it in the widget template I did not get any results.
However, putting the function to get the members in the MyWidget_controller, it all worked!

More info: http://www.silverstripe.org/widgets-2/show/22718 (with code and stuff).
Not sure if this is an issue though, perhaps it is maybe it should be like this

@stojg
Copy link

stojg commented Feb 26, 2013

I would not call it an issue. The reason is how the datamodel is set up.

Page -> has_one(or many) -> WidgetArea -> has_many -> Widget

So when rendering the Widget it doesn't traverse all the way from it to the 'Main' controller for Page.

@robbieaverill
Copy link
Contributor

Closing as this doesn't sound like a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants