careless_monkey 0 Newbie Poster

I'm building a database of solar system for a course.
Here's what I have problem with:


I have a 'regularplanet' model which has 'regularplanets' controller.
When I go to /htdocs/solar/regularplanets, my page lists all the planets (Earth, Venus, etc.). Beside every planet I want to have a link 'Attribute' which goes to another page /htdocs/solar/regularplanets/attribute which displays the attributes (Mass, Age, Revolution time, etc) corresponding to that planet.

Now here is the problem. I have a function Attribute created in the Regularplanets controller which has a parameter ($Name). From what I understand, when a user clicks on the 'Attribute' beside Earth it should pass 'Earth' as the name in the attribute function in the controller. But, this is not happening in my program. How do I make Cake know that when a link for Earth attribute is clicked, it should pass Earth as Name in the controller and should output its attributes.

This is what I have as a link for Attributes in my index.ctp file.

<?php echo $this->Html->link('Attributes', array('action' => 'Attribute') ); ?>

Please let me know if someone is still confused about what I'm talking about here. I'll try to upload images and explain better.
Thanks.

This is how my index.ctp looks like:

<table>
	<th> Name </th>
	

<?php foreach ($regularplanets as $regularplanet): ?>
<tr>
	
	<td> <?php echo $regularplanet['Regularplanet']['Name']; ?> </td>
		
	<td> <?php echo $this->Html->link('Attributes', array('action' => 'Attribute') ); ?></td>
			
</tr>

<?php endforeach; ?>

</table>

Also I have this in my controller:

function attribute ($Name){
		$this->Regularplanet->Name = $Name;
		$this->set('regularplanet', $this->Regularplanet->read());	
	}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.