Code Search for Developers
 
 
  

ZFormElementBehaviorAbstract.php from Astrum Futura at Krugle


Show ZFormElementBehaviorAbstract.php syntax highlighted

<?php
/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to version 1.0 of the Zend Framework
 * license, that is bundled with this package in the file LICENSE, and
 * is available through the world-wide-web at the following URL:
 * http://www.zend.com/license/framework/1_0.txt. If you did not receive
 * a copy of the Zend Framework license and are unable to obtain it
 * through the world-wide-web, please send a note to license@zend.com
 * so we can mail you a copy immediately.
 *
 * @package    ZForm
 * @copyright  Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://www.zend.com/license/framework/1_0.txt Zend Framework License version 1.0
 */


/**
 * ZFormElemen, used as target of behavior
 */
require_once 'ZForm/ZFormElement.php';


/**
 * @package    ZForm
 * @copyright  Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://www.zend.com/license/framework/1_0.txt Zend Framework License version 1.0
 */
abstract class ZFormElementBehaviorAbstract
{
    /**
     * Class constructor. Initialize $_element to as the target of behavior.
     *
     * @param ZFormElement $targetElement The form element to apply the behavior
     * into.
     */
    public function __construct($targetElement)
    {
    	$this->_element = $targetElement;

    	if ($this->_element) {
    	    $this->_element->addBehavior($this);
    	}
    }


    /**
     * Abstract method. This method is invoked during the render cycle of the
     * behavior. The this method in invoked the context of the DHTML on the page will
     * contain a javascript reference to the element idenfitied by the target element
     * For example:
     * <SCRIPT>
     *    var element;
     *    element = document.getElementById('helloWorld');
     * </SCRIPT>
     *
     * @param ZFormElement $element
     */
    abstract public function emitClientBehavior($element);


    /**
     * Abstract method which must be implemented by subclasses. This method is
     * invoked before any rendering is started of the component. This give the
     * bahavior a chance to make any changes to the layout of the element
     * its children or its parent chain.
     *
     */
    abstract public function applyClientBehavior(ZFormElement $element);
}
?>




See more files for this project here

Astrum Futura

Multiplayer space strategy game written in PHP5 with the Zend Framework. User interface uses Javascript/AJAX for dynamic interaction. Players compete across a hexagonal map of 10,000 sectors, planets, stars and other locations through trade and combat.

Project homepage: http://sourceforge.net/projects/astrumfutura
Programming language(s): PHP,XML
License: other

  behaviors/
    ZFormAjaxBehavior.php
  elements/
    ZForm.php
    ZFormButton.php
    ZFormCheckbox.php
    ZFormEntryField.php
    ZFormFile.php
    ZFormHiddenField.php
    ZFormImage.php
    ZFormInputElement.php
    ZFormLink.php
    ZFormOption.php
    ZFormPasswordField.php
    ZFormRadioButton.php
    ZFormResetButton.php
    ZFormSelect.php
    ZFormSubmitButton.php
    ZFormWebElement.php
  javascript/
    AutoCompleteControl.js
    ZAjax.js
    class.js
    general.js
  validators/
    ZFormRegExpValidator.php
    validator.js
  TODO.txt
  ZFormDynamicElement.php
  ZFormElement.php
  ZFormElementBehaviorAbstract.php
  ZFormElementEvent.php
  ZFormElementEventListenerInterface.php
  ZFormElementException.php
  ZFormElementValidator.php
  ZFormFactory.php