我有一些PHP 5.3代码,它构建一个要传递给视图的数组.这是我的代码.
# Select all this users links.
$data = $this->link_model->select_user_id($this->user->id);
if (count($data) > 0) {
# Process the data into the table format.
$table = array
(
'properties' => array
(
'delete_link_column' => 0,
),
'callbacks' => array
(
# Callback for the name link.
function($value) {
return sprintf('<a href="/links/view/name/%s">%s</a>', $value, $value);
},
# Callback for the category link.
function($value) {
return sprintf('<a href="/category/view/name/%s">%s</a>', $value, $value);
},
# Callback for the creation date.
function($value) {
return date('jS M Y', …Run Code Online (Sandbox Code Playgroud)