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 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 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 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 ? 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 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? Link to comment https://forums.phpfreaks.com/topic/276313-php-synatx-error/#findComment-1423018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.