Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Location
    United States
    Posts
    7

    Default Modify single item of smarty array...

    Hi,

    Here's an example:

    Code:
    _tpl_vars: Array
      (
        [clientsstats] => Array
            (
                [numpaidinvoices] => 0
                [paidinvoicesamount] => $0.00 USD
                [numdueinvoices] => 0
    So I wanted to modify/assign numdueinvoices, I'd use the following:

    $smarty->assign('clientsstats', array('numdueinvoices' => 123456));

    Issue with the above is that it will kill the other items of the array. I'd like to know how to modify a single item of said array without destroying the other items. Any ideas truly welcomed.
    Victor Lugo

  2. #2
    Join Date
    Oct 2009
    Location
    Aruba / Seychelles
    Posts
    410

    Default

    In your template file, you can add:
    PHP Code:
    {php}$this->_tpl_vars['clientsstats']['numdueinvoices'] = "value";{/php

Similar Threads

  1. Array ['configoptions']
    By X3non in forum Technical Issues and Questions
    Replies: 1
    Last Post: 03-27-15, 08:59 PM
  2. Array in Domains
    By rjsorto in forum Technical Issues and Questions
    Replies: 1
    Last Post: 06-09-09, 02:23 AM
  3. Step 2, accessing array
    By bear in forum Technical Issues and Questions
    Replies: 2
    Last Post: 10-13-07, 02:44 PM
iron-diatonic