سلام استاد
در فراخوانی این تابع چه مشکلی وجود دارد؟
خطا اینه:
در فراخوانی این تابع چه مشکلی وجود دارد؟
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <?php function Display( $comment ){ $name = CHtml::encode( $comment ->name); $date = JDF::jdate( 'l Y/m/d - h:i.a' , $comment ->create_time); $body = nl2br (CHtml::encode( $comment ->comment )); echo <<<EOT <div class = "panel panel-info" > <h3 class = "panel-heading" >{ $name }</h3> <p class = "text-muted" >نوشته شده در تاریخ { $date }</p> <p class = "panel-body" >{ $body } EOT; $criteria = new CDbCriteria(); $criteria ->addColumnCondition( array ( 'parent_id' => $comment ->id, 'cnfirm=1' )); $criteria ->order= 'id ASC' ; $comments = Comments::model()->findAll( $criteria ); if ( $comments ){ array_walk ( $comments , 'Display' ); } echo <<<EOT </p> </div> EOT; } ?> <?php if ( $comments ): ?> <div class = "well" > <h2>نظرات کاربران</h2> <hr /> <?php array_walk ( $comments , 'Display' ); ?> </div> <?php endif ; ?> |
نقل قول:Trying to get property of non-object