Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2014, 11:04 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,387
IntoRain is on a distinguished road
Default Assigning array to smarty variables

Hi. I've been changing the theme around now that Kyttias made it possible to use bootstrap, and I wanted to know where I could assign an array to the smarty variables. I found a way to add native variables through the frame class, but it seems hashmaps don't take arrays :(
__________________


asp.net stole my soul.
Reply With Quote
  #2  
Old 06-01-2014, 12:14 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 335,082
Hall of Famer is on a distinguished road
Default

Well standard smarty array assignment works like this:

PHP Code:
$myArray = array('no' => 10'label' => 'Peanuts'); $smarty->assign('foo',$myArray); 
In this script I made a class called Template inheriting the parent Smarty class, and the assign method still works. The template object is stored inside the mysidia object from registry, you can access it like this:

PHP Code:
$mysidia Registry::get("mysidia");
$mysidia->template->assign('arrayname'$array); 
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 06-01-2014, 12:31 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,387
IntoRain is on a distinguished road
Default

OOoh! Thank you! I've been messing around with the class_frame render() function and arrays didn't work obviously xD I've been doing it wrong all along xD Thank you! That solves it! ^^
__________________


asp.net stole my soul.
Reply With Quote
  #4  
Old 06-03-2014, 02:06 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 335,082
Hall of Famer is on a distinguished road
Default

Glad I can be of any help. ^^
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
smarty questions Kyttias Questions and Supports 12 06-20-2014 10:41 PM
Smarty errors and WAMPP Kesstryl Questions and Supports 15 01-29-2014 09:07 PM
Problem: smarty class 1.3.4 draugluin Questions and Supports 8 11-15-2013 02:29 AM
Assigning User Groups GuardiansWish Questions and Supports 2 06-19-2012 04:51 PM


All times are GMT -5. The time now is 05:10 PM.

Currently Active Users: 9803 (0 members and 9803 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636