Hello everyone!
I am developing a module using/for Drupal 6.x. There is an option in the menu, you click it and I call a function that will render a list of characters (new content type that extends node). A template is used for that purpose via the theme() function.
In each record there is this last column of the table that links to the actual node, so that you can view the profile of that character. At present moment I am using:
function template_preprocess_roster(&$variables) {
foreach ($variables['roster'] as $id => $char) {
$variables['roster'][$id]->link = url("node/$char->nid");
}
Then, in the template, I just print $node->link in the appropriate place.
Now the thing is that this could also be done by not using the above code in the function template_preprocess_roster and, instead, using the l() function in the template, like this:
print l(t('details'), 'node/'. $char->nid);
Question for the gurus: which one is more correct (i.e. more appropriate, better, abides by the coding standards the best, suits best the architecture/philosophy of Drupal)?
Thanks in advance.