Giter Club home page Giter Club logo

laravel-twig's Introduction

laravel-twig's People

Contributors

dinhquochan avatar jvdyck avatar laravel-shift avatar tzkmx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-twig's Issues

str_* & array_* filters and functions not working

Hi, when using any of the str_* filters or functions (for example str_limit) I get an error:
Call to undefined method DinhQuocHan\Twig\Extensions\Str::camel()
The cause of this error seems to be a class name collision: the extension class is called Str, just like the original Laravel Illuminate Helper class Str.
There is also a problem with the $arguments in the callback function. I think it is missing the 'splat' operator .... The array_* functions have the same problem.
I already prepared a PR for these problems.

must be an instance of DinhQuocHan\Twig\Filesystem

hello ,
i got this error when i try composer require dinhquochan/laravel-twig

Symfony\Component\Debug\Exception\FatalThrowableError  : Argument 2 passed to
 DinhQuocHan\Twig\TwigViewClearCommand::__construct() must be an instance of 
DinhQuocHan\Twig\Filesystem, instance of Illuminate\Filesystem\Filesystem given, called in 
/cygdrive/e/myproject/vendor/dinhquochan/laravel-twig/src/TwigServiceProvider.php on line 132

 at /cygdrive/e/myproject/vendor/dinhquochan/laravel-twig/src/TwigViewClearCommand.php:46
    42|      * @param  \Illuminate\Foundation\Console\ViewClearCommand  $viewClearCommand
    43|      * @param  \Illuminate\Filesystem\Filesystem  $files
    44|      * @return void
    45|      */
  > 46|     public function __construct(ViewClearCommand $viewClearCommand, Filesystem $files)
    47|     {
    48|         parent::__construct();
    49|
    50|         $this->viewClearCommand = $viewClearCommand;

Session is not instantiable while building [DinhQuocHan\Twig\Extensions\Session

Hi!
I want to use Twig in Laravel Lumen, so I thought this package may be just what I need!

Is the package ready to use?

I run into this error:
Target [Illuminate\Contracts\Session\Session] is not instantiable while building [DinhQuocHan\Twig\Extensions\Session]

This is when I'm trying to access a test page
route:

$router->get('/twigtest', function () use ($router) { 
    return view('test');
});

test.twig:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Twig test</title>
</head>
<body>
        <h1>Twig test</h1>
</body>
</html>

Unnecessary instantiation of Foundation ViewClearCommand

Hi! I hit an error while trying to run view:clear command, that is thrown by Illuminate\Foundation\Console\ViewClearCommand.php, because the reference to $this->laravel inside that command is null.

Comparing both handle methods, from Foundation package and yours, seems like calling that is unnecessary because essentially runs almost the same logic, just deleting files rather than directories in views directory.

Sample of the exception thrown:

[2020-07-30 17:44:21] local.ERROR: View path not found. {"exception":"[object] (RuntimeException(code: 0): View path not found. at D:\\Users\\jefrancomix\\samaya\\laravel-cms-core\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\ViewClearCommand.php:57)
[stacktrace]
#0 D:\\Users\\jefrancomix\\samaya\\laravel-cms-core\\vendor\\dinhquochan\\laravel-twig\\src\\Console\\TwigViewClearCommand.php(35): Illuminate\\Foundation\\Console\\ViewClearCommand->handle()
#1 [internal function]: DinhQuocHan\\Twig\\Console\\TwigViewClearCommand->handle()

Somehow the laravel object inside the decorated command is not populated. My suggestion would be to rid of that call.

Support for Laravel 8.x

Hello, I get a requirements error when trying to add laravel-twig to my new Laravel 8.x project.

I think this could possibly be fixed by changing the requirements in composer.json from ^6|^7 to ^6|^7|^8. Ofcourse Laravel 6.x and 7.x should keep working for projects depending on it. If you'd like, I can create a PR for the suggested fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.