Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
getting to $smarty sub-arrays
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 08/10/09 22:25 
This should be a straight forward, but im having trouble.

How do i get to the arrays buried in the smarty array. It seams really obvious but its not working how i expect it to work.

inside the $smarty array is:

Code

  [_cache_include] =>
    [_cache_including] =>
    [_supers] => Array
        (
            [get] => Array
                (
                    [uf_name] => Some_Punk_Band
                    [uf_path] => /
                )

            [post] => Array
                (
                )

            [server] => Array
                (



so i wrote some code to find the keys:

Code
     foreach ($smarty as $key => $value){
     print "the key is: \t$key <br>";
     print "the value is: \t$value <br>";
     }

produces the output
.....
the key is: _supers
the value is: Array
....

so i would expect that

Code
     foreach ($smarty[_supers] as $key => $value){
     print "the key is: \t$key <br>";
     print "the value is: \t$value <br>";
     }

would produce
.....
the key is: get
the value is: Array
....

only i cant seam to get to those subarrays. I need the values that are in
$smarty._supers.post

any ideas as to what the format should be?

(I want to get the post variables while inside a custom smarty function inside a module)


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 08/10/09 22:47 
found a way around it.

global $_POST; Rolling Eyes

Smile


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 08/11/09 00:01 
and the answer to the other arrays listed is, that what prints like an array when printed with print_r() is actually an object and so must be accessed with the syntax:

Code
$smarty->post


Smile


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.