[eluser]Unknown[/eluser]
Hello, the answer is probably very obvious but I can't seem to find it. I have the following plugin, in system/applications/plugins/rounded_pi.php
Code:
function rounded($number) {
global $row_background;
$divided = $number / 2;
if (strstr($divided, ".")) {
$row_background = "even";
} else {
$row_background = "odd";
}
}
and in my controller,
Code:
function Participants() {
parent::Controller();
$this->load->plugin('rounded');
}
No matter what I've tried I can't access $row_background in my view- (I did add "return $row_background;" but that didn't work either) I know the function is loading, if I add echo $row_background; it shows up each time the function is called, but outside the function I get "undefined variable $row_background".
For what it's worth, the function doesn't return anything even if I place it in the view- it's worked in past non-CI projects as a function called from an include file- but this is my first time inside CI, and I'm wondering if there's something that I'm missing specific to CI.
Thanks-