Table Generation and links |
[eluser]mrwilson1[/eluser]
I am generating tables usng the table class, and having no problem getting results or displaying. My question is this: where(controller/view)and how do you create links like this within the generated table? Code: anchor("post/fill_form/$row->post_id", $row->post_id) or combining two fields such as a $link and a $name field to make a link to fill one field in a row. Is that done in the controller or in the view when you create the table, and what function would you use? Of course these are simple to do with straight php.
[eluser]Jamie Rumbelow[/eluser]
If you take a look at the User Guide you can see that you can set a template, in which you can customise the Table's structural elements. In the case of each cell's content however, you just need to put it in the value of that cell - you can put pretty much anything you want in there! Jamie
[eluser]stowell48[/eluser]
[quote author="Jamie Rumbelow" date="1256620072"]If you take a look at the User Guide you can see that you can set a template, in which you can customise the Table's structural elements. In the case of each cell's content however, you just need to put it in the value of that cell - you can put pretty much anything you want in there! Jamie[/quote] I have seen that there is a template and am using it, but I don't see in the documentation how you would call that particular cell. Were you able to figure that out?
[eluser]mrwilson1[/eluser]
Stowell, in order to do what i wanted to do I used "add_row" in this manner <code>foreach($result as $row) { $this->table->add_row( anchor("work/fill_form/$row->id", $row->id), $row->date, $row->title, $row->compl, $this->typography->auto_typography($row->item) ); } $table = $this->table->generate(); echo $table; </code>
[eluser]stowell48[/eluser]
[quote author="mrwilson1" date="1267233102"]Stowell, in order to do what i wanted to do I used "add_row" in this manner <code>foreach($result as $row) { $this->table->add_row( anchor("work/fill_form/$row->id", $row->id), $row->date, $row->title, $row->compl, $this->typography->auto_typography($row->item) ); } $table = $this->table->generate(); echo $table; </code>[/quote] Awesome. Thanks for your help. That worked great. |
Welcome Guest, Not a member yet? Register Sign In |