Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction of Thinreports for PHP
Search
Katsuya Hidaka
June 27, 2015
Technology
0
6.5k
Introduction of Thinreports for PHP
PHP カンファレンス 2015 福岡で、Thinreports の PHP 実装を作ったよという話をしたときのスライド
Katsuya Hidaka
June 27, 2015
Tweet
Share
More Decks by Katsuya Hidaka
See All by Katsuya Hidaka
後方互換の保ち方 / How to Maintain Compatibility
hidakatsuya
0
840
HTML帳票 / Frontend Study Group in Sannin 3rd
hidakatsuya
0
3.2k
2006-2016 Ruby, OSS, Thinreports/matsue-rubykaigi08-LT
hidakatsuya
0
450
prpr でプルリクエスト運用を自動化する /Introduction-of-prpr
hidakatsuya
0
3.5k
AgileJapan2016 Shimane Session2-2
hidakatsuya
0
2.2k
Other Decks in Technology
See All in Technology
Denoで作るチーム開発生産性向上のためのCLIツール
sansantech
PRO
0
120
The future we create with our own MVV
matsukurou
0
990
知っててうれしい HTTP Cookie を使ったセッション管理について
greendrop
0
100
AWSの生成AIサービス Amazon Bedrock入門!(2025年1月版)
minorun365
PRO
7
330
Evolving Architecture
rainerhahnekamp
2
180
スケールし続ける事業とサービスを支える組織とアーキテクチャの生き残り戦略 / The survival strategy for Money Forward’s engineering.
moneyforward
0
210
OPENLOGI Company Profile for engineer
hr01
1
17k
Wantedly での Datadog 活用事例
bgpat
2
1.2k
大規模言語モデルとそのソフトウェア開発に向けた応用 (2024年版)
kazato
2
430
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
28
25k
20241125 - AI 繪圖實戰魔法工作坊 @ 實踐大學
dpys
1
430
rootful・rootless・privilegedコンテナの違い/rootful_rootless_privileged_container_difference
moz_sec_
0
100
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
44
13k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
How STYLIGHT went responsive
nonsquared
96
5.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
RailsConf 2023
tenderlove
29
960
Building Adaptive Systems
keathley
38
2.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Done Done
chrislema
182
16k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Transcript
ؔ٦فٝا٦أז䌘牰 خ٦ٕ⡲ת׃կ PHP Conference FUKUOKA 2015
ߴ ࠀ Ruby, PHP Thinreports ͷ։ൃऀ
SIɾσʔληϯλʔɾӡ༻ɾσʔλΤϯτϦʔ
αϚϦʔ Thinreports ͍ͬͯ͏Φʔϓϯιʔεͷாථπʔ ϧ͕͢Ͱʹ͋ͬͯɺͦͷPHP൛Λ࡞ͬͨΑɺͱ ͍͏ɻ
Thinreports ͱ • Ruby Ͱ͑ΔΦʔϓϯιʔεͷாථπʔϧ • ϨΠΞτσβΠφʢEditorʣͱ PDFग़ྗϥΠϒϥϦʢGeneratorʣ • Ҏ߱ɺͪ͜ΒΛʮຊՈʯͱݺͼ·͢
None
None
None
Editor Layout File (.tlf) Script (Generator)
PHP ൛ Thinreports • Ҏલ͔Βཁଟ • Generator ͷ PHP ࣮
• Editor ڞ௨
Editor Layout File (.tlf) Script (Generator) ࠓճ࡞ͬͨͷίί
thinreports-php • Status: dev-master • PHP >= 5.6 PHP7, HHVM
ಈ࡞ະ֬ೝ • The MIT License ճΓͰͬͯΔ TCPDF LGPLv3 Ͱ͋Δ͜ͱʹҙ • Pure PHP
None
None
Hello thinreports-php
Setup. Install thinreports-php $ vi composer.json : “require”: { “thinreports-php/thinreports-php”:
“dev-master” } : $ composer install
Setup. Install Editor
1. Create a layout file ID Λ “world”
2. Write code use Thinreports; $report = new Thinreports\Report('hello_world.tlf'); $page
= $report->addPage(); $page->item('world')->setValue('World'); // ҎԼͷΑ͏ʹॻ͚Δ: // $page(‘world’)->setValue(’World’); // $page->setItemValue(‘world’, ’World’); // $page->setItemValues([‘world’ => ’World’]); $report->generate('hello_world.pdf');
3. Run $ php hello_world.php ↩︎
4. Finish
ͦͷଞͰ͖Δ͜ͱ • ͪΖΜຊޠ OK • ը૾ͷ੩త/ಈతషΓ͚ • ਤܗɾςΩετͷಈతͳελΠϧมߋ • ϖʔδ൪߸ͷࣗಈදࣔ
• ؆қॻࣜઃఆʢ࣌ࠁɺɺࣈ٧Ίʣ ͳͲͳͲɻৄࡉຊՈެࣜαΠτΛͲ͏ͧɻ
ͱ͍͑ɺ·ͩ։ൃόʔδϣϯ • ϦετπʔϧະରԠ • ෳ߹ϨΠΞτະରԠ ൺֱత؆୯ʹͰ͖Δɻ͜ͷޙʹͰରԠ͢Δ • ϑΥϯτͷϑΥʔϧόοΫະରԠ ͜Ε͕ຯʹҰ൪ͷ՝ •
ύϑΥʔϚϯεɾϝϞϦʔফඅͷվળ IPAϑΥϯτΛ TCPDF ༻ʹม͢Δίετ͕ߴ͍ɻࣄલʹม͢ΔΈ༻ҙ • ςετίʔυͷΧόϨοδ 70% ͙Β͍ ؒʹ߹Θͣ
TCPDF • ςετίʔυ͕ͳ͍ ࠷ۙؾ͍ͮͨ… • ࠨԼʹখ͘͞ʮPowered by TCPDFʯ ۃখαΠζˍനʹനจࣈͳͷͰݟͨͳ͍͕…
• PDF ϥΠϒϥϦ։ൃͱ͍͏ҋʹखΛग़͔͢ ΜͰΔͱ͜Ζ
ࠓޙ
։ൃํ • ຊՈ Thinreports ͱผͷίϛϡχςΟͱͯ͠։ൃ ͪΖΜࢲࢀՃ͠·͢ • ϨΠΞτϑΝΠϧͷ༷ԼهͰެ։͞Ε͍ͯΔ ͷͰ͜Εʹैͬͯै͢Δײ͡ https://github.com/thinreports/thinreports/wiki/Spec:-Layout-File
• ͱ͍͑ɺPHP൛ಠࣗͷػೳશવ͋Γ ͢Ͱʹ Ruby ࣮ͱएׯ API ҧ͍·͢͠
ͥͻҰॹʹ • ݱࡏͷ։ൃϝϯόʔ: 1ਓʢࢲʣ • ͔͠ PHP ΛͪΌΜͱΔͷ 5 ͿΓ
PHPΧϯϑΝϨϯεͳͷʹ͍͢·ͤΜ • ΠέͯΔπʔϧʹͳΔ͔Ͳ͏͔ɺΈͳ͞Μ ʹ͔͔͍ͬͯ·͢!
ૣɺ։ൃʹࢀՃ͢Δ • ·ͩԿߟ͑ͯͳ͍Ͱ͢ • ͱΓ͑͋͑ͣɺGitter ͷ “dev” room ʹ JOIN
README.md ͷԼͷํʹ͋Δɹɹɹɹɹɹɹ ɹΛΫϦοΫ͢Δ͠ • ։ൃυΩϡϝϯτͳΜ͔ Wiki ʹ·ͱΊ·͢ গʑ͓ͪԼ͍͞ • Α͘Θ͔Βͳ͍Αɺͱ͍͏ํޙͰฉ͍ͯͩ͘ ͍͞
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ ͪͳΈʹɺ • ຊՈ Thinreports v1.0 ϦϦʔε༧ఆ • ΧελϜϑΥϯτ ݱࡏ͑ΔϑΥϯτ
4 ͭͷΈɻಠࣗϑΥϯτ͕ར༻ՄೳʹͳΔ͔ • Ϧετπʔϧͷվળ ୯ථϨΠΞτͱ࿈ථϨΠΞτ͕બՄೳʹͳΔ͔ • όʔίʔυػೳͷωΠςΟϒαϙʔτͳͲ