davemilan Posted March 30, 2013 Share Posted March 30, 2013 Hello everybody, I am new to this community as well as PHP and cakePHP. Currently I am working on a script, however it results in a syntax error and I can't figure out how to get this resolved. The line in question is this one: <?php echo $this->Html->link('View/Edit', array('action' => 'view', $client['Client']['id']), "?" => array('nc' => time(), array('class' => 'view')); ?> It would be greatly appreciated if someone can let me know how to resolve this. Thank you very much, DM Quote Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/ Share on other sites More sharing options...
timothyarden Posted March 30, 2013 Share Posted March 30, 2013 (edited) Not 100% sure but (highlighted text) <?php echo $this->Html->link('View/Edit', array('action' => 'view', $client['Client']['id']), "?" => array('nc' => time(), array('class' => 'view')); ?> I think should have a key Try and see Edited March 30, 2013 by timothyarden Quote Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/#findComment-1421913 Share on other sites More sharing options...
davemilan Posted March 30, 2013 Author Share Posted March 30, 2013 Thank you very much for your reply timothyarden, the error I get with my code is: Parse error: syntax error, unexpected T_DOUBLE_ARROW on line 1 Any idea how I can change this around ? Quote Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/#findComment-1421914 Share on other sites More sharing options...
timothyarden Posted March 30, 2013 Share Posted March 30, 2013 Hi Dave, You were missing a parenthesis:To check your code for the error I just spaced it out - below is the code with an error followed by the code without the error echo $this -> Html -> link( 'View/Edit', array( 'action' => 'view', $client['Client']['id'] ), "?" => array( 'nc' => time(), array( 'class' => 'view' ) ); echo $this -> Html -> link( 'View/Edit', array( 'action' => 'view', $client['Client']['id'] ), "?" => array( 'nc' => time(), array( 'class' => 'view' ) ) ); Hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/#findComment-1422016 Share on other sites More sharing options...
timothyarden Posted April 5, 2013 Share Posted April 5, 2013 Did this work? Quote Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/#findComment-1423018 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.