ytake / Laravel.Smarty

smarty template engine for laravel
MIT License
84 stars 24 forks source link

More consistent view name output with view composers #44

Closed JayBizzle closed 7 years ago

JayBizzle commented 7 years ago

Debugbar output before...

screen shot 2016-11-25 at 23 30 41

After... screen shot 2016-11-25 at 23 29 28

Don't merge this PR as I wanted your feedback before fully testing it and writing any test.

The main thing I don't like about this method is having to override the _subTemplateRender() method which is rather large. I couldn't see of any other way of getting the full file path to the sub template.

If you have any ideas, that'd be great

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-20.4%) to 78.319% when pulling 7e5d1c8a20fda87bc941f521f95a02c245843bd6 on JayBizzle:master into 4dd647b6287ef67e72742c3c7d4432463cd88171 on ytake:master.

ytake commented 7 years ago

Not firing for {include file='nav/test/test.tpl'} I tried to

    public function boot()
    {
        $this->app['view']->composer('nav.test.test', function (View $view) {
            $view->with('message', 123456789123456789);
        });
    }

expected event composing: nav.test.test but composing: test

ytake commented 7 years ago

I tried it again. https://github.com/ytake/Laravel.Smarty/blob/feature-issue44/src/Engines/SmartyTemplate.php#L52

2016-11-26 22 24 48

JayBizzle commented 7 years ago

Nice. That's looks very clean. You must have very thorough understanding of the Smarty internals!

Will test tonight, thanks!