Welcome Guest, Not a member yet? Register   Sign In
How to use LayoutView with parser?
#11

As the Codeigniter 4 manual says, you can use the following:
PHP Code:
    $data = [
            'blog_title'  => 'My Blog Title',
            'blog_heading' => 'My Blog Heading'
    ];
    
    
echo $parser->setData($data)
                ->render('blog_template'); 
Reply
#12

It is important feature missing in CodeIgniter.
But here is the working solution
PHP Code:
$data['title'] = 'CI4 Tutorial';        
$view view('welcome_page');
echo 
$parser->setData($data)->renderString($view); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB