[drupal-devel] Use more constants?

Adrian Rossouw adrian at bryght.com
Sat Jul 23 19:02:28 UTC 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Busy doing some menu things, and I was wondering why we are using  
strings for the properties, when constants would be more readable imo.

  $items[] = array('path' => 'admin/display/regions/configure',  
'title' => t('configure block'),
       'access' => user_access('administer blocks'),
       'callback' => 'block_admin_configure',
       'type' => MENU_CALLBACK
);

versus

  $items[] = array( path => 'admin/display/regions/configure', title  
=> t('configure block'),
       access => user_access('administer blocks'),
       callback => 'block_admin_configure',
       type => MENU_CALLBACK
);

The only place I see it being impossible to use constants would be  
'callback arguments' , and imo ..
arguments => array(1, 2, 3)
is far more readable than :
'callback arguments' => array(1, 2, 3)


I'm not trying to champion a cause or anything, I was just wondering  
what the reasoning behind it was.






- --
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFC4pQ7gegMqdGlkasRAkR7AKDP81L84gC6NKI/wmyKq4eO8HXgiQCgo4mi
P2FUnoK2/9TZruEhOUeyA3o=
=1o10
-----END PGP SIGNATURE-----



More information about the drupal-devel mailing list