本文整理汇总了PHP中PHPBoostErrors::unexisting_category方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPBoostErrors::unexisting_category方法的具体用法?PHP PHPBoostErrors::unexisting_category怎么用?PHP PHPBoostErrors::unexisting_category使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPBoostErrors
的用法示例。
在下文中一共展示了PHPBoostErrors::unexisting_category方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieve
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once '../kernel/begin.php';
require_once '../forum/forum_begin.php';
require_once '../forum/forum_tools.php';
$id_get = retrieve(GET, 'id', 0);
//Vérification de l'existance de la catégorie.
if ($id_get != Category::ROOT_CATEGORY && !ForumService::get_categories_manager()->get_categories_cache()->category_exists($id_get)) {
$controller = PHPBoostErrors::unexisting_category();
DispatchManager::redirect($controller);
}
//Vérification des autorisations d'accès.
if (!ForumAuthorizationsService::check_authorizations($id_get)->read()) {
$error_controller = PHPBoostErrors::user_not_authorized();
DispatchManager::redirect($error_controller);
}
try {
$category = ForumService::get_categories_manager()->get_categories_cache()->get_category($id_get);
} catch (CategoryNotFoundException $e) {
$error_controller = PHPBoostErrors::unexisting_page();
DispatchManager::redirect($error_controller);
}
if ($category->get_url()) {
$error_controller = PHPBoostErrors::unexisting_page();