trongate / trongate-framework

The Trongate PHP framework
https://trongate.io
Other
1.12k stars 100 forks source link

Calling view inside view not working #160

Closed jppalmis closed 9 months ago

jppalmis commented 9 months ago

Hi,

Im calling this view inside a view

<?php $this->view('include_test');?>

and it gives me Fatal error: Uncaught Error: Using $this when not in object context

Am I doing it wrong?

trongate commented 9 months ago

If the view that you're trying to call is in the same folder then use require_once().

On Sat, 6 Jan 2024, 16:25 jppalmis, @.***> wrote:

Hi,

Im calling this view inside a view view('include_test');?>

and it gives me Fatal error: Uncaught Error: Using $this when not in object context

Am I doing it wrong?

— Reply to this email directly, view it on GitHub https://github.com/trongate/trongate-framework/issues/160, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAUDVOQXZQRMDS54GCIO3TYNF3JFAVCNFSM6AAAAABBPU6BNKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DQNZQHE3DSNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DaFa66 commented 9 months ago

If you need further assistance, I suggest you open a thread on the help_bar at https://trongate.io/help_bar

jppalmis commented 9 months ago

If the view that you're trying to call is in the same folder then use require_once(). On Sat, 6 Jan 2024, 16:25 jppalmis, @.> wrote: Hi, Im calling this view inside a view view('include_test');?> and it gives me Fatal error: Uncaught Error: Using $this when not in object context Am I doing it wrong? — Reply to this email directly, view it on GitHub <#160>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAUDVOQXZQRMDS54GCIO3TYNF3JFAVCNFSM6AAAAABBPU6BNKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DQNZQHE3DSNI . You are receiving this because you are subscribed to this thread.Message ID: @.>

Thanks! this solves the problem. and yes, Im trying to call a view from the same folder