fancy-buttons Widget to create fancy Vista-like form buttons

  1. Documentation
  2. Change Log

This extension is a widget to create Vista-like form buttons.

Currently, it supports these button types:

  • Submit button
  • Save button
  • Reset button
  • Cancel button.
Resources

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions
Usage
  • Load the extension:
Yii::import('application.extensions.button.DDButton');

Use the widget in a form view.

Form Definition
  • Add an id to the form tag being created using beginForm():
<?php echo CHtml::beginForm(
   array(
      $update?'update':'create',
      'id'=>$model->id
   ),
   'POST',
   array(
      'id'=>'PostForm'
   )
); ?>
Save button
  • In a view file:
<?php $this->widget( 'application.extensions.button.DDButton',
   array(
       'title'=>$update ? 'Save':'Create',
       'linkTitle'=>$update ? 'Save this record' : 'Create this record',
       'formID' => 'PostForm',
       'buttonType' => 'save'
)); ?>
Reset Button
<?php $this->widget( 'application.extensions.button.DDButton',
   array(
       'title'=>'Reset',
       'linkTitle'=>'Reset the form data',
       'formID' => 'PostForm',
       'buttonType' => 'reset',
       'confirm' => 'Really reset this form?'
)); ?>
Cancel button
<?php $this->widget( 'application.extensions.button.DDButton',
   array(
       'title'=>'Cancel',
       'linkTitle'=>'Cancel editing, back to list',
       'formID' => 'PostForm',
       'buttonType' => 'cancel',
       'url' => array('post/admin')
)); ?>

Change Log

August 20, 2010 - V0.2
  • Button type 'cancel' now also uses 'confirm'
  • Minor CSS changes on button link hover
April 5, 2010
  • Added bits to documentation
April 1, 2010
  • Initial release.
1 1
3 followers
1 206 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Tags:
Developed by: jwerner
Created on: Apr 1, 2010
Last updated: 14 years ago

Downloads

show all