40
Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons Ethna Action View 䛺ఱ䛛 id:sotarok Sotaro KARASAWA [email protected]

Ethna的ActionとView@設計勉強会

Embed Size (px)

DESCRIPTION

ビジネスロジックとプレゼンテーションロジックを分けてしまっちゃうよ!

Citation preview

Page 1: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna �

Action � View ���

id:sotarokSotaro KARASAWA

[email protected]

Page 2: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Agenda����

Ethna ������ �����������������������

� !"�#$�% !"�#$

&'

Page 3: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

����

Page 4: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

����

id:sotarok(�"$�

)*+,,-./0

("$!1

2345-678!!!

Page 5: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

������ ���

wassr.jp/user/sotarok2 � 2!!twitter.com/sotarok

d.hatena.ne.jp/sotarok���

Page 6: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

���

Page 7: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

���

��� ��������

Page 8: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

���

������

Page 9: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

���

» -9:;<+=>?@A6B+C!BDEF7�

»�+-90GH�IJ��K+!B0EthnaCL,��KLB,D(M+5) *1

»���,N 0OPQKMRBD#�K,1M

» (*1 ����� � events.php.gr.jp ��)

Page 10: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

���

»�������������� !"#…

» ��

Page 11: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

$%&'(

)*�+� yandod ,�-.$�/

0123�45,�

Page 12: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

�67%58��9

:9!",�/��8���;

���

�����

������

Page 13: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna <�=>?@

Page 14: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna � A�BC�D�$EFGH�$IJ�Ethna(���)��PHP��� ��������������������� �!�"�#$�%&�'()

�*+,-.�&'��/

» 012 �12�MVC�������» …

http://ethna.jp/ethna-about.html

Page 15: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna � A�BC�D�$EFGH�$IJ�

Controller

Model View

Page 16: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna � A�BC�D�$EFGH�$IJ�

Controller

AppObject/AppManager template (Smarty)

Action View

Page 17: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna � A�BC�D�$EFGH�$IJ�

Controller

AppObject/AppManagerADOdb��DB�� template (Smarty)

performprepare preforward

Page 18: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna � A�BC�D�$EFGH�$IJ�

Controller

AppObject/AppManagerADOdb��DB�� template (Smarty)

performprepare preforward�

Page 19: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Ethna���» Action

» (authenticate) -> prepare -> perform» View

» preforward -> forward -> template»CKLF9MNOP�QRST»UV�Model

»3 %4'�4SQL#'�5 67�

Page 20: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

1���� / 1����1� �!» S�TU�J+��V» action

» Blog» Post.php» Post/Do.php» View.php

» view» Blog

» Post.php» View.php

Page 21: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

WXY�Z�GH�CKLF

$

IK[\CKLF

Page 22: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

"#$% &�(1)»]��^_�GH�`ab�c�defprepare (Action) 9g4

Page 23: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

"#$% &�(2)»DB�hijk(#lmnojk)fperform (Action) 9g4

»���pq_�rfos/tu (prepare#vw�/�N�)

Page 24: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

"#$% &�(3)»"x9yN�$f preforward (View) 9g4

» (hijkfg����z)»"xoN�$�{|9�Nhif;����} (view~��B$)»�8 DB �09,�):&#';<

Page 25: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

��3'()*

postprepare

perform

perforward

post_doprepare

perform

perforward

��������

��� �������

Page 26: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

��3'()*

postprepare

perform

perforward

post_doprepare

perform

perforward

����������������...

Page 27: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

��3'()*

postprepare

perform

perforward

post_doprepare

perform

perforward

����������������...

��������

�� ������

�������

DB��������

Page 28: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

��3'()*

postprepare

perform

perforward

post_doprepare

perform

perforward��������

�� ������

�������

���

����������������...

Page 29: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

"#$% &�(5)» DBWX.D#�

» ���� � �!"#��$!�� » ���� %&'()*�

» ���� � Ethna_DB_ADOdb ���» add/update � autoExecute � (ADOdb��)» find ���������» findBy* �������

» JOIN��+,» �����JOIN����

» �!"�-. (�/0�12�34���5�6)» !"#$ -> %&'» (�) -> *&'_+�,-.�$/

» id / created / updated !

Page 30: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

�8��$$�8��$

Page 31: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

+�,��

» if ���N»=>?@",AB�CD�E�&'FG��HGIJ6H(,#'&'F$6�KL$F

»DBfDB�R%�8/SQLg�N» findBy* ��MFNOH(,P6#'&MF$»QRSTUGV�WXY

Page 32: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

-�,��

»DBf���%9���» SQLZ�[

» autoExecute78)9��9�:9��»;<�=>?)�@���AB9��

»H(�H\�JOIN�&F)$L�\F»Z\B$u����/��

»]L^_`»a���,��6b&F)�'��cd�e�@�

Page 33: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

��

Page 34: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

./012345�

» ��YLC,�/Z[»\�]��^_��

» CakePHP *C>?)» http://getmockingbird.org/

» symfony *D>?EF6GHIJ�»&`,BDEthnaU�JaCakePHPbWDBU�c�L"5� �dD8NWLB,D

» �9:PHP 5KL» M%EthnaNO�P?*…» QR�12�34��(PHP%S@T?)U��/VWXY:���Z

Page 35: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

6789�:0

Page 36: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

;<

nequal����

)�<9

��%���

Page 37: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

nequal»�$7� sotarok»��� riaf»q��� wozozo (i�)

Page 38: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

1=;<

Page 39: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

Open PEAR Server����

(riaf�������)

Page 40: Ethna的ActionとView@設計勉強会

Copyright (c) sotarok 2008, Attribution-NonCommercial Creative Commons

0y%