Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a really simple if statement that I want to do a calculation on the row_count with php output I can echo out '{row_count}' just fine, however any modificaiton don't seem to work.

I'm using php because of other complex calculations that output a number.

Here is the basics of what I'm trying to run.

{matrix} 
    <?php
        $x = '{row_count}';
        $y = xxx; //some calculated value
        echo $x; //works
        echo (int)$x; //0

        if('{row_count}' ==  $y){
            //do stuff
        }
    ?>
{/matrix}

Side Note: I've tried to create a count++ variable, and it doesn't seem to increase. I think matrix might just be parsed in a strange way.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.