Giter VIP home page Giter VIP logo

laravel-blade's People

Contributors

bradestey avatar geocine avatar jakezatecky avatar kiradotee avatar philonl avatar ryanhightower avatar visavi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-blade's Issues

Undefined variable referrs to Cache file

When there is an undifined variable in blade file it throws an error that is director to cache file rather then the blade file itself. Here is example

Notice: Undefined variable: post in /app/cache/5952d10558fadf03e7e98e30ca3073c9 on line 19

extend does not work

Hi,
I tried to use extend
like so

Blade::extend(function($value)
{
return preg_replace('/(\s_)@(break|continue)(\s_)/', '$1$3', $value);
});

I get
Call to undefined method Philo\Blade\Blade::extend()
Thank you.

Call to a member function make() on a non-object error after composer require

Hi !,
I did a composer require for this package. Then I started getting below error in my app.

["message"]=> string(48) "Call to a member function make() on a non-object" 
["file"]=> string(81) "/path/to/project/vendor/illuminate/support/Illuminate/Support/helpers.php" 
["line"]=> int(33) }

Below is my composer require output.

> composer require philo/laravel-blade 2.*                                                                                             
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing illuminate/support (v4.2.9)
    Loading from cache

  - Installing illuminate/filesystem (v4.2.9)
    Downloading: 100%         

  - Installing illuminate/container (v4.2.9)
    Loading from cache

  - Installing illuminate/events (v4.2.9)
    Loading from cache

  - Installing illuminate/view (v4.2.9)
    Downloading: 100%         

  - Installing philo/laravel-blade (v2.1)
    Downloading: 100%         

Writing lock file
Generating autoload files

I'm getting this error even though I didn't even start using this library, why is that?

Problem using $this in view

Hi, I'm trying to use the $this variable in a view using the Blade layout. I have already made a with('this', $viewObject)-> calling and when I make a var_dump of the $this variable it works just fine and says that it's the view object. But the moment I try to call any method inside it, launches the error Call to undefined method Illuminate\View\Engines\CompilerEngine::methodName()

Am I doing anything wrong?

I would like to get a Singleton instance always.

I want to get a singleton instance, that is; I instantiate the Blade Class once (automatically) and then use a static function like Blade::instance() to get the object instantiated already. In this way, I won't have to worry about new Objects being made everytime.

F3 uses the following function to get the desired effect. Can I somehow manage to do the same here?

static function instance() {
if (!Registry::exists($class=get_called_class())) {
$ref=new Reflectionclass($class);
$args=func_get_args();
Registry::set($class,
$args?$ref->newinstanceargs($args):new $class);
}
return Registry::get($class);
}

Update to Blade for L5.3

There were a few major additions to loops in L5.3, any chance to get them in your package? Thanks a lot!

How to fix error cache?

I have copied to Windows from Mac when running the browser, error message

include(/opt/lampp/htdocs/ecommerce/app/functions/../../bootstrap/cache/3c00fb5c6cc02832d7d184095ad221d65e528e2d.php): failed to open stream: No such file or directory (View: /opt/lampp/htdocs/ecommerce/resources/views/errors/404.blade.php)

Pls, give me the solution?

The cache directory files not refresh

Hello,

Thanks for this amazing thing so that I can use it outside of Laravel.

In development, when I change the blade file and reload the browser, the changes don't immediately show up until I delete all cache files.

How can I do the immediate change for this?

Thanks!

Unable to load view files in folders

Hey, thanks for providing such a useful library. I do have a small issue i have encountered. I have a directory structure as follows:

views
---- admin
------ user.blade.php

I am trying to load the view file using the code below :

echo $blade->view()->make('admin.user');

Unfortunately, this does not seem to be working. The view file is not loaded. Do you have any ideas?

Cheers

Releases

Can you please tag a release, so this can be installed via composer properly. Thanks!

Call to undefined Container::bindShared()

Hi, first of all thanks for your great package.

I'm using v3.* and when a run my project I get this error:

Fatal error: Call to undefined method Illuminate\Container\Container::bindShared() in C:\xampp\htdocs\superlogros\vendor\philo\laravel-blade\src\Blade.php on line 70

This is where I autoload the package

/sys/sys.php

require 'vendor/autoload.php';

use Illuminate\Database\Capsule\Manager as Capsule;
use Philo\Blade\Blade;

$database = new Capsule();
$database->addConnection([
    'driver'    => 'mysql',
    'host'      => 'localhost',
    'database'  => '...',
    'username'  => '...',
    'password'  => '',
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => 'web',
]);

$database->setAsGlobal();
$database->bootEloquent();

$views = '../views';
$cache = '../cache';

$blade = new Blade($views, $cache);

And this is my test file: /test.php

require 'sys/sys.php';

 echo $blade->view()->make('index')->render();

What I'm doing wrong?

Pd: Sorry for grammar mistakes, my English level is still low ๐Ÿ˜ƒ

Illuminate/View dependency is outdated

Why 4.1.* constraint have been used? For PHP 5.3 BC?

So can you begin i.e. 2.0 branch with 4.* constraint?
It should be safe for those consumers that install this library on 5.3 projects with 1.* version constraint.

How to Minify output

how to minify HTML/CSS/JS if i use your library??
any help will be great for me.
Thanks in advance..

Versioning

Version 2.3, ported from Laravel 5.0, should be marked as 3.0 since it is not backwards compatible.
Anyone pulling in "~2.*" will have a broken project on their hands.

Thanks ~

Blade's @inject

It doesn't work because the global function app() doesn't exist, put this somewhere before the Blade class is instantiated to make it work.

use Illuminate\Container\Container;

$container = new Container();
Container::setInstance($container);
$container = Container::getInstance();

if (! function_exists('app')) {
    /**
     * Get the available container instance.
     *
     * @param  string  $make
     * @param  array   $parameters
     * @return mixed|\Illuminate\Foundation\Application
     */
    function app($make = null, $parameters = [])
    {
        if (is_null($make)) {
            return Container::getInstance();
        }

        return Container::getInstance()->make($make, $parameters);
    }
}

Now injecting into the views works (it's basically instantiating a class of your choice using the Container) and you can also use this DI container for your app.

Lib not working when run in centos vps

I use and run on my pc, it work very well, but when i upload my project in Centos Vps, cache file is not create in cache folder. Help me resolve this issue. Thanks all

Can't use blade extend

I came across a problem today.
Wanted to extend blade so I can assign variables in the templates them self but It gave me the following error : "Call to undefined method Illuminate\View\Factory::extend()"

Is there someone who knows how to fix this ?
Greets Wouter.

Can I use view::composer ?

Does anybody now I can call the view composer ?

I try to run :

$this->blade->view()->composer('file');

Now I get this error :
Warning: Missing argument 2 for Illuminate\View\Factory::composer(), called in

How can I fix this ?

Unrecognized extension in file

Hello,

i'm using this package in a WordPress Environment,
basically i'm trying to let blade control my output however when more than one package using this class exists the engine cannot recognize the file extensions of blade templates

any ideas why the package would fire this error?

Cant get Blade::extend working

Hello,

I cant get my router extend function working.
Now I am wondering if I am doing this correctly or not.

Could somebody help me please.
Here is the code :

view : 

calling <p>@router('home')</p>

Outputted : <p><?php $router = new AltoRouter(); echo $router->generate(); ?>('home')</p>

blade extend : 
    $this->blade->getCompiler()->extend(function($view, $compiler)
    {
     $pattern = $compiler->createPlainMatcher('router');

     $replace = '<?php $router = new AltoRouter(); echo $router->generate($3); ?>';
     return preg_replace($pattern, $replace, $view);
    });

Is it possible to set the content tags

as you would in laravel?

\Blade::setRawTags('{+', '+}');

Update:

I see you can do getCompiler() and do it that way, but regardless of the tags I put, my app is still escaping HTML when I'm trying to echo an html string.

problem with arabic and persion characters in view compile

thanks for the package,
i am using this package without laravel (in my mvc framework) , but when i am using persian characters in .blade files , character will convert to ?????? in compiled view file ! how can i set utf8 and solve the problem ?

Cache files and git

Hello,

I've been using this for some time now and it has been working fine for me. I have a production and a development environment and using git branches for these.
Now suddenly I'm having issues with the blade cache files between these branches. How should these files be handled with git? Should the files be ignored og created directly on production or should I track them with git from the development?
Also when are these files regenerated in Blade?

Thanks in advance

Cannot end a section without first starting one.

After a composer update, every pages are broken, returning the following exception message :

( ! ) Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Cannot end a section without first starting one.' in /home/web/core/vendor/illuminate/view/Factory.php on line 564
( ! ) InvalidArgumentException: Cannot end a section without first starting one. in /home/web/core/vendor/illuminate/view/Factory.php on line 564

I suppose it's a regression issue introduced with the 5.2 version of illuminate packages ?

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.