- 7.1. Opt_Class class
7.1.7. setBufferState() - 7.1.6. register()
« Previous - 7.1.8. setCache()
Next »
7.1.7. setBufferState()
| Construct | Method |
|---|---|
| Visibility | public |
| Reference | void setBufferState( string $name , boolean $state ) |
| Argument list |
|
| Versions | since 2.0.1 |
Open Power Template supports advisory notifications on the output buffer state. They can help deciding, whether to open a new output buffer or using an existing one. Advisory output buffer states are a kind of semaphores. setBufferState() increments the value, if $state is true and decrements for false. The minimum semaphore value is 0. If it reaches this value, setBufferState('buffer', false) has no effect.
ob_start(); $tpl->setBufferState('buffer', true); // ... if(!$tpl->getBufferState('buffer')) { ob_start(); $tpl->setBufferState('buffer', true); } // ... ob_end_flush(); $tpl->setBufferState('buffer', false);
Advisory output buffer states are mostly used in OPT caching systems.
See also:
- 7.1.7. setBufferState()
7.1. Opt_Class class - « Previous
7.1.6. register() - Next »
7.1.8. setCache()