-3

i want to sort the products according to their name and price. When i do <?php echo $this->Paginator->sort('name'); ?> it works. But it is not working in dropdown list. Thanks for any suggestion. My Code is

<select name="">
<option>Position</option>
<option> S<?php echo $this->Paginator->sort('name'); </option>
<option><?php echo $this->Paginator->sort('price'); ?></option>
</select>
user221931
  • 1,852
  • 1
  • 13
  • 16
DR Jerry
  • 51
  • 3
  • 11

1 Answers1

2

Are you sure you understand what you're trying to do? You're putting an <a> link produced from Paginator::sort inside an <option> element belonging to a <select>. This isn't possible in HTML and hasn't got anything to do with cake.

You can read more and/or try the solutions described here:

Community
  • 1
  • 1
user221931
  • 1,852
  • 1
  • 13
  • 16