2007-02-17 (ÅÚ)
¢£ Piece Framework ¤Î¥µ¥ó¥×¥ë¥«¥¦¥ó¥¿
Piece Framework ¤ò»î¤·¤Æ¤ß¤Æ¤¤¤ë¡£ Piece_Flow ¤Î¥¢¡¼¥«¥¤¥Ö¤ÎÃæ¤Ë¤¢¤Ã¤¿¥Æ¥¹¥ÈÍѤΥե¡¥¤¥ë¤ò¾¯¤·¼êľ¤·¤·¤Æ¡¢ ¤´¤¯¤´¤¯´Êñ¤Ê¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ¤ß¤¿¡£ ¥«¥¦¥ó¥¿¤È¤¤¤¦¤«¡¢¤Ø¤§¥Ü¥¿¥ó¤ß¤¿¤¤¤Ê¤ä¤Ä¤À¡£ ¤¿¤À¤³¤Î¥µ¥ó¥×¥ë¤Ï¡¢É¬¤ºÆ±¤¸ state ¤ËÌá¤Ã¤ÆÍè¤ë¤È¤¤¤¦ÅÀ¤¬¤¢¤Þ¤ê¤è¤í¤·¤¯¤Ê¤¤¡£ ¤½¤Î¤»¤¤¤Ç¡ÖÌá¤ë¡×¥Ü¥¿¥ó¤ò²¡¤·¤¿»þ¤Îưºî¤¬¤ª¤«¤·¤¤¤¬¡¢ ¤¢¤¯¤Þ¤Ç¤âÎý½¬¤È¤¤¤¦¤³¤È¤ÇÂçÌܤ˸«¤ÆÍߤ·¤¤¡£
- config/flows/Counter.yaml
firstState: DisplayForm
viewState:
- name: DisplayForm
view: Counter
activity:
method: setView
transition:
- event: increase
nextState: done
action:
class: CounterAction
method: increase
- event: reset
nextState: done
action:
class: CounterAction
method: reset
actionState:
- name: done
transition:
- event: succeed
nextState: DisplayForm
initial:
class: CounterAction
method: initialize
- actions/CounterAction.php
<?php
require_once 'Piece/Flow/Action.php';
class CounterAction extends Piece_Flow_Action
{
function initialize()
{
$this->_flow->setAttribute('counter', 1);
}
function increase()
{
$counter = $this->_flow->getAttribute('counter');
$this->_flow->setAttribute('counter', $counter + 1);
return 'succeed';
}
function reset()
{
$this->initialize();
return 'succeed';
}
function setView()
{
$counter = $this->_flow->getAttribute('counter');
$viewElement =& $this->_payload->getViewElement();
$viewElement->setElement('counter', $counter);
}
}
?>
- templates/Counter/Counter.html
<p>Counter: {counter}</p>
<form>
<input type="hidden" name="{__flowExecutionTicketKey}" value="{__flowExecutionTicket}" id="flowExecutionTicket" />
<input type="submit" name="{__eventNameKey}_increase" value="Increase" />
<input type="submit" name="{__eventNameKey}_reset" value="Reset" />
</form>
¤¢¤È¤Ï piece-unity-config.yaml ¤Ë¤³¤Î¥Õ¥í¡¼¤òÄɲ乤ë¤È¤¤¤Ã¤¿ºî¶È¤âɬÍפÀ¤¬¡¢ ¤È¤ê¤¢¤¨¤º¤³¤ì¤Ï¤³¤ì¤Ç¤Á¤ã¤ó¤Èưºî¤¹¤ë¡£
¤µ¤Æ¡¢¤³¤³¤«¤é¤¬ËÜÂê¡£ ¥Þ¥Ë¥å¥¢¥ë¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥¢¥¯¥·¥ç¥ó·Ñ³¤ÎÀâÌÀ¤òÆÉ¤ó¤Ç¡¢ ¤½¤Î»þ¤Ï¡¢¤Õ¡¼¤ó¡¢¤È»×¤Ã¤Æ¤¤¤¿¤Î¤À¤¬¡¢ ¤·¤Ð¤é¤¯·Ð¤Ã¤¿¸å¤Ç¡¢½ñ¤«¤ì¤Æ¤¤¤ë¤³¤È¤Î°ÕÌ£¤¬Æ¬¤ËÀ÷¤ßÅϤäƤ¤¿¡£ ¥Õ¥í¡¼ÊÑ¿ô¤ò°Õ¼±¤¹¤ëɬÍפ¬Ìµ¤¤¤À¤Ã¤Æ¡© ¤â¤·¤«¤·¤Æ¡¢¥¢¥¯¥·¥ç¥ó·Ñ³¤Îµ¡Ç½¤ò͸ú¤Ë¤¹¤ì¤Ð¤³¤¦¤¤¤¦É÷¤Ë½ñ¤±¤ë¤Î¤«¡©
<?php
require_once 'Piece/Flow/Action.php';
class CounterAction extends Piece_Flow_Action
{
var $_counter;
function initialize()
{
$this->_counter = 1;
}
function increase()
{
$this->_counter++;
return 'succeed';
}
function reset()
{
$this->initialize();
return 'succeed';
}
function setView()
{
$viewElement =& $this->_payload->getViewElement();
$viewElement->setElement('counter', $this->_counter);
}
}
?>
»î¤·¤Æ¤ß¤¿¤È¤³¤í¡¢¤³¤ì¤Ç¤Á¤ã¤ó¤Èư¤¤¤¿¡£¤³¤ê¤ã¤¹¤´¤¤¤ä¡£
Íפ¹¤ë¤Ë¡¢º£¤Þ¤Ç¤ÎÄ̾ï¤Î Web ¥¢¥×¥ê¤À¤Ã¤¿¤é¡¢ ¥»¥Ã¥·¥ç¥ó¤ËÃͤòÊݸ¤·¤Æ¤ª¤¤¤Æ¡¢ ¼¡¤Î²èÌ̤ǥ»¥Ã¥·¥ç¥ó¤«¤éÃͤò¼è¤ê½Ð¤·¤Æ¡¢ ¤È¤¤¤Ã¤¿¤³¤È¤ò¤Û¤Ü¼êºî¶È¤Ç¤ä¤Ã¤Æ¤¤¤¿¤Î¤Ë¡¢ ¤½¤¦¤¤¤Ã¤¿½èÍý¤ò²¿¤â½ñ¤«¤Ê¤¯¤ÆºÑ¤à¡£ Piece Framework ¤Ï¥¹¥Æ¡¼¥È¥Õ¥ë¡¢¤È½ñ¤«¤ì¤Æ¤¤¤¿¤Î¤¬¤è¤¦¤ä¤¯¼Â´¶¤Ç¤¤¿¡£
- 2 google¸¡º÷(Piece Framework)
- 2 google¸¡º÷(setView piece)
- 2 google¸¡º÷(php ¥«¥¦¥ó¥¿ ¥µ¥ó¥×¥ë)
- 2 http://www.google.co.jp/hws/search?q=Piece Framewo...
- 2 http://209.85.175.104/search?q=cache:tRsOtmC8gT0J:...
- 1 http://www.revulo.com/
- 1 google¸¡º÷(piece-framework setelement form)
- 1 google¸¡º÷(piece-framework ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(piece php config)
- 1 google¸¡º÷(piece-framework flow)
- 1 google¸¡º÷(piece framework)
- 1 google¸¡º÷(actionscript 3.0 ¥«¥¦¥ó¥¿)
- 1 google¸¡º÷(viewElement->setElement)
- 1 google¸¡º÷($viewElement->setElement)
- 1 http://www.google.co.jp/url?sa=t&source=web&cd=1&v...
- 1 http://www.google.co.jp/url?sa=t&rct=j&q=¤Ø¤§¥Ü¥¿¥...
- 1 http://www.google.co.jp/url?sa=t&rct=j&q=¤Ø¤§¥Ü¥¿¥...
- 1 google¸¡º÷(php zend framwork ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(zend framework ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(zend framework form)
- 1 google¸¡º÷(zend framework ¤¹¤´¤¤¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(zend ¥«¥¦¥ó¥¿¡¼)
- 1 google¸¡º÷(piece framework)
- 1 google¸¡º÷(piece framework)
- 1 google¸¡º÷(piece framework)
- 1 google¸¡º÷(piece framework¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(piece ¥¹¥Æ¡¼¥È¥Õ¥ë)
- 1 google¸¡º÷(php piece framework)
- 1 google¸¡º÷(php ¥¯¥é¥¹¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(php ¥«¥¦¥ó¥¿¡¼ submit)
- 1 google¸¡º÷(javascript ¥µ¥ó¥×¥ë¡¡¥«¥¦¥ó¥¿¡¼)
- 1 google¸¡º÷(Piece Framework)
- 1 google¸¡º÷(Piece Framework)
- 1 google¸¡º÷(PHP ¥µ¥ó¥×¥ë function)
- 1 google¸¡º÷(piece framework)
- 1 google¸¡º÷(zend framework 1.0 ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(setView Piece)
- 1 google¸¡º÷(getAttribute piece)
- 1 google¸¡º÷(function increase()
- 1 google¸¡º÷(javascript reset ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(¥Ü¥¿¥ó¡¡¥«¥¦¥ó¥È¡¡£Ð£È£Ð)
- 1 google¸¡º÷(php ¥«¥¦¥ó¥¿ ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(Ìá¤ë¥Ü¥¿¥ó¡¡PHP ¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(Ìá¤ë¥Ü¥¿¥ó¡¡PHP¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(Ìá¤ë¥Ü¥¿¥ó¡¡£Ð£È£Ð¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(Piece Framework¡¡¥µ¥ó¥×¥ë)
- 1 google¸¡º÷(javascript setAttribute setElement)
- 1 google¸¡º÷(piece-flow framework)
- 1 google¸¡º÷(Piece Flow Framework)
- 1 google¸¡º÷(t)
- 1 http://www.google.co.jp/m/search?eosr=on&q=COUNTER...
- 1 msn¸¡º÷(javascript ¡¡setElement)
- 1 http://search.hatena.ne.jp/websearch?word=php piec...
- 1 http://74.125.153.132/search?q=cache:tRsOtmC8gT0J:...
- 1 http://72.14.235.132/search?q=cache:tRsOtmC8gT0J:w...
- 1 http://72.14.235.132/search?q=cache:tRsOtmC8gT0J:w...
- 1 http://72.14.235.104/search?q=cache:tRsOtmC8gT0J:w...
- 1 http://72.14.235.104/search?q=cache:tRsOtmC8gT0J:w...
- 1 http://72.14.235.104/search?q=cache:tRsOtmC8gT0J:w...
- 1 http://209.85.175.132/search?q=cache:tRsOtmC8gT0J:...
- 1 http://209.85.175.132/search?q=cache:tRsOtmC8gT0J:...
- 1 http://209.85.175.104/search?q=cache:tRsOtmC8gT0J:...
