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
880
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.6k
AgileJapan2016 Shimane Session2-2
hidakatsuya
0
2.2k
Other Decks in Technology
See All in Technology
エンジニア主導の企画立案を可能にする組織とは?
recruitengineers
PRO
1
350
完璧を捨てろ! “攻め”のQAがもたらすスピードと革新/20250306 Hiroki Hachisuka
shift_evolve
0
180
Roomの監視可能なクエリのカスタマイズとレガシーコードへの適用
shiita0903
2
140
株式会社Awarefy(アウェアファイ)会社説明資料 / Awarefy-Company-Deck
awarefy
3
12k
「頑張る」を「楽しむ」に変換する技術
tomoyakitaura
10
1.8k
開発者のための FinOps/FinOps for Engineers
oracle4engineer
PRO
2
300
IAMのマニアックな話2025
nrinetcom
PRO
6
1.6k
StotybookからはじめるVRT -個人開発編-
arrow2nd
1
180
User Story Mapping + Inclusive Team
kawaguti
PRO
3
640
プロダクト開発者目線での Entra ID 活用
sansantech
PRO
0
250
Codar: Arte ou Ciência?! A Jornada de um DEV na Creator Economy
vclementino
0
170
事業を差別化する技術を生み出す技術
pyama86
3
1.2k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Side Projects
sachag
452
42k
Git: the NoSQL Database
bkeepers
PRO
429
65k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
It's Worth the Effort
3n
184
28k
Gamification - CAS2011
davidbonilla
80
5.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
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 ͭͷΈɻಠࣗϑΥϯτ͕ར༻ՄೳʹͳΔ͔ • Ϧετπʔϧͷվળ ୯ථϨΠΞτͱ࿈ථϨΠΞτ͕બՄೳʹͳΔ͔ • όʔίʔυػೳͷωΠςΟϒαϙʔτͳͲ