Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • General
  • Add-on Creation and Modification
  •  
  • Is it a problem to use the same variable names in different snippets? [Solved]#

  • 10378
    58

    gadgetto Reply #1, 3 months, 2 weeks ago

    Reply
    • Link to this post#1
    Hello,

    I'm a complete noob in developing snippets and also in writing php code - so here is my first question:
    Is it a problem to use the same variable names in 2 different snippets which are both used in the same template?

    How are snippets executed?

    Greetings,
    Martin


  • 3548
    79
    Antonio Zdilar
    Linear Vector d.o.o.
    linearvector.com | MODX Professional Partner

    blankcheck Reply #2, 3 months, 2 weeks ago

    Reply
    • Link to this post#2
    No, not a problem.

    http://rtfm.modx.com/display/revolution20/Snippets


  • 3548
    79
    Antonio Zdilar
    Linear Vector d.o.o.
    linearvector.com | MODX Professional Partner

    blankcheck Reply #3, 3 months, 2 weeks ago

    Reply
    • Link to this post#3
    Snippets basically become php functions, and snippet variables are local variables to that function - that is why you can use same names. That is a bit simplified, but you get the idea


  • 10378
    58

    gadgetto Reply #4, 3 months, 2 weeks ago

    Reply
    • Link to this post#4
    Quote from: blankcheck at Feb 09, 2012, 02:36 PM
    No, not a problem.

    http://rtfm.modx.com/display/revolution20/Snippets

    Thanks for your fast answer!
    I already read through the whole snippet manual but can't find much informations regarding the usage of variables.





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
blankcheck, gadgetto

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy