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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.