Results 1 to 4 of 4

Thread: label format convertion

  1. #1
    User
    Join Date
    06-20-09.
    Posts
    64

    Default label format convertion

    Hi/
    I have wrote small extension which will select some data from database and show on on backend, (something similar to formAuto->show form values)

    I have a filed tstamp on my table, and I want to convert it values to normal format, like d-m-Y H:i:s.
    I can't find how to do this in doc's and on examples They all use %s

    'label' => array
    (
    'fields' => array(id, tstamp, name, email, photo1, descr1, photo2, descr2, photo3, descr3),
    'format' => 'Id=%s, Name: %s<span style="color:#b3b3b3; padding-left:3px;">[%s]</span>

    ...............................

    Thank you for your help.

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: label format convertion

    you have to use the label_callback to write your own method (function). The label format string is only used to display simple values.

  3. #3

  4. #4
    User
    Join Date
    06-20-09.
    Posts
    64

    Default Re: label format convertion

    Thank you thyon and Tru. You are save me!

    Tru you article is really (super!! ) helpful, maybe you could ask Leo to add it to cd_catalog tutorial?

    Thanks again for all.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •