HansSchouten / PHPageBuilder

A drag and drop page builder to manage pages in any PHP project
https://www.phpagebuilder.com
MIT License
739 stars 180 forks source link

Unclear integration between generated PHP files and blade files #56

Open asicode24 opened 3 years ago

asicode24 commented 3 years ago

Hi Hans,

Is there any integration bridge between generated .PHP file and .blade.PHP file. We found it that generated PHP files can’t be connected to Laravel models as core PHP files doesn’t support blade directive. Any comments would be great.

Many Thanks!

HansSchouten commented 3 years ago

Hi, yes currently there is no blade support. I have already noted this as a possible improvement, but at the moment I unfortunately don't have the time and necessity to add this right away.

asicode24 commented 3 years ago

Hi Hans, Can you explain the use case here if we are not able to connect the models with the generated php view file.

Regards, Asif

HansSchouten commented 3 years ago

Everything that can be done using blade should be already possible in a plain and simple view.php file, also in non-Laravel projects Blade is not always used. My clients and myself are using it without any issues. However, I agree we could save a few characters and add support for @if() instead of <?php if(): ?>, but I haven't had the time and need to look into how we could combine this.

asicode24 commented 3 years ago

Hi Hans,

yes you are right, everything can be achievable in simple plaint PHP even within the laravel framework.

Regards, Asif

jorgeepena commented 1 year ago

If you want to include a blade file you can use the following:

<?php echo view('welcome'); ?>

Put the echo inside view.php in the blocks of your theme folder. Ensure the blade file exists inside the resources/views folder so it can load.

In the example 'welcome' would be the default blade that laravel has on that folder but you can use whatever name or reference a file inside a folder as any PHP route you are accustomed to.