madapaja / madapaja.twigmodule Goto Github PK
View Code? Open in Web Editor NEWBEAR.Sunday Module
License: MIT License
BEAR.Sunday Module
License: MIT License
Why release v2.0.0 ? I think it should be 1.x. (=1.2.0).
But wait, we need some other discussion for stable release.
@madapaja settingから変更お願いします
.twig
の方が.html.twig
より一般的ではないかと思ったのですがどうでしょうか?
/**
* return template file full path
*/
private function getTemplatePath(ResourceObject $ro) : string
{
if (isset($ro->templatePath) && ! empty($ro->templatePath)) {
return $ro->templatePath;
}
何かのプロパティ('templatePath')が特定のコンポーネント(Twig)にとって特別な意味がある設計というのはどうでしょうか? 特定プロパティに特別な意味を持たせて、外部がそれを目印に振る舞いを変えるのはCakePHPやLaravelなどでもありますがそれはどうでしょうか?
テンプレートはどこに置けばいいのだろうか、、、
https://twitter.com/madapaja/status/552062047580475392
0.x
と同じようにクラスファイルと同じ場所はどうでしょうか。
今のTwigModule
はデフォルトでdebugオプションがオンになってますが、これをオフにしたprod
コンテキスト用のモジュールが必要だと思いますがどうでしょうか。
TwigModule をinstallすると、Twig_Environment がDIされるようになるので、そのインスタンスを取得して、そこからextensionの追加などできそうですが、具体的にどこにどのように記述すればいいか
BEAR.Sundayのスケルトンから始めて再現するまでのコミットを、次のリポジトリへ積みました。
Kimita/twigmodule-issue@7546748
BEAR.Sunday のチュートリアル2:ticketsリソース で例示されているような Linkアトリビュート は、Madapaja.TwigModule の導入によってpageリソースのレンダラがHTML出力に変わると、pageリソース側では効かなくなるもよう。
BEAR\Resource\HalRenderer::renderHal()
内で行われているような処理がMadapaja\TwigModule\TwigRenderer
では行われていないことによるもののようだ。AnnotationResolver
で _embedded への埋め込みまでやってしまっている。しかし、BEAR.Sundayのチュートリアルで示されている内容からすると、Embedアトリビュートには触れずに「Linkアトリビュートを _links へ埋め込む」だけを処理対象とすべきなのかも?上記で示した回避策がもし妥当ならば、今回自作した AnnotationResolver
は次のように配置&使用されるのが理想か?
AnnotationResolver
(に相当するクラス)を提供するAnnotationResolver
(に相当するクラス)を任意使用する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.