GithubHelp home page GithubHelp logo

flame-org / modules Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 7.0 809 KB

Nette modules on the Steroids

Home Page: http://flame-org.github.io/Modules/

License: GNU Lesser General Public License v3.0

PHP 99.74% HTML 0.26%

modules's People

Contributors

budry avatar frosty22 avatar jirinapravnik avatar jsifalda avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

modules's Issues

Nelze užít vnořené routelisty

Chtěl jsem využít novou syntax, kdy není třeba využívat NetteRouteListMocky. Ale Pokud mám např:

$appList = new RouteList('App');
$appList[] = $frontList = new RouteList('Front');

$frontList[] = new Route('/<presenter>/<action>', 'Homepage:default');
$frontList[] = new Route('index.php', 'AHomepage:default', Route::ONE_WAY);

tak dostanu Argument 1 passed to Flame\Modules\DI\ModulesExtension::createNetteRouteMock() must be an instance of Nette\Application\Routers\Route, instance of Nette\Application\Routers\RouteList given

Add Route priority

It will be nice to be able to define priority of the routes. When using more extensions or extension with Nette's RouterFactory, I'll need to be able to define priority. Now it will add the router from module at the end.
Not sure how to define or where it will had to be implemented.

Extension1:

/**
 * @priority 2
 */
public function getRoutesDefinition() { ..... }

Extension2:

/**
 * @priority 1
 */
public function getRoutesDefinition() { ..... }

Even if extension2 is initialized after extension1, it will add the router before router from extension2, because it has higher priority.

Would that be possible or right now this is limitation in Nette?

HelperProvider ve dvou extensionach: "Service '24.helperProvider.0' has already been added."

Pokud použiju konfiguraci helperů, dle tohoto rázu:
https://gist.github.com/jsifalda/7f570f94974b62163117

tak když mám ve dvou extension. Padne mi to na tomto: Service '24.helperProvider.0' has already been added.

Problém je na tomto řádku: https://github.com/flame-org/Modules/blob/master/Flame/Modules/DI/ModulesExtension.php#L191 - protože to přebírá $key z pole... ale nevim, jak to lepe vyresit

Licence

Nechceš to uvolnit pod nějakou mírnější licencí, aby se to dalo použít i do komerčních projektů? Mit licence např? Nebo alespoň LGPL?

Jak přidat helpery pro templates?

Doufám, že se může využívat Issues i pro dotazy...

Jak se přidávají helpery pro templates?

Mám tohle v extension

public function getHelpersConfiguration()
{
    return array(
        'thumbnail' => 'JiriNapravnik\Latte\Helpers\Common::thumbnail',
        'dateCzech' => 'JiriNapravnik\Latte\Helpers\Common::dateCzech',
    );
}

v sestaveném kontejneru mám správně vygenerováno pod service, která vrací template:

$service->registerHelper('thumbnail', 'JiriNapravnik\Latte\Helpers\Common::thumbnail');
$service->registerHelper('dateCzech', 'JiriNapravnik\Latte\Helpers\Common::dateCzech');

ale v šabloně dostávám, že nezná
Nette\Templating\FileTemplate::thumbnail

druhá věc jde nějak v extension registrovat helper loader?

S klasickym Route nefunguje FILTER_TABLE

Pokud použiju RouteMock v definici extension jako tohle

$frontList[] = new NetteRouteMock('//' . $serverMainUrl . '/<articleUrl [a-z\-]+/[0-9]+-[a-z0-9\-]+>/forum[/podle-<view>]', [
    'presenter' => 'Discussion',
    'action' => 'article',
    'view' => [
        Route::FILTER_TABLE => [
            'casu' => 'time',
            'vlaken' => 'thread',
        ],
        Route::FILTER_STRICT => TRUE,
    ]
);

tak bez problemu funguje jak očekáváme.

Pokud ovšem udělám:

$frontList[] = new Route('//' . $serverMainUrl . '/<articleUrl [a-z\-]+/[0-9]+-[a-z0-9\-]+>/forum[/podle-<view>]', [
    'presenter' => 'Discussion',
    'action' => 'article',
    'view' => [
        Route::FILTER_TABLE => [
                'casu' => 'time',
            'vlaken' => 'thread',
        ],
        Route::FILTER_STRICT => TRUE,
           ]
    ]
);

tak se uplne ignoruje to co jsme nastavil pro parametr. Problem je nejspise v tomhle: https://github.com/flame-org/Modules/blob/master/Flame/Modules/DI/ModulesExtension.php#L252 getDefaults() totiz nevraci vsechna metadata

Nezaregistrují se moduly

Nevím, jak to dělám, že vždycky když aktualizuji, tak mi to přestane fungovat:-)

Vůbec se mi nezaregsitrují moduly a končím na exeption "Extension must be class name (string) or instance of \Nette\DI\CompilerExtension". Jako poslední mi funguje commit: d278f30 - ten merge pull ode mě

Nelze mít více nepojmenovaných modulů

Po commitu 375c4d1 mi přestaly fungovat nepojmenované moduly. Problém jsem vyzjistil je v souboru NamedExtension a metody: getShortName . Jelikož v podstatě nedělá co by měla, a když je více nepojmenovaných modulů, tak všechny mají ten první název díky statické property. Mě pomohlo ten if zakomentovat nebo vyodit statičnost, ale třeba s tím máš nějaké jiné úmysly a někde je to více provázano

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.