src/Cortex/Output.php
protected function getResponse($trigger)
    {
        $trigger = synapse()->brain->topic()->triggers()->get($trigger);

        if (isset($trigger['redirect'])) {
            return $this->getResponse($trigger['redirect']);
        }

        $key          = array_rand($trigger['responses']);
        $this->output = $this->parseResponse($trigger['responses'][$key]);
    }
protected function getResponse($trigger)
    {
        $trigger = synapse()->brain->topic()->triggers()->get($trigger);

        if (isset($trigger['redirect'])) {
            return $this->getResponse($trigger['redirect']);
        }

        $key          = array_rand($trigger['responses']);
        $this->output = $this->parseResponse($trigger['responses'][$key]);
    }
protected function getResponse ( $ trigger ) { $ trigger = synapse ( ) -> brain -> topic ( ) -> triggers ( ) -> get ( $ trigger ) ; if ( isset ( $ trigger [ 'redirect' ] ) ) { return $ this -> getResponse ( $ trigger [ 'redirect' ] ) ; } $ key = array_rand ( $ trigger [ 'responses' ] ) ; $ this -> output = $ this -> parseResponse ( $ trigger [ 'responses' ] [ $ key ] ) ; }
Fetch a response from the found trigger.

@param string $trigger;

@return void
Fetch a response from the found trigger .