About the Events API
This is an open discussion with 8 replies, filed under Extensions.
Search
I’ve done a fair amount of event customisation — this looks almost identical to 2.0.
Awesome. Thanks for the input Nick!
Is there a way that we could get this Event API write-up added to the documentation?
The docs are currently being rewritten from the ground up. We’ll make sure to cover this… Thanks :)
Thanks Craig!
@czheng: Are you writing API documentation, too?
Yes we are. We’ve got one project in the meantime, so it’s not right around the corner, but it’s right around the corner ;) I’ll be starting a forum discussion soon to make sure we address the most crucial needs early and to solicit feedback as we progress…
this looks almost identical to 2.0.
It is almost identical. However, in the Event API write-up that @bzerangue mentions the private var $_db
is no longer present. I’m sure the more advanced Syphoniacs are aware of it and know how to easily access the database within the PHP OOP.
Symphony 1.x - class.event.php
Class Event Extends Object var $_parent var $_env var $_db __construct($args) about() load() trigger()
Symphony 2.x - class.event.php
abstract Class Event{ protected $_Parent; protected $_env; const CRLF = "rn"; const kHIGH = 3; const kNORMAL = 2; const kLOW = 1; function __construct(&$parent, $env=NULL){ $this->_Parent = $parent; $this->_env = $env; } public static function allowEditorToParse(){ return false; } public static function getSource(){ return NULL; } abstract public static function about(); abstract public function load(); abstract protected function __trigger(); }
Bottom Line
As someone experienced with PHP I found the Event API write-up for Symphony 1.x to be helpful and effective for learning the 2.x version such that I’m able to learn by doing. The learning curve has been a little frustrating for me though, but we’re getting there.
Create an account or sign in to comment.
There is a nice write-up about the Events API in Symphony 1.7 in the Archived Wiki. Is this still virtually the same or has it dramatically changed. Would it be possible for someone who knows about the Events API to take this write up and adjust it for Symphony 2?
Thanks for your help! I’m a PHP novice, so unfortunately in this area I need all the help I can get. Again thank you!