本文整理汇总了PHP中Result::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::getValue方法的具体用法?PHP Result::getValue怎么用?PHP Result::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: app_choice
function app_choice()
{
// Accessing the result object
$result = new Result();
$choice = $result->getValue();
// Create a new instance of the Tropo object.
$tropo = new Tropo();
// Provide a prompt based on the value
if ($choice == "1") {
$tropo->say("You picked Lord of the Rings. Did you know Gandalf is also Mag knee toe? Weird.");
}
if ($choice == "2") {
$tropo->say("You picked the original Star Wars. I hear Leonard Nimoy was awe some in those.");
}
if ($choice == "3") {
$tropo->say("You picked the Star Wars prequels. Stop calling this number, Mr. Lucas, we know it's you.");
}
if ($choice == "4") {
$tropo->say("You picked the Matrix. Dude, woe.");
}
// Tell Tropo what to do next. This redirects to the instructions under dispatch_post('/hangup', 'app_hangup').
$tropo->on(array("event" => "continue", "next" => "favorite-movie-webapi.php?uri=hangup"));
// Tell Tropo what to do if there's an problem, like a timeout. This redirects to the instructions under dispatch_post('/incomplete', 'app_incomplete').
$tropo->on(array("event" => "incomplete", "next" => "favorite-movie-webapi.php?uri=incomplete"));
// Render the JSON for the Tropo WebAPI to consume.
return $tropo->RenderJson();
}
示例2: voice_continue
public function voice_continue()
{
$this->set_output_mode(MY_Controller::OUTPUT_NORMAL);
$tropo = new Tropo();
@($result = new Result());
$answer = $result->getValue();
$tropo->say("You said " . $answer);
$tropo->RenderJson();
}
示例3: zip_end
function zip_end()
{
// Create a new instance of the result object and get the value of the user input.
$result = new Result();
$zip = $result->getValue();
// Create a new instance of the Tropo object.
$tropo = new Tropo();
// Get the weather information for the entered zip code.
formatWeatherResponse($tropo, $zip);
// Render the JSON for the Tropo WebAPI to consume.
return $tropo->RenderJson();
}
示例4: conference
function conference()
{
global $voice;
$tropo = new Tropo();
$tropo->setVoice($voice);
$result = new Result();
$conference = $result->getValue();
$tropo->say('<speak>Conference ID <say-as interpret-as=\'vxml:digits\'>' . $conference . '</say-as> accepted.</speak>');
$tropo->say('You will now be placed into the conference. Please announce yourself. To exit the conference without disconnecting, press pound.');
$tropo->conference($conference, array('id' => $conference, 'terminator' => '#'));
$tropo->say('You have left the conference.');
$tropo->on(array("event" => "continue", "next" => "restart"));
$tropo->RenderJson();
}
示例5: demo_end
function demo_end()
{
$result = new Result();
$zip = $result->getValue();
$weather_info = getWeather($zip);
$city = array_pop($weather_info);
$tropo = new Tropo();
$tropo->say("The current weather for {$city} is...");
foreach ($weather_info as $info) {
$tropo->say("{$info}.");
}
$tropo->say("Thank you for calling. Goodbye.");
$tropo->hangup();
return $tropo->RenderJson();
}
示例6: cleangrammar
// Build a grammar with the venue ID as the concept and the name and
// dtmf tone as options. Strip certain characters from venue names that
// might cause the grammar engine to choke
$choices .= "{$venue['id']} (" . cleangrammar($venue['name']) . ", {$dtmf}), ";
$dtmf++;
}
}
// We allow the caller to say the name of the venue with voice recognition or to press
// or say the number of the venue.
$tropo->say('Speak the name of the venue or press it\'s number.');
$tropo->ask($say, array('choices' => $choices, 'required' => true, 'attempts' => 3, 'timeout' => 30, 'bargein' => true));
}
if ($action == 'checkin') {
// This is the result of the question being answered
$result = new Result();
$vid = $result->getValue();
if ($vid) {
// If we have a value back, it's because the input matched.
// So take that venue ID and check in here.
$checkin = getapi('checkin', array('vid' => $vid), 1, 'POST');
// We're going to speak the foursquare result message to them
$message = $checkin['checkin']['message'];
// Is there a new Mayor? if so, let them know!
if ($checkin['checkin']['mayor']['type'] != 'nochange') {
$message .= ' ' . $checkin['checkin']['mayor']['message'];
}
$tropo->say($message);
} else {
// No value came back, so there was no match. Let the user know we
// can't help.
// An interesting enhancement here would be to look for a lack of matches