在Controller.php中更正语法

In View.php file <?php echo $ticket->player_id ?> is working. But in controller.php it is not working. What is the correct syntax for Controller.php?

I am trying to use it here

'include_player_ids' => array('<?php echo $ticket->player_id ?>'),

The following is the sample code from controller file which are working properly

// Send Email
            $email_template = $this->home_model->get_email_template_hook("ticket_reply", $lang);
            if($email_template->num_rows() == 0) {
                $this->template->error(lang("error_48"));
            }
            $email_template = $email_template->row();

            if(isset($ticket->client_username)) {
                $username = $ticket->client_username;
                $email = $ticket->client_email;
                $first_name = $ticket->first_name;
                $last_name = $ticket->last_name;
            } else {
                $username = $ticket->guest_email;
                $email = $ticket->guest_email;
                $first_name = $ticket->guest_email;
                $last_name = "";
            }

Its already in php tags so you do not need to place <?php ?> again just assign variable directly

'include_player_ids' => array($ticket->player_id),

It should be

'include_player_ids' => array($ticket->player_id),

Please post the output of $ticket

In controller.php ,

$data['ticket'] = 'your data will be here';

In view.php,

'include_player_ids' => array($ticket->player_id),

Hope you understand.