fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

"oil generate admin/orm" generates an additional wrong template file #231

Closed sdrdis closed 9 years ago

sdrdis commented 10 years ago

Hi!

If I generate a scaffold using oil generate admin/orm, it generates an additional template file located at APPPATH/views/template.php, which is similar to the one at APPPATH/views/admin/templates.php. So when I generate a scaffold using oil generate scaffold/orm, the template file is not replaced, and I get an error since the template requires $current_user...

Thanks,

WanWizard commented 10 years ago

The scaffold template is public, and doesn't require (or use) a logged in user, the admin template is not public, requires a login, and uses $current_user. So they are different templates.

Are you saying that both are generated in the same app location? That would be very wrong...

WanWizard commented 10 years ago

Just ran a test here, and I don't see a problem, admin templates are generated separated from frontend templates. I see that the templates don't seem to be bootstrap 3 compatible, but that is another issue.

sdrdis commented 10 years ago

Hi,

I might not have been enough clear. I will show you exactly what I did:

First I installed Fuel:

git clone git@github.com:fuel/fuel.git
php composer.phar update

Then I generated an admin scaffold:

php oil generate admin/orm category name:string

Among the files that were generated, there are two templates: One at APPPATH/views/template.php, and one at APPPATH/views/admin/template.php. The problem is that both are exactly similar ; APPPATH/views/template.php seems incorrect, as it is checking for <?php if ($current_user): ?>.

Thanks,