0

I'm converting an old Smarty template setup into strict HTML/CSS + PHP. Can someone explain what the snippet of code is doing?

$grading_periods[gps].grading_period

Here is the line of code that assigns it.

$tpl->assign('grading_periods',$grading_periods);

Thanks

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by cwarn23
0

It's probably an array, where in the template it is used inside a foreach loop. Without more of the tpl it is hard to say.

0

$grading_periods[gps].grading_period

That basically tells the server to append a constant to an array and the constant grading_period would have been made with the define() function.

$tpl->assign('grading_periods',$grading_periods);

That on its own would be invalid code so in other words that code has been made possible by code before it. And guessing it assigns the string grading_periods or the constant grading_periods with a variable to its parrent.

Without seeing all of the code I can only guess that is what is happening but there is a good chance the answer to the first quote is right.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.