本文整理汇总了PHP中Stream::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Stream::update方法的具体用法?PHP Stream::update怎么用?PHP Stream::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
$current_page = "streams";
require_once "header.php";
require_once "objects/stream.php";
$message = '';
if ($_POST) {
$result = Stream::update($_POST);
if ($result) {
$message = '<div class="alert alert-success" role="alert">Stream updated!</div>';
} else {
$message = '<div class="alert alert-danger" role="alert">Problem updating stream...</div>';
}
}
$games = Stream::games();
$leagues = Stream::leagues();
$champions = Stream::champions();
$selected_game = $_GET['game'] ? $_GET['game'] : '';
$selected_champion = $_GET['champion'] ? $_GET['champion'] : '';
$selected_league = $_GET['league'] ? $_GET['league'] : '';
$game_html = '';
foreach ($games as $game) {
$checked = '';
if ($selected_game == $game->name) {
$checked = ' selected="selected"';
}
$game_html .= <<<HTML
\t\t\t<option value="{$game->name}"{$checked}>{$game->name}</option>
HTML;
}
$league_html = '';
示例2: getStreams
<button type="reset">RESET</button>
<button type="submit"
name="stage"
value="2">submit</button>
</fieldset>
</form>
</div>';
break;
case "2":
// $stream = new Stream( "00000", $_POST[ "name" ], $_POST[ "description" ], $_POST[ "startYear" ], $_POST[ "stopYear" ] );
$stream->setName($_POST["name"]);
$stream->setDescription($_POST["description"]);
$stream->setStartYear($_POST["startYear"]);
$stream->setStopYear($_POST["stopYear"]);
if ($stream->validate()) {
if ($stream->update()) {
$pageBody .= '
<div class="dialog">
<p>stream successfully saved</p>
</div>';
}
}
break;
}
} else {
// You need to specify a target
}
break;
case "list":
$streams = getStreams();
if (count($streams) > 0) {