Jump to content

Php Synatx error


davemilan

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.