0

我试图了解当我运行 btn_actions 函数时,我没有返回任何东西。我试图让两个按钮在我的桌子上回显。

echo $this->functions_model->btn_actions(1);
die();

public function btn_actions($item_id)
{
    $content = '<div class="controls center">';
    $content = $this->btn_edit($item_id);
    $content = $this->btn_delete($item_id);
    $content = '</div>';

    return $content;
}

public function btn_edit($item_id)
{
    $button = '<a class="tip" href="'. current_url() . '/edit/' .  $item_id  .'" oldtitle="Edit Task" aria-describeby="ui-tooltip-8"><span class="icon12 icomoon-icon-pencil"></span></a>';
    return $button;
}

public function btn_delete($item_id)
{
    $button = '<a class="tip" href="'. current_url() . '/soft-delete/' . $item_id .'" oldtitle="Delete Task"><span class="icon12 icomoon-icon-remove"></span></a>';
    return $button;
}
4

2 回答 2

2

您需要连接使用.

$content = '<div class="controls center">';
$content .= $this->btn_edit($item_id);
$content .= $this->btn_delete($item_id);
$content .= '</div>';

return $content;
于 2013-02-01T04:44:36.813 回答
1

试试这个 :

echo $this->functions_model->btn_actions(1);
die();

public function btn_actions($item_id)
{
   $content = '<div class="controls center">';
   $content = $content . $this->btn_edit($item_id);
   $content = $content . $this->btn_delete($item_id);
   $content = $content . '</div>';
   return $content;
 }

public function btn_edit($item_id)
{
   $button = '<a class="tip" href="'. current_url() . '/edit/' .  $item_id  .'" oldtitle="Edit Task" aria-describeby="ui-tooltip-8"><span class="icon12 icomoon-icon-pencil"></span></a>';
   return $button;
}

public function btn_delete($item_id)
{
    $button = '<a class="tip" href="'. current_url() . '/soft-delete/' . $item_id .'" oldtitle="Delete Task"><span class="icon12 icomoon-icon-remove"></span></a>';
   return $button;
}
于 2013-02-01T04:42:44.670 回答