Created
May 24, 2017 17:40
-
-
Save fedek6/62a0c63f63cf71270c4b96266eafed0e to your computer and use it in GitHub Desktop.
Replace param in URL for form usage in Yii 1.1.*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var array $params Current get params without c **/ | |
$params = $_GET; | |
unset( $params[ 'c' ] ); | |
/** @var string $url **/ | |
$url = Yii::app()->controller->createUrl( Yii::app()->controller->id . '/' . Yii::app()->controller->action->id, $params ); | |
/** | |
* Create form with nedded c param included. | |
*/ | |
echo TbHtml::beginFormTb(TbHtml::FORM_LAYOUT_INLINE, $url, 'GET', [ 'class' => 'plugin-submit-onchange' ]); | |
echo TbHtml::label('Number of items in list:', 'c'); | |
echo TbHtml::dropDownList( 'c', $this->_c, $this->options ); | |
echo TbHtml::endForm(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment