本文整理汇总了PHP中Subject::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::find_by_id方法的具体用法?PHP Subject::find_by_id怎么用?PHP Subject::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::find_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selected_page
function selected_page()
{
global $current_subject;
global $current_page;
if (isset($_GET['subject'])) {
$current_subject = Subject::find_by_id($_GET['subject']);
$current_page = null;
} elseif (isset($_GET['page'])) {
$current_page = Page::find_by_id($_GET['page']);
$current_subject = null;
} else {
$current_subject = null;
$current_page = null;
}
}
示例2: redirect_to
<?php
require_once "../../includes/initialize.php";
?>
<?php
// if(!$session->is_logged_in()) {
// redirect_to('login.php');
// }
if (!isset($_GET['subject'])) {
redirect_to('manage_admins.php');
}
$subject = Subject::find_by_id($_GET['subject']);
if ($subject && $subject->delete()) {
$session->message("Admin was deleted");
redirect_to("manage_content.php");
} else {
$session->message("Unable to delete the admin");
redirect_to("manage_content.php");
}
// TASK
// Find out how to perform cascade deleting