Jump to content


Photo

Bootstrapping: $wire is null?


  • Please log in to reply
2 replies to this topic

#1 MarcC

MarcC

    Sr. Member

  • Members
  • PipPipPipPip
  • 255 posts
  • 64

  • LocationCalifornia

Posted 09 April 2012 - 12:11 PM

I just received this in an email from a developer I'm working with:

...in my code, after including/bootstrapping as per his site, I can use (for example) wire('pages') but not $wire->pages. The docs say I should be able to use either way, but for me $wire is NULL.


Any idea what might be going wrong? Thanks.

I'm a freelance, processwire-using web designer based in california. work site | personal site | visuals


#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 09 April 2012 - 12:27 PM

It works (always) for me. Maybe some other things included that is disturbing?

@somartist | modules created | support me, flattr my work flattr.com


#3 ryan

ryan

    Hero Member

  • Administrators
  • 5,812 posts
  • 3140

  • LocationAtlanta, GA

Posted 09 April 2012 - 04:39 PM

I don't think there's any way for us to tell why $wire isn't working without seeing the code context where it's not working. I have a feeling he's trying to use $wire from within a function or class, and it's out of scope. But I would suggest using the wire() function either way, as that's going to be more portable in most use cases.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users