fenom-template / Laravel.Fenom

Fenom Template Engine for Laravel 5
MIT License
5 stars 3 forks source link

Support for views in packages #5

Open pun-ky opened 9 years ago

pun-ky commented 9 years ago

Hi! Thx for Fenom adapter for Laravel, but I cannot use it.

My application is built from multiple packages and each package has their own views. While using blade I was used to just reference view from concrete package by writing `view('my_package::some.template') but your adapter seems to not support that case.

I got: Provider for 'my_package' not found

    public function getProvider($scm = false)
    {
        if ($scm) {
            if (isset($this->_providers[$scm])) {
                return $this->_providers[$scm];
            } else {
                throw new InvalidArgumentException("Provider for '$scm' not found");
            }
        } e

Is it a chance to improve it?

Going futher config parameter:

    'template_path' => base_path() . '/resources/views/fenom',

seems to be not legit, because we can have multiple directories with views...

For more info see: http://laravel.com/docs/5.1/packages#views

Maybe it will be more nice if FenomViewServiceProvider will register Fenom template engine alongside Blade using:

http://laravel.com/api/5.1/Illuminate/View/Factory.html#method_addExtension

pafnuty commented 9 years ago

@bzick, @maxicms need your help :flashlight:

pun-ky commented 9 years ago

Temporarily I implemented such simpler adapter available here: https://github.com/neva-dev/laravel-fenom

maxisoft-git commented 9 years ago

Today I'll try to make changes to the code to support multiple templates directory