CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • remove dash (-) from all variables
Pages: [1]

Author Topic: remove dash (-) from all variables  (Read 2481 times)

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
remove dash (-) from all variables
October 27, 2009, 07:29:10 am
I'd like to propose that all variable constructions currently using dashes be replaced by underscores. The constructions are most prevalent with addresses, phones, emails, etc. -- such as "street_address-5" where the "-5" indicates the address type.

The use of dashes is problematic for both smarty vars and javascript, requiring workarounds that clutter code.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: remove dash (-) from all variables
October 29, 2009, 04:18:57 am
Quote
"street_address-5"

Here "-" stands for location type. So when form etc is submitted its easy to split field name and location type.

Kurund
Found this reply helpful? Support CiviCRM

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: remove dash (-) from all variables
October 29, 2009, 04:28:27 am
Right...
But when passed to the smarty template it has to be re-assigned as smarty won't play with variables containing dashes. It seems to me that variable issue should be fixed before it's passed to smarty so we don't have to deal with it in the template.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: remove dash (-) from all variables
October 29, 2009, 10:18:26 am

yes, this is a fairly substantial project and not sure whether it is really "worth" it.

We'll have to change the code/protocol in quite a few php/tpl files

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • remove dash (-) from all variables

This forum was archived on 2017-11-26.