[TYPO3-mvc] 404 redirect if requested object doesn't exist? show action

François Suter fsu-lists at cobweb.ch
Wed Apr 20 15:25:10 CEST 2011


Hi Franz,

> simply allow the property to be NULL and check that in your controller
> action.
>
> public function show(Tx_Foo_..._Item $item = NULL) {
>      if ($item === NULL) {
>          # throw 404 and redirect ...
>      }
> }

Funny, I had tried this and it didn't work. Maybe I forgot to clear the 
cache.

Anyway it works. Thanks!

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-typo3v4mvc mailing list