function farm_asset_view in farmOS 7
Asset view callback.
Parameters
FarmAsset $farm_asset: The farm asset entity.
Return value
array Returns the entity render array.
4 string references to 'farm_asset_view'
- farm_asset_farm_asset_view_menu_alter in modules/
farm/ farm_asset/ includes/ ctools/ farm_asset_view.inc - Callback defined by farm_asset_farm_asset_view_farm_asset_tasks().
- farm_asset_farm_asset_view_page in modules/
farm/ farm_asset/ includes/ ctools/ farm_asset_view.inc - Entry point for our overridden farm_asset view.
- farm_asset_menu in modules/
farm/ farm_asset/ farm_asset.module - Implements hook_menu().
- _farm_ui_menu_local_tasks_alter in modules/
farm/ farm_ui/ farm_ui.action_links.inc - Helper function for adding farmOS action links.
File
- modules/
farm/ farm_asset/ farm_asset.pages.inc, line 17 - Farm asset pages.
Code
function farm_asset_view(FarmAsset $farm_asset) {
// Set the page title.
drupal_set_title(entity_label('farm_asset', $farm_asset));
// Build the asset's render array.
$build = entity_view('farm_asset', array(
entity_id('farm_asset', $farm_asset) => $farm_asset,
), 'full');
// Return the render array.
return $build;
}