Exactly right in concept. Just a wee typo in your syntax. It's
case "post":
and not
case: "post"
(Oh, and a mising semicolon on the first line, but that's incidental!)
Apart from that, it's perfect.
In case you are wondering, the "break" is to stop the rest of the switch from being executed (a behaviour known as "falling through"). Without it, then if $action="post", you'd get "bla bla bla" and continue on to get "view.something.here". That's to make it easy to group several cases that do the same thing:
switch($digit)
{
case 2:
case 3:
case 5:
case 7:
// A prime digit
break;
default: // Anything not otherwise coverered
// Not a prime digit
}