We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

My module hates me.

Development and Programming

Christopher Simmons's avatar
Christopher Simmons
68 posts
17 years ago
Christopher Simmons's avatar Christopher Simmons

On my development site, I’m working on a quote tool for a client, and in the process, I’m developing my first custom module. Woo!

Before I updated to 1.6, it worked, now, even though it IS returning the $tagdata variable at the end of the module (and I can echo $tagdata to see it all there, with the module’s variables replaced, but without the conditionals and such done), nothing in the tag pair gets printed. I turned on template debugging, but it doesn’t seem to be returning any errors.

Blergh.

       
Christopher Simmons's avatar
Christopher Simmons
68 posts
17 years ago
Christopher Simmons's avatar Christopher Simmons

Got it!

I had been simply calling “return $tagdata,” but that did work.

I changed it to $this->return_data =& $tagdata, and that did work. Woo!

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones
return $foo;

Will work fine in a module. The only exception is the constructor method, since constructors cannot return values when initialializing the object. Incidentally, I do not see any benefit to assigning that by reference.

       
Christopher Simmons's avatar
Christopher Simmons
68 posts
17 years ago
Christopher Simmons's avatar Christopher Simmons

Yeah, I just copied and pasted from another module. ;P And it was the constructor.

I blame whoever drank the last of the coffee.

       
David Webb's avatar
David Webb
62 posts
17 years ago
David Webb's avatar David Webb

Oooh a quote module… Sounds very interesting… Is it going to be something you’ll share with the community…

I just spent an hour this morning drawing a flow chart of how we come up with our prices and was thinking how on earth it would be possible to make it automated on the site. I really do need to look into the php of it.

       
Christopher Simmons's avatar
Christopher Simmons
68 posts
17 years ago
Christopher Simmons's avatar Christopher Simmons

Right now it’s VERY site-specific, though I do plan to try and abstract things a lot and see how useful I can make it for the general populace, after I get done.

       
David Webb's avatar
David Webb
62 posts
17 years ago
David Webb's avatar David Webb

Cool. Yeah I don’t have the foggiest of how to even start it so your way ahead of me. It’ll be interesting to see it even if you only get it sorted for that one site.

Good luck.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.