Search
 
SCRIPT & CODE EXAMPLE
 

PHP

cakephp 404 exception

use CakeHttpExceptionNotFoundException;

public function view($id = null)
{
    $article = $this->Articles->findById($id)->first();
    if (empty($article)) {
        throw new NotFoundException(__('Article not found'));
    }
    $this->set('article', $article);
    $this->viewBuilder()->setOption('serialize', ['article']);
}
Comment

PREVIOUS NEXT
Code Example
Php :: replace _ with space php 
Php :: php temp directory 
Php :: php get extension from string 
Php :: Connecting to the database using mysqli 
Php :: laravel transactions 
Php :: laravel eloquent increment 
Php :: Wordpress hook for newly published post 
Php :: mobile no validation laravel 
Php :: php maxupload 
Php :: php array has value 
Php :: twig symfony get route 
Php :: alert in php 
Php :: ext-dom php 7.2 
Php :: alert php 
Php :: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add index `users_userable_type_userable_id_index`(`userable_type`, `userable_id`) 
Php :: php read xml file into array 
Php :: php check if extension is installed 
Php :: laravel php short if 
Php :: wordpress check shortcode exists 
Php :: php add year to date 
Php :: ci3 upload file 
Php :: laravel abort 
Php :: check if input file is set codeigniter 
Php :: how to fetch all defined constant in php 
Php :: xampp check php version 
Php :: how to send html tags in twig template 
Php :: php number format 2 decimal no comma 
Php :: delete record php mysqli 
Php :: wordpress get site url 
Php :: php get intersection of arrays 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =