Skip to content

Instantly share code, notes, and snippets.

@mmarum-sugarcrm
Created March 25, 2015 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmarum-sugarcrm/6e38261a534854137ba6 to your computer and use it in GitHub Desktop.
Save mmarum-sugarcrm/6e38261a534854137ba6 to your computer and use it in GitHub Desktop.
Using Name and Type in View Definitions in Sugar 7
$viewdefs['base']['layout']['foo'] = array(
'components' => array(
array(
'layout' => 'header', //reference another definition
),
array(
'layout' => array( //directly include definition
'components' => array(
array(
'view' => 'title', //reference another definition
),
array(
'view' => 'content', //reference another definition
),
),
'type' => 'base',
'name' => 'my-custom-main',
),
),
),
'type' => 'foo',
'name' => 'my-custom-page'
),
$viewdefs['base']['view']['foo'] = array(
'buttons' => array( //directly include definition
array(
'type' => 'button',
'name' => 'cancel',
),
array(
'type' => 'button',
'name' => 'save',
),
),
),
$viewdefs['base']['layout']['foo'] = array(
'components' => array(),
'type' => 'foo',
),
$viewdefs['base']['view']['foo'] = array(
'buttons' => array(
array(
'type' => 'button',
'name' => 'save',
),
),
'name' => 'bar',
),
$viewdefs['base']['layout']['foo'] = array(
'components' => array(),
'type' => 'foo',
'name' => 'bar',
),
$viewdefs['base']['view']['foo'] = array(
'buttons' => array(),
'type' => 'foo',
'name' => 'bar',
'template' => 'detail',
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment