Sharing variables across blocks
Block A is a zip code lookup, while block B is a listing of the steps during registration. If the zip code isn't found, I set a variable indicating this in Block A (I'm using $this->set("zip_found", true) in the A controller). Block B needs to know if that variable was set (to know whether to advance the step indication).
The other option is for me to hit the API twice, which I don't want to do.
If just working variables in php, you can:
- set is as a php global
- create a library or model class with the info as static data
- set it in a user's session (will now be persistent for the user)
If the block data record, you can use c5 to retrieve the block object with its data and interrogate that.