1

Could someone point me in the right direction.

{if $current_url == '/movies' || $current_url == '/tv-shows' || $current_url == '/movie/$mov.title|replace:' ':'-''}

Could someone tell me what i'm doing wrong to get this error because i'm new to coding.

PHP Fatal error: Smarty error: syntax error: unidentified token '='

Erick Robertson
  • 32,125
  • 13
  • 69
  • 98
mike jones
  • 101
  • 1
  • 2
  • 13
  • removed PHP tag because PHP users who don't understand smarty are going to be pretty confused by this question. – Erick Robertson Nov 08 '13 at 18:45
  • The ending seems to be confused for me. What is that replace there? and what are the last apostrophe encapsulated string? – Lajos Veres Nov 08 '13 at 18:48
  • Well what i'm trying to do is the current url looks like this `/movie/the-host` so i'm trying to use the movie title as the end of the url that looks like this `the host` and i'm to replace spaces with `-` – mike jones Nov 08 '13 at 18:54

1 Answers1

1

You're using quotes wrong. This is not valid, because you're embedding single quotes inside single quotes:

$current_url == '/movie/$mov.title|replace:' ':'-''

Instead, you should use this:

$current_url == '/movie/'|cat:$mov.title|replace:' ':'-'

Or the somewhat shorter version with backticks:

$current_url == "/movie/`$move.title`":$mov.title|replace:' ':'-'
periklis
  • 10,102
  • 6
  • 60
  • 68