Welcome Guest, Not a member yet? Register   Sign In
passing variable - shows invalid variable ...
#5

(This post was last modified: 03-09-2025, 09:33 PM by InsiteFX. Edit Reason: Updated content )

What version of CodeIgniter 4 are you running?

Another thing you can try is this:

PHP Code:
// Views/data.php

<?php


// Controller

public function index()
{
    $data = [
        'js_to_load' => 'Testing'
    ];

    return view('data'$data)
        view('your_view');



Did you try passing it like this?

PHP Code:
$data["js_to_load"] = "hello"
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: passing variable - shows invalid variable ... - by InsiteFX - 03-09-2025, 02:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB