flame-org / modules Goto Github PK
View Code? Open in Web Editor NEWNette modules on the Steroids
Home Page: http://flame-org.github.io/Modules/
License: GNU Lesser General Public License v3.0
Nette modules on the Steroids
Home Page: http://flame-org.github.io/Modules/
License: GNU Lesser General Public License v3.0
Je něco takového v plánu?
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
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?
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
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?
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?
I implemented the new way how to configure providers via intended Config interfaces.
Finally, the Modules will be configured in OOP way and David will be glad :)
Last thing what is missing is setup the routers according the new approach.
Any ideas who to do that? cc @TomasVotruba ? :)
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
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ě
Could you pls tag new version? I'd like to use stable tag in projects.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.