src/core/base/wnComponent.js
function (name,hidden)
		{
			var eventName = 'event-'+name;
			if (_events[eventName] != undefined) 
				return _events[eventName];
			else
			{
				if (!_eventsConfig[eventName] || !this.c)
					return false;
				var config = _eventsConfig[eventName] || {},
					_class = config.class;
				config.id = eventName;
				config.autoInit = false;
				var evt = this.createClass(_class,config);
				if (evt)
				{
					evt.setParent(this);
					evt.init();
					if (hidden != false)
					{
						_events[eventName] = evt;
						this.e[name]=evt.emit;
					} else
					{
						Object.defineProperty(_events[eventName],{ value: evt, enumerable: false });
					}
					return evt;
				}
				return false;
			}
		}
function (name,hidden)
		{
			var eventName = 'event-'+name;
			if (_events[eventName] != undefined) 
				return _events[eventName];
			else
			{
				if (!_eventsConfig[eventName] || !this.c)
					return false;
				var config = _eventsConfig[eventName] || {},
					_class = config.class;
				config.id = eventName;
				config.autoInit = false;
				var evt = this.createClass(_class,config);
				if (evt)
				{
					evt.setParent(this);
					evt.init();
					if (hidden != false)
					{
						_events[eventName] = evt;
						this.e[name]=evt.emit;
					} else
					{
						Object.defineProperty(_events[eventName],{ value: evt, enumerable: false });
					}
					return evt;
				}
				return false;
			}
		}
function ( name , hidden ) { var eventName = 'event-' + name ; if ( _events [ eventName ] != undefined ) return _events [ eventName ] ; else { if ( ! _eventsConfig [ eventName ] || ! this . c ) return false ; var config = _eventsConfig [ eventName ] || { } , _class = config . class ; config . id = eventName ; config . autoInit = false ; var evt = this . createClass ( _class , config ) ; if ( evt ) { evt . setParent ( this ) ; evt . init ( ) ; if ( hidden != false ) { _events [ eventName ] = evt ; this . e [ name ] = evt . emit ; } else { Object . defineProperty ( _events [ eventName ] , { value : evt , enumerable : false } ) ; } return evt ; } return false ; } }
Get an event and create an alias to the push function.
@param string $name eventName
@param boolean $hidden ?
@return wnEvent
Get an event and create an alias to the push function .