public function addCommand($aAttributes, $mData)
    {
        /* merge commands if possible */
        if(in_array($aAttributes['cmd'], array('js', 'ap')))
        {
            if(($aLastCommand = array_pop($this->aCommands)))
            {
                if($aLastCommand['cmd'] == $aAttributes['cmd'])
                {
                    if($this->getOption('core.response.merge.js') &&
                            $aLastCommand['cmd'] == 'js')
                    {
                        $mData = $aLastCommand['data'].'; '.$mData;
                    }
                    elseif($this->getOption('core.response.merge.ap') &&
                            $aLastCommand['cmd'] == 'ap' &&
                            $aLastCommand['id'] == $aAttributes['id'] &&
                            $aLastCommand['prop'] == $aAttributes['prop'])
                    {
                        $mData = $aLastCommand['data'].' '.$mData;
                    }
                    else
                    {
                        $this->aCommands[] = $aLastCommand;
                    }
                }
                else
                {
                    $this->aCommands[] = $aLastCommand;
                }
            }
        }
        $aAttributes['data'] = $mData;
        $this->aCommands[] = $aAttributes;

        return $this;
    }
public function addCommand($aAttributes, $mData)
    {
        /* merge commands if possible */
        if(in_array($aAttributes['cmd'], array('js', 'ap')))
        {
            if(($aLastCommand = array_pop($this->aCommands)))
            {
                if($aLastCommand['cmd'] == $aAttributes['cmd'])
                {
                    if($this->getOption('core.response.merge.js') &&
                            $aLastCommand['cmd'] == 'js')
                    {
                        $mData = $aLastCommand['data'].'; '.$mData;
                    }
                    elseif($this->getOption('core.response.merge.ap') &&
                            $aLastCommand['cmd'] == 'ap' &&
                            $aLastCommand['id'] == $aAttributes['id'] &&
                            $aLastCommand['prop'] == $aAttributes['prop'])
                    {
                        $mData = $aLastCommand['data'].' '.$mData;
                    }
                    else
                    {
                        $this->aCommands[] = $aLastCommand;
                    }
                }
                else
                {
                    $this->aCommands[] = $aLastCommand;
                }
            }
        }
        $aAttributes['data'] = $mData;
        $this->aCommands[] = $aAttributes;

        return $this;
    }
public function addCommand ( $ aAttributes , $ mData ) { /* merge commands if possible */ if ( in_array ( $ aAttributes [ 'cmd' ] , array ( 'js' , 'ap' ) ) ) { if ( ( $ aLastCommand = array_pop ( $ this -> aCommands ) ) ) { if ( $ aLastCommand [ 'cmd' ] == $ aAttributes [ 'cmd' ] ) { if ( $ this -> getOption ( 'core.response.merge.js' ) && $ aLastCommand [ 'cmd' ] == 'js' ) { $ mData = $ aLastCommand [ 'data' ] . '; ' . $ mData ; } elseif ( $ this -> getOption ( 'core.response.merge.ap' ) && $ aLastCommand [ 'cmd' ] == 'ap' && $ aLastCommand [ 'id' ] == $ aAttributes [ 'id' ] && $ aLastCommand [ 'prop' ] == $ aAttributes [ 'prop' ] ) { $ mData = $ aLastCommand [ 'data' ] . ' ' . $ mData ; } else { $ this -> aCommands [ ] = $ aLastCommand ; } } else { $ this -> aCommands [ ] = $ aLastCommand ; } } } $ aAttributes [ 'data' ] = $ mData ; $ this -> aCommands [ ] = $ aAttributes ; return $ this ; }
Add a response command to the array of commands that will be sent to the browser

@param array         $aAttributes        Associative array of attributes that will describe the command
@param mixed            $mData                The data to be associated with this command

@return \Jaxon\Plugin\Response
Add a response command to the array of commands that will be sent to the browser