CodeIgniter Forums
Table Generation and links - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Table Generation and links (/showthread.php?tid=23944)



Table Generation and links - El Forum - 10-26-2009

[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.


Table Generation and links - El Forum - 10-26-2009

[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


Table Generation and links - El Forum - 10-26-2009

[eluser]mrwilson1[/eluser]
thank you jamie


Table Generation and links - El Forum - 02-26-2010

[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?


Table Generation and links - El Forum - 02-26-2010

[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>


Table Generation and links - El Forum - 02-26-2010

[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.