tags:

views:

199

answers:

2

Hi folks,

I'm getting this syntax error and I know it's PHP 101, but I wouldn't know php if it hit me over the head with a curly bracket. Any help would be appreciated. Thanks

<?php echo ($this->getProduct()->getCategory() ? $this->getProduct()->getCategory()->getName() : ‘no category’) ?>
+6  A: 

What kind of apostrophe is that?

‘no category’

Should be

'no category'
Ivan Krechetov
Hah! Good catch, thanks. It was originally copypasted from a forum thread, so that's probably where the weird apostrophe came in.Thanks, that fixed the error :)
greencoconut
+2  A: 

; at the end of the statement?

Overbeeke
That semicolon is optional.
Gumbo
Thanks, tried that and it didn't work.@Gumbo Thanks for the tip
greencoconut