Giter Club home page Giter Club logo

twig-tips's Introduction

twig-tips's People

Contributors

robmcfadden avatar

Stargazers

Sean Delaney avatar Cody Hopper avatar  avatar Rodrigo Passos avatar Ian avatar Chris Chapman avatar Barbara Cinotti avatar Tom Davies avatar Gareth Johns avatar Curtis Henson avatar Leighton Hughes avatar Jonathan McGaha avatar  avatar Allan Kukral avatar Dane Lindberg avatar  avatar Terry Upton avatar Gavin Platt avatar Dany Stadtmuller avatar John F Morton avatar Max Myers avatar Ransom avatar Michael Rog avatar Kyle Johnston avatar Fi Bennett avatar Dustin Walker avatar Patrick Nesbitt avatar Derek avatar Branden Garrett avatar Paulo Elias avatar Chase Giunta avatar Paulius Friedt avatar Fred Carlsen avatar Oliver Stark avatar

Watchers

Tim Kelty avatar  avatar Ian avatar James Cloos avatar

twig-tips's Issues

Error when calling `craft.modules` when using `setComponents` method in PHP module

First off, these are excellent and I didn't know about so much of this!

I've got a simple module here:

<?php
namespace modules\appmodule;

class AppModule extends \yii\base\Module
{
    public function init()
    {
        parent::init();

        $this->setComponents([
            'collection' => \Illuminate\Support\Collection::class,
        ]);
    }
}

But calling...

{% dd craft.modules.appmodule.collect([ 1, 3, 5 ]).avg() %}

throws a Twig Runtime Error noting the following:

Twig Runtime Error โ€“ Twig\Error\RuntimeError
Calling unknown method: craft\web\twig\variables\CraftVariable::modules()

Has Craft changed the syntax on invoking these component classes directly via Twig?

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.