idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
53,000
public function store ( array $ data ) { $ exception = new ExceptionModel ( ) ; $ exception -> type = $ data [ 'exception' ] ; $ exception -> code = $ data [ 'code' ] ; $ exception -> message = $ data [ 'message' ] ; $ exception -> file = $ data [ 'file' ] ; $ exception -> line = $ data [ 'line' ] ; $ exception -> trace = $ data [ 'trace' ] ; $ exception -> method = $ data [ 'method' ] ; $ exception -> path = $ data [ 'path' ] ; $ exception -> query = $ data [ 'query' ] ; $ exception -> body = $ data [ 'body' ] ; $ exception -> cookies = $ data [ 'cookies' ] ; $ exception -> headers = $ data [ 'headers' ] ; $ exception -> ip = $ data [ 'ip' ] ; try { $ exception -> save ( ) ; } catch ( \ Exception $ e ) { } return $ exception -> save ( ) ; }
Store exception info to db .
53,001
public function getAccessToken ( $ token , $ verifier , TemporaryCredentials $ temporaryCredentials = null ) { return $ this -> getAuthorization ( ) -> getToken ( $ token , $ verifier , $ temporaryCredentials ) ; }
Retrives access token credentials with token and verifier .
53,002
public function getBatch ( $ attributes = [ ] ) { $ this -> parseBatchAttributes ( $ attributes ) ; try { $ result = $ this -> getHttp ( ) -> get ( 'batch' , [ 'urls' => $ this -> batchUrls ] ) ; $ this -> batchUrls = [ ] ; return $ result ; } catch ( Exception $ e ) { throw $ e ; } }
Retrieves http response from Trello api for batch collection .
53,003
protected function parseBatchAttributes ( $ attributes = [ ] ) { if ( isset ( $ attributes [ 'urls' ] ) ) { if ( is_array ( $ attributes [ 'urls' ] ) ) { $ this -> addBatchUrls ( $ attributes [ 'urls' ] ) ; } elseif ( is_string ( $ attributes [ 'urls' ] ) ) { $ this -> addBatchUrl ( $ attributes [ 'urls' ] ) ; } } }
Attempts to parse attributes to pull valid urls .
53,004
private function getMethodSignature ( $ method ) { $ validMethod = isset ( $ this -> methods [ $ method ] ) && is_array ( $ this -> methods [ $ method ] ) && count ( $ this -> methods [ $ method ] ) >= 2 ; if ( $ validMethod ) { return $ this -> methods [ $ method ] ; } return null ; }
Attempts to retrieve method signature from method definition .
53,005
protected function authenticateRequest ( RequestInterface $ request ) { $ uri = $ request -> getUri ( ) ; parse_str ( $ uri -> getQuery ( ) , $ query ) ; $ query [ 'key' ] = Configuration :: get ( 'key' ) ; $ query [ 'token' ] = Configuration :: get ( 'token' ) ; $ uri = $ uri -> withQuery ( http_build_query ( $ query ) ) ; return $ request -> withUri ( $ uri ) ; }
Adds authentication credentials to given request .
53,006
protected function createRequest ( $ verb , $ path , $ parameters = [ ] ) { if ( isset ( $ parameters [ 'file' ] ) ) { $ this -> queueResourceAs ( 'file' , Psr7 \ stream_for ( $ parameters [ 'file' ] ) ) ; unset ( $ parameters [ 'file' ] ) ; } $ request = new Request ( $ verb , $ this -> getUrlFromPath ( $ path ) , $ this -> getHeaders ( ) ) ; return $ request -> withUri ( $ request -> getUri ( ) -> withQuery ( http_build_query ( $ parameters ) ) ) ; }
Creates a request .
53,007
public function delete ( $ path , $ parameters = [ ] ) { $ request = $ this -> getRequest ( static :: HTTP_DELETE , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; }
Retrieves http response for a request with the delete method .
53,008
public function get ( $ path , $ parameters = [ ] ) { $ request = $ this -> getRequest ( static :: HTTP_GET , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; }
Retrieves http response for a request with the get method .
53,009
public function getRequest ( $ method , $ path , $ parameters = [ ] , $ authenticated = true ) { $ request = $ this -> createRequest ( $ method , $ path , $ parameters ) ; if ( $ authenticated ) { $ request = $ this -> authenticateRequest ( $ request ) ; } return $ request ; }
Creates and returns a request .
53,010
private function getRequestExceptionParts ( RequestException $ requestException ) { $ response = $ requestException -> getResponse ( ) ; $ parts = [ ] ; $ parts [ 'reason' ] = $ response ? $ response -> getReasonPhrase ( ) : $ requestException -> getMessage ( ) ; $ parts [ 'code' ] = $ response ? $ response -> getStatusCode ( ) : $ requestException -> getCode ( ) ; $ parts [ 'body' ] = $ response ? $ response -> getBody ( ) : null ; return $ parts ; }
Prepares an array of important exception parts based on composition of a given exception .
53,011
protected function getRequestOptions ( ) { $ options = [ 'proxy' => Configuration :: get ( 'proxy' ) ] ; if ( ! empty ( array_filter ( $ this -> multipartResources ) ) ) { $ options [ 'multipart' ] = $ this -> multipartResources ; } return $ options ; }
Creates an array of request options based on the current status of the http client .
53,012
public function post ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_POST , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; }
Retrieves http response for a request with the post method .
53,013
public function put ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_PUT , $ path , $ parameters ) ; return $ this -> sendRequest ( $ request ) ; }
Retrieves http response for a request with the put method .
53,014
public function putAsBody ( $ path , $ parameters ) { $ request = $ this -> getRequest ( static :: HTTP_PUT , $ path ) -> withBody ( Psr7 \ stream_for ( json_encode ( $ parameters ) ) ) -> withHeader ( 'content-type' , 'application/json' ) ; return $ this -> sendRequest ( $ request ) ; }
Retrieves http response for a request with the put method ensuring parameters are passed as body .
53,015
protected function sendRequest ( RequestInterface $ request ) { try { $ response = $ this -> httpClient -> send ( $ request , $ this -> getRequestOptions ( ) ) ; $ this -> multipartResources = [ ] ; return json_decode ( $ response -> getBody ( ) ) ; } catch ( RequestException $ e ) { $ this -> throwRequestException ( $ e ) ; } }
Retrieves http response for a given request .
53,016
protected function throwRequestException ( RequestException $ requestException ) { $ exceptionParts = $ this -> getRequestExceptionParts ( $ requestException ) ; $ exception = new Exceptions \ Exception ( $ exceptionParts [ 'reason' ] , $ exceptionParts [ 'code' ] , $ requestException ) ; $ body = $ exceptionParts [ 'body' ] ; $ json = json_decode ( $ body ) ; if ( json_last_error ( ) == JSON_ERROR_NONE ) { throw $ exception -> setResponseBody ( $ json ) ; } throw $ exception -> setResponseBody ( $ body ) ; }
Creates local exception from guzzle request exception which includes response body .
53,017
public static function get ( $ key = null , $ default = null ) { if ( ! empty ( $ key ) ) { return isset ( static :: $ settings [ $ key ] ) ? static :: $ settings [ $ key ] : $ default ; } return static :: $ settings ; }
Attempts to retrieve a given key from configuration settings . Returns default if not set .
53,018
public static function parseDefaultOptions ( $ options = [ ] , $ defaults = [ ] ) { array_walk ( $ defaults , function ( $ value , $ key ) use ( & $ options ) { if ( ! isset ( $ options [ $ key ] ) ) { $ options [ $ key ] = $ value ; } } ) ; return $ options ; }
Parses give options against default options .
53,019
public static function setMany ( $ settings = [ ] , $ defaultSettings = [ ] ) { $ settings = static :: parseDefaultOptions ( $ settings , $ defaultSettings ) ; array_walk ( $ settings , function ( $ value , $ key ) { static :: set ( $ key , $ value ) ; } ) ; }
Updates configuration settings with collection of key value pairs .
53,020
public function addConfig ( ) { $ params = func_get_args ( ) ; if ( ! empty ( $ params ) ) { if ( is_array ( $ params [ 0 ] ) ) { forward_static_call_array ( [ Configuration :: class , 'setMany' ] , $ params ) ; } else { forward_static_call_array ( [ Configuration :: class , 'set' ] , $ params ) ; } } return $ this ; }
Updates configuration settings with key value pairs .
53,021
protected function createClient ( ) { $ this -> client = new OAuthServer ( [ 'identifier' => Configuration :: get ( 'key' ) , 'secret' => Configuration :: get ( 'secret' ) , 'callback_uri' => Configuration :: get ( 'callbackUrl' ) , 'name' => Configuration :: get ( 'name' ) , 'expiration' => Configuration :: get ( 'expiration' ) , 'scope' => Configuration :: get ( 'scope' ) , ] ) ; return $ this ; }
Creates a new OAuth server client and attaches to authorization broker .
53,022
public function getToken ( $ oauthToken , $ oauthVerifier , TemporaryCredentials $ temporaryCredentials = null ) { if ( is_null ( $ temporaryCredentials ) ) { $ sessionKey = self :: getCredentialSessionKey ( ) ; $ temporaryCredentials = unserialize ( $ _SESSION [ $ sessionKey ] ) ; unset ( $ _SESSION [ $ sessionKey ] ) ; session_write_close ( ) ; } return $ this -> client -> getTokenCredentials ( $ temporaryCredentials , $ oauthToken , $ oauthVerifier ) ; }
Verify and fetch token
53,023
public function buildUrl ( $ method = '' , $ params = '' , $ append = true ) { return $ this -> bbbServerBaseUrl . 'api/' . $ method . ( $ append ? '?' . $ this -> buildQs ( $ method , $ params ) : '' ) ; }
Builds an API method URL that includes the url + params + its generated checksum .
53,024
private function processXmlResponse ( $ url , $ payload = '' , $ contentType = 'application/xml' ) { if ( extension_loaded ( 'curl' ) ) { $ ch = curl_init ( ) ; if ( ! $ ch ) { throw new \ RuntimeException ( 'Unhandled curl error: ' . curl_error ( $ ch ) ) ; } $ timeout = 10 ; $ cookiefile = tmpfile ( ) ; $ cookiefilepath = stream_get_meta_data ( $ cookiefile ) [ 'uri' ] ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , 1 ) ; curl_setopt ( $ ch , CURLOPT_ENCODING , 'UTF-8' ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; curl_setopt ( $ ch , CURLOPT_CONNECTTIMEOUT , $ timeout ) ; curl_setopt ( $ ch , CURLOPT_COOKIEFILE , $ cookiefilepath ) ; curl_setopt ( $ ch , CURLOPT_COOKIEJAR , $ cookiefilepath ) ; if ( ! empty ( $ payload ) ) { curl_setopt ( $ ch , CURLOPT_HEADER , 0 ) ; curl_setopt ( $ ch , CURLOPT_CUSTOMREQUEST , 'POST' ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ payload ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , [ 'Content-type: ' . $ contentType , 'Content-length: ' . mb_strlen ( $ payload ) , ] ) ; } $ data = curl_exec ( $ ch ) ; if ( $ data === false ) { throw new \ RuntimeException ( 'Unhandled curl error: ' . curl_error ( $ ch ) ) ; } curl_close ( $ ch ) ; $ cookies = file_get_contents ( $ cookiefilepath ) ; if ( strpos ( $ cookies , 'JSESSIONID' ) !== false ) { preg_match ( '/(?:JSESSIONID\s*)(?<JSESSIONID>.*)/' , $ cookies , $ output_array ) ; $ this -> setJSessionId ( $ output_array [ 'JSESSIONID' ] ) ; } return new SimpleXMLElement ( $ data ) ; } else { throw new \ RuntimeException ( 'Post XML data set but curl PHP module is not installed or not enabled.' ) ; } }
A private utility method used by other public methods to process XML responses .
53,025
private function CreateSignedAwsRequest ( $ request , $ version = '2011-08-01' ) { $ uri_elements = parse_url ( $ request ) ; $ request = $ uri_elements [ 'query' ] ; parse_str ( $ request , $ parameters ) ; $ parameters [ 'Timestamp' ] = gmdate ( "Y-m-d\TH:i:s\Z" ) ; $ parameters [ 'Version' ] = $ version ; ksort ( $ parameters ) ; foreach ( $ parameters as $ parameter => $ value ) { $ parameter = str_replace ( "%7E" , "~" , rawurlencode ( $ parameter ) ) ; $ value = str_replace ( "%7E" , "~" , rawurlencode ( $ value ) ) ; $ requestArray [ ] = $ parameter . '=' . $ value ; } $ requestParameters = implode ( '&' , $ requestArray ) ; $ signatureString = "GET\n{$uri_elements['host']}\n{$uri_elements['path']}\n{$requestParameters}" ; $ signature = $ this -> createSignature ( $ signatureString ) ; $ newUrl = "http://{$uri_elements['host']}{$uri_elements['path']}?{$requestParameters}&Signature={$signature}" ; return $ newUrl ; }
This function will take an existing Amazon request and change it so that it will be usable with the new authentication .
53,026
public function ItemSearch ( $ keywords , $ searchIndex = NULL , $ sortBy = NULL , $ condition = 'New' ) { $ params = array ( 'Operation' => 'ItemSearch' , 'ResponseGroup' => 'ItemAttributes,Offers,Images' , 'Keywords' => $ keywords , 'Condition' => $ condition , 'SearchIndex' => empty ( $ searchIndex ) ? 'All' : $ searchIndex , 'Sort' => $ sortBy && ( $ searchIndex != 'All' ) ? $ sortBy : NULL ) ; return $ this -> MakeAndParseRequest ( $ params ) ; }
Search for items
53,027
public function ItemLookup ( $ asinList , $ onlyFromAmazon = false ) { if ( is_array ( $ asinList ) ) { $ asinList = implode ( ',' , $ asinList ) ; } $ params = array ( 'Operation' => 'ItemLookup' , 'ResponseGroup' => 'ItemAttributes,Offers,Reviews,Images,EditorialReview' , 'ReviewSort' => '-OverallRating' , 'ItemId' => $ asinList , 'MerchantId' => ( $ onlyFromAmazon == true ) ? 'Amazon' : 'All' ) ; return $ this -> MakeAndParseRequest ( $ params ) ; }
Lookup items from ASINs
53,028
public function registerClientScript ( ) { $ cs = Yii :: app ( ) -> getClientScript ( ) ; $ cs -> registerPackage ( 'picker' ) ; $ pickerOptions = CJavaScript :: encode ( $ this -> pickerOptions ) ; $ gridId = $ this -> grid -> id ; $ class = preg_replace ( '/\s+/' , '.' , $ this -> class ) ; $ cs -> registerScript ( __CLASS__ . '#' . $ this -> id , <<<ENDL$(document).on('click','#{$gridId} a.{$class}', function() { if ($(this).hasClass('pickeron')) { $(this).removeClass('pickeron').picker('toggle'); return; } $('#{$gridId} a.pickeron') .removeClass('pickeron') .each(function (i, elem) { $(elem).picker('toggle'); }); $(this) .picker({$pickerOptions}) .picker('toggle').addClass('pickeron'); return false;});ENDL ) ; }
Registers client script data
53,029
public function run ( ) { $ key = yii :: app ( ) -> request -> getParam ( 'name' ) ; $ tooltip = Yii :: app ( ) -> request -> getParam ( 'value' ) ; if ( ! $ key || ! $ tooltip ) { throw new CHttpException ( 404 , Yii :: t ( 'zii' , 'Unauthorized request' ) ) ; } if ( ! $ this -> getDbConnection ( ) -> createCommand ( ) -> update ( $ this -> tooltipTable , array ( 'tooltip' => $ tooltip ) , 'tooltip_key=:key' , array ( ':key' => $ key ) ) ) { $ this -> getDbConnection ( ) -> createCommand ( ) -> insert ( $ this -> tooltipTable , array ( 'tooltip_key' => $ key , 'tooltip' => $ tooltip ) ) ; } }
CAction run s method
53,030
protected function renderTableBodyJSON ( $ rows ) { $ tbody = array ( 'headers' => array ( ) , 'rows' => array ( ) , 'keys' => array ( ) , 'summary' => array ( ) ) ; foreach ( $ this -> columns as $ column ) { $ tbody [ 'headers' ] [ ] = $ column -> renderHeaderCell ( ) ; } if ( $ rows > 0 ) { for ( $ row = 0 ; $ row < $ rows ; ++ $ row ) { $ tbody [ 'rows' ] [ ] = $ this -> renderTableRowJSON ( $ row ) ; } foreach ( $ this -> dataProvider -> getKeys ( ) as $ key ) { $ tbody [ 'keys' ] [ ] = CHtml :: encode ( $ key ) ; } } else { ob_start ( ) ; $ this -> renderEmptyText ( ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; $ tbody [ 'rows' ] [ 0 ] [ 'cols' ] [ ] = array ( 'attrs' => "colspan=\"" . count ( $ this -> columns ) . "\"" , 'content' => $ content ) ; $ tbody [ 'rows' ] [ 0 ] [ 'class' ] = " " ; } $ tbody [ 'pager' ] = $ this -> renderPager ( ) ; $ tbody [ 'url' ] = Yii :: app ( ) -> getRequest ( ) -> getUrl ( ) ; $ tbody [ 'summary' ] = $ this -> renderSummary ( ) ; return $ tbody ; }
Renders the body table for JSON requests - assumed ajax is for JSON
53,031
public static function defaultValues ( array $ values , array & $ array ) { foreach ( $ values as $ name => $ value ) { self :: defaultValue ( $ name , $ value , $ array ) ; } }
Sets a set of default values for the given array .
53,032
public static function copyValues ( array $ keys , array $ from , array $ to , $ force = false ) { foreach ( $ keys as $ key ) { if ( isset ( $ from [ $ key ] ) ) { if ( $ force || ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = self :: getValue ( $ key , $ from ) ; } } } return $ to ; }
Copies the given values from one array to another .
53,033
public static function moveValues ( array $ keys , array & $ from , array $ to , $ force = false ) { foreach ( $ keys as $ key ) { if ( isset ( $ from [ $ key ] ) ) { $ value = self :: popValue ( $ key , $ from ) ; if ( $ force || ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = $ value ; unset ( $ from [ $ key ] ) ; } } } return $ to ; }
Moves the given values from one array to another .
53,034
public static function merge ( array $ to , array $ from ) { $ args = func_get_args ( ) ; $ res = array_shift ( $ args ) ; while ( ! empty ( $ args ) ) { $ next = array_shift ( $ args ) ; foreach ( $ next as $ k => $ v ) { if ( is_integer ( $ k ) ) { isset ( $ res [ $ k ] ) ? $ res [ ] = $ v : $ res [ $ k ] = $ v ; } elseif ( is_array ( $ v ) && isset ( $ res [ $ k ] ) && is_array ( $ res [ $ k ] ) ) { $ res [ $ k ] = self :: merge ( $ res [ $ k ] , $ v ) ; } else { $ res [ $ k ] = $ v ; } } } return $ res ; }
Merges two arrays .
53,035
public function urlFieldGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'urlField' ) , array ( $ model , $ attribute , $ widgetOptions [ 'htmlOptions' ] ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a url field group for a model attribute .
53,036
public function passwordFieldGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ this -> addCssClass ( $ options [ 'widgetOptions' ] [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'passwordField' ) , array ( $ model , $ attribute , $ options [ 'widgetOptions' ] [ 'htmlOptions' ] ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a password field group for a model attribute .
53,037
public function radioButtonGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] [ 'htmlOptions' ] ; self :: addCssClass ( $ options [ 'labelOptions' ] , 'radio' ) ; if ( $ this -> type == self :: TYPE_INLINE || ( isset ( $ options [ 'inline' ] ) && $ options [ 'inline' ] ) ) self :: addCssClass ( $ options [ 'labelOptions' ] , 'radio-inline' ) ; $ field = $ this -> radioButton ( $ model , $ attribute , $ widgetOptions ) ; if ( ( ! array_key_exists ( 'uncheckValue' , $ widgetOptions ) || isset ( $ widgetOptions [ 'uncheckValue' ] ) ) && preg_match ( '/\<input.*?type="hidden".*?\>/' , $ field , $ matches ) ) { $ hiddenField = $ matches [ 0 ] ; $ field = str_replace ( $ hiddenField , '' , $ field ) ; } $ realAttribute = $ attribute ; CHtml :: resolveName ( $ model , $ realAttribute ) ; ob_start ( ) ; if ( isset ( $ hiddenField ) ) echo $ hiddenField ; echo CHtml :: tag ( 'label' , $ options [ 'labelOptions' ] , false , false ) ; echo $ field ; if ( isset ( $ options [ 'label' ] ) ) { if ( $ options [ 'label' ] ) echo $ options [ 'label' ] ; } else echo $ model -> getAttributeLabel ( $ realAttribute ) ; echo CHtml :: closeTag ( 'label' ) ; $ fieldData = ob_get_clean ( ) ; $ widgetOptions [ 'label' ] = '' ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a radio button group for a model attribute .
53,038
public function listBoxGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options , true ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this , 'listBox' ) , array ( $ model , $ attribute , $ widgetOptions [ 'data' ] , $ widgetOptions [ 'htmlOptions' ] ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a list box group for a model attribute .
53,039
public function checkboxListGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options , true ) ; $ widgetOptions = $ options [ 'widgetOptions' ] [ 'htmlOptions' ] ; if ( ! isset ( $ widgetOptions [ 'labelOptions' ] [ 'class' ] ) ) $ widgetOptions [ 'labelOptions' ] [ 'class' ] = 'checkbox' ; if ( isset ( $ options [ 'inline' ] ) && $ options [ 'inline' ] ) $ widgetOptions [ 'labelOptions' ] [ 'class' ] = 'checkbox-inline' ; if ( ! isset ( $ widgetOptions [ 'template' ] ) ) $ widgetOptions [ 'template' ] = '{beginLabel}{input}{labelTitle}{endLabel}' ; if ( ! isset ( $ widgetOptions [ 'separator' ] ) ) $ widgetOptions [ 'separator' ] = "\n" ; $ data = $ options [ 'widgetOptions' ] [ 'data' ] ; $ fieldData = array ( array ( $ this , 'checkboxList' ) , array ( $ model , $ attribute , $ data , $ widgetOptions ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a checkbox list group for a model attribute .
53,040
public function captchaGroup ( $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = $ this -> textField ( $ model , $ attribute , $ widgetOptions [ 'htmlOptions' ] ) ; unset ( $ widgetOptions [ 'htmlOptions' ] ) ; $ fieldData .= '<div class="captcha">' . $ this -> owner -> widget ( 'CCaptcha' , $ widgetOptions , true ) . '</div>' ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a color picker field group for a model attribute .
53,041
public function widgetGroup ( $ className , $ model , $ attribute , $ options = array ( ) ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = isset ( $ options [ 'widgetOptions' ] ) ? $ options [ 'widgetOptions' ] : null ; $ fieldData = array ( array ( $ this -> owner , 'widget' ) , array ( $ className , $ widgetOptions , true ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
Generates a widget group for a model attribute .
53,042
protected function widgetGroupInternal ( $ className , & $ model , & $ attribute , & $ options ) { $ this -> initOptions ( $ options ) ; $ widgetOptions = $ options [ 'widgetOptions' ] ; $ widgetOptions [ 'model' ] = $ model ; $ widgetOptions [ 'attribute' ] = $ attribute ; $ this -> addCssClass ( $ widgetOptions [ 'htmlOptions' ] , 'form-control' ) ; $ fieldData = array ( array ( $ this -> owner , 'widget' ) , array ( $ className , $ widgetOptions , true ) ) ; return $ this -> customFieldGroupInternal ( $ fieldData , $ model , $ attribute , $ options ) ; }
This is a intermediate method for widget - based group methods .
53,043
protected function customFieldGroupInternal ( & $ fieldData , & $ model , & $ attribute , & $ options ) { $ this -> setDefaultPlaceholder ( $ fieldData ) ; ob_start ( ) ; switch ( $ this -> type ) { case self :: TYPE_HORIZONTAL : $ this -> horizontalGroup ( $ fieldData , $ model , $ attribute , $ options ) ; break ; case self :: TYPE_VERTICAL : $ this -> verticalGroup ( $ fieldData , $ model , $ attribute , $ options ) ; break ; case self :: TYPE_INLINE : $ this -> inlineGroup ( $ fieldData , $ model , $ attribute , $ options ) ; break ; default : throw new CException ( 'Invalid form type' ) ; } return ob_get_clean ( ) ; }
Generates a custom field group for a model attribute .
53,044
protected function setDefaultPlaceholder ( & $ fieldData ) { if ( ! is_array ( $ fieldData ) || empty ( $ fieldData [ 0 ] [ 1 ] ) || ! is_array ( $ fieldData [ 1 ] ) ) return ; $ model = $ fieldData [ 1 ] [ 0 ] ; if ( ! $ model instanceof CModel ) return ; $ attribute = $ fieldData [ 1 ] [ 1 ] ; if ( ! empty ( $ fieldData [ 1 ] [ 3 ] ) && is_array ( $ fieldData [ 1 ] [ 3 ] ) ) { $ htmlOptions = & $ fieldData [ 1 ] [ 3 ] ; } else { $ htmlOptions = & $ fieldData [ 1 ] [ 2 ] ; } if ( ! isset ( $ htmlOptions [ 'placeholder' ] ) ) { $ htmlOptions [ 'placeholder' ] = $ model -> getAttributeLabel ( $ attribute ) ; } }
Sets default placeholder value in case of CModel attribute depending on attribute label
53,045
protected function inlineGroup ( & $ fieldData , & $ model , & $ attribute , & $ options ) { $ groupOptions = isset ( $ options [ 'groupOptions' ] ) ? $ options [ 'groupOptions' ] : array ( ) ; self :: addCssClass ( $ groupOptions , 'form-group' ) ; echo CHtml :: openTag ( 'div' , $ groupOptions ) ; if ( isset ( $ options [ 'wrapperHtmlOptions' ] ) && ! empty ( $ options [ 'wrapperHtmlOptions' ] ) ) $ wrapperHtmlOptions = $ options [ 'wrapperHtmlOptions' ] ; else $ wrapperHtmlOptions = $ options [ 'wrapperHtmlOptions' ] = array ( ) ; echo CHtml :: openTag ( 'div' , $ wrapperHtmlOptions ) ; if ( ! empty ( $ options [ 'prepend' ] ) || ! empty ( $ options [ 'append' ] ) ) $ this -> renderAddOnBegin ( $ options [ 'prepend' ] , $ options [ 'append' ] , $ options [ 'prependOptions' ] ) ; if ( is_array ( $ fieldData ) ) { echo call_user_func_array ( $ fieldData [ 0 ] , $ fieldData [ 1 ] ) ; } else { echo $ fieldData ; } if ( ! empty ( $ options [ 'prepend' ] ) || ! empty ( $ options [ 'append' ] ) ) $ this -> renderAddOnEnd ( $ options [ 'append' ] , $ options [ 'appendOptions' ] ) ; if ( $ this -> showErrors && $ options [ 'errorOptions' ] !== false ) { echo $ this -> error ( $ model , $ attribute , $ options [ 'errorOptions' ] , $ options [ 'enableAjaxValidation' ] , $ options [ 'enableClientValidation' ] ) ; } echo "</div></div>\r\n" ; }
Renders a inline custom field group for a model attribute .
53,046
protected function renderAddOnBegin ( $ prependText , $ appendText , $ prependOptions ) { $ wrapperCssClass = array ( ) ; if ( ! empty ( $ prependText ) ) $ wrapperCssClass [ ] = $ this -> prependCssClass ; if ( ! empty ( $ appendText ) ) $ wrapperCssClass [ ] = $ this -> appendCssClass ; echo CHtml :: tag ( $ this -> addOnWrapperTag , array ( 'class' => implode ( ' ' , $ wrapperCssClass ) ) , false , false ) ; if ( ! empty ( $ prependText ) ) { if ( isset ( $ prependOptions [ 'isRaw' ] ) && $ prependOptions [ 'isRaw' ] ) { echo $ prependText ; } else { self :: addCssClass ( $ prependOptions , $ this -> addOnCssClass ) ; echo CHtml :: tag ( $ this -> addOnTag , $ prependOptions , $ prependText ) ; } } }
Renders add - on begin .
53,047
protected function renderAddOnEnd ( $ appendText , $ appendOptions ) { if ( ! empty ( $ appendText ) ) { if ( isset ( $ appendOptions [ 'isRaw' ] ) && $ appendOptions [ 'isRaw' ] ) { echo $ appendText ; } else { self :: addCssClass ( $ appendOptions , $ this -> addOnCssClass ) ; echo CHtml :: tag ( $ this -> addOnTag , $ appendOptions , $ appendText ) ; } } echo CHtml :: closeTag ( $ this -> addOnWrapperTag ) ; }
Renders add - on end .
53,048
protected function maskedTextField ( ) { $ this -> setPlaceholder ( ) ; echo $ this -> getPrepend ( ) ; echo $ this -> form -> maskedTextField ( $ this -> model , $ this -> attribute , $ this -> data , $ this -> htmlOptions ) ; echo $ this -> getAppend ( ) ; }
Renders a masked text field .
53,049
public function run ( ) { list ( $ name , $ id ) = $ this -> resolveNameID ( ) ; if ( $ this -> hasModel ( ) ) { if ( $ this -> form ) { echo $ this -> form -> checkBox ( $ this -> model , $ this -> attribute , $ this -> htmlOptions ) ; } else { echo CHtml :: activeCheckBox ( $ this -> model , $ this -> attribute , $ this -> htmlOptions ) ; } } else { echo CHtml :: checkBox ( $ name , $ this -> value , $ this -> htmlOptions ) ; } $ this -> registerClientScript ( $ id ) ; }
Widget s run function
53,050
protected function registerClientScript ( $ id ) { $ booster = Booster :: getBooster ( ) ; $ booster -> registerPackage ( 'switch' ) ; $ config = CJavaScript :: encode ( $ this -> options ) ; ob_start ( ) ; echo "$('input#$id').bootstrapSwitch({$config})" ; foreach ( $ this -> events as $ event => $ handler ) { $ event = $ event . '.bootstrapSwitch' ; if ( ! $ handler instanceof CJavaScriptExpression && strpos ( $ handler , 'js:' ) === 0 ) $ handler = new CJavaScriptExpression ( $ handler ) ; echo ".on('{$event}', " . $ handler . ")" ; } Yii :: app ( ) -> clientScript -> registerScript ( __CLASS__ . '#' . $ this -> getId ( ) , ob_get_clean ( ) . ';' ) ; }
Registers required css and js files
53,051
protected function renderDataCellContent ( $ row , $ data ) { $ content = $ this -> emptyText ; if ( $ this -> imagePathExpression && $ imagePath = $ this -> evaluateExpression ( $ this -> imagePathExpression , array ( 'row' => $ row , 'data' => $ data ) ) ) { $ this -> imageOptions [ 'src' ] = $ imagePath ; $ content = CHtml :: tag ( 'img' , $ this -> imageOptions ) ; } elseif ( $ this -> usePlaceHoldIt && ! empty ( $ this -> placeHoldItSize ) ) { $ content = CHtml :: tag ( 'img' , array ( 'src' => 'http://placehold.it/' . $ this -> placeHoldItSize ) ) ; } elseif ( $ this -> usePlaceKitten && ! empty ( $ this -> placeKittenSize ) ) { $ content = CHtml :: tag ( 'img' , array ( 'src' => 'http://placekitten.com/' . $ this -> placeKittenSize ) ) ; } echo $ content ; }
Renders the data cell content
53,052
public function renderHeaderCell ( ) { if ( $ this -> grid -> json ) { ob_start ( ) ; $ this -> renderHeaderCellContent ( ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; return array ( 'id' => $ this -> id , 'content' => $ content ) ; } parent :: renderHeaderCell ( ) ; return array ( ) ; }
Renders|returns the header cell .
53,053
public function renderDataCell ( $ row ) { if ( $ this -> grid -> json ) { $ data = $ this -> grid -> dataProvider -> data [ $ row ] ; $ options = $ this -> htmlOptions ; if ( $ this -> cssClassExpression !== null ) { $ class = $ this -> evaluateExpression ( $ this -> cssClassExpression , array ( 'row' => $ row , 'data' => $ data ) ) ; if ( ! empty ( $ class ) ) { if ( isset ( $ options [ 'class' ] ) ) { $ options [ 'class' ] .= ' ' . $ class ; } else { $ options [ 'class' ] = $ class ; } } } return array ( 'attrs' => CHtml :: renderAttributes ( $ options ) , 'content' => $ this -> renderDataCellContent ( $ row , $ data ) , ) ; } parent :: renderDataCell ( $ row ) ; }
Renders|returns the data cell
53,054
public function setPath ( $ path ) { if ( is_dir ( $ path ) && is_writable ( $ path ) ) { $ this -> path = substr ( $ path , - 1 ) == DIRECTORY_SEPARATOR ? $ path : $ path . DIRECTORY_SEPARATOR ; return true ; } throw new Exception ( '"Path" must be a writable directory.' ) ; }
Property set path
53,055
public function verify ( ) { $ registry = function_exists ( 'json_encode' ) ? json_encode ( $ this -> data [ self :: REGISTRY ] ) : CJSON :: encode ( $ this -> data [ self :: REGISTRY ] ) ; return $ this -> data [ self :: META ] [ "hash" ] == md5 ( $ registry ) ; }
Verifies data integrity
53,056
public function load ( ) { $ filename = $ this -> getFile ( ) ; if ( ! file_exists ( $ filename ) ) return ; $ json = file_get_contents ( $ filename ) ; if ( strlen ( $ json ) == 0 ) return ; $ data = $ this -> decode ( $ json ) ; if ( $ data === null ) throw new Exception ( 'Error while trying to decode ' . $ filename . '.' ) ; $ this -> data = $ data ; if ( ! $ this -> verify ( ) ) throw new Exception ( $ filename . ' failed checksum validation.' ) ; }
Loads registry data into memory
53,057
public function save ( ) { if ( $ this -> hasEventHandler ( 'onBeforeSave' ) ) { $ this -> onBeforeSave ( new CEvent ( $ this ) ) ; } $ this -> flush ( ) ; if ( $ this -> hasEventHandler ( 'onAfterSave' ) ) { $ this -> onAfterSave ( new CEvent ( $ this ) ) ; } }
Saves registry data to the file
53,058
public function setData ( $ key , $ data , $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ key . $ registry ) && $ this -> registryExists ( $ registry ) ) { $ this -> data [ self :: REGISTRY ] [ $ registry ] [ $ key ] = $ data ; $ this -> dirty = true ; return true ; } return false ; }
Saves data to the registry
53,059
public function getData ( $ key , $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ key . $ registry ) && $ this -> registryExists ( $ registry ) ) { if ( array_key_exists ( $ key , $ this -> data [ self :: REGISTRY ] [ $ registry ] ) ) { return $ this -> data [ self :: REGISTRY ] [ $ registry ] [ $ key ] ; } } return null ; }
Retrieves a data value from the registry
53,060
public function getLength ( $ registry = null ) { if ( $ registry == null ) { $ registry = $ this -> default ; } if ( is_string ( $ registry ) && $ this -> registryExists ( $ registry ) ) { return count ( $ this -> data [ self :: REGISTRY ] [ $ registry ] ) ; } return 0 ; }
Retrieves the number of keys in registry
53,061
public function getRegistry ( $ registry ) { return $ this -> registryExists ( $ registry ) ? $ this -> data [ self :: REGISTRY ] [ $ registry ] : null ; }
Retrieves a registry collection based on its name
53,062
public function addRegistry ( $ registry ) { if ( $ this -> registryExists ( $ registry ) ) { return false ; } $ this -> data [ self :: REGISTRY ] [ $ registry ] = array ( ) ; $ this -> dirty = true ; return true ; }
Add new collection name
53,063
private function flush ( ) { if ( $ this -> dirty == false ) return true ; $ data = $ this -> data ; $ registry = $ this -> encode ( $ this -> data [ self :: REGISTRY ] ) ; $ data [ self :: META ] [ "updated" ] = date ( "c" ) ; $ data [ self :: META ] [ "hash" ] = md5 ( $ registry ) ; $ written = file_put_contents ( $ this -> getFile ( ) , $ this -> encode ( $ data ) ) ; if ( $ written === false ) throw new Exception ( strtr ( 'Unable to write back to {FILE}. Data will be lost!' , array ( '{FILE}' => $ this -> getFile ( ) ) ) ) ; return true ; }
Saves the global registry to the file
53,064
private function decode ( $ data ) { return function_exists ( 'json_decode' ) ? json_decode ( $ data , true ) : CJSON :: decode ( $ data , true ) ; }
JSON decodes the data
53,065
protected function generateGroupOptions ( ) { $ options = array ( ) ; $ fields = array ( 'widgetOptions, label' , 'labelOptions' , 'errorOptions' , 'hint' , 'hintOptions' , 'prepend' , 'prependOptions' , 'append' , 'appendOptions' , 'enableAjaxValidation' , 'enableClientValidation' ) ; foreach ( $ fields as $ prop ) { if ( isset ( $ this -> $ prop ) ) { $ options [ $ prop ] = $ this -> $ prop ; } } $ options [ 'widgetOptions' ] [ 'data' ] = $ this -> items ; return $ options ; }
Generates row options array from this class properties .
53,066
public function render ( ) { $ model = $ this -> getParent ( ) -> getModel ( ) ; $ attribute = $ this -> name ; $ options = $ this -> generateGroupOptions ( ) ; if ( isset ( self :: $ inputTypes [ $ this -> type ] ) ) { $ method = self :: $ inputTypes [ $ this -> type ] ; return $ this -> getParent ( ) -> getActiveFormWidget ( ) -> $ method ( $ model , $ attribute , $ this -> attributes , $ options ) ; } else { $ attributes = $ this -> attributes ; $ attributes [ 'model' ] = $ this -> getParent ( ) -> getModel ( ) ; $ attributes [ 'attribute' ] = $ this -> name ; return $ this -> getParent ( ) -> getActiveFormWidget ( ) -> customFieldGroup ( array ( array ( $ this -> getParent ( ) -> getOwner ( ) , 'widget' ) , array ( $ this -> type , $ attributes , true ) ) , $ model , $ attribute , $ options ) ; } }
Render this element .
53,067
public static function lead ( $ text , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'lead' , $ htmlOptions ) ; return self :: tag ( 'p' , $ htmlOptions , $ text ) ; }
Generates a paragraph that stands out .
53,068
public static function em ( $ text , $ htmlOptions = array ( ) , $ tag = 'p' ) { $ color = TbArray :: popValue ( 'color' , $ htmlOptions ) ; if ( TbArray :: popValue ( 'muted' , $ htmlOptions , false ) ) { self :: addCssClass ( 'muted' , $ htmlOptions ) ; } else { if ( ! empty ( $ color ) ) { self :: addCssClass ( 'text-' . $ color , $ htmlOptions ) ; } } return self :: tag ( $ tag , $ htmlOptions , $ text ) ; }
Generates an emphasized text .
53,069
public static function muted ( $ text , $ htmlOptions = array ( ) , $ tag = 'p' ) { $ htmlOptions [ 'muted' ] = true ; return self :: em ( $ text , $ htmlOptions , $ tag ) ; }
Generates a muted text block .
53,070
public static function abbr ( $ text , $ word , $ htmlOptions = array ( ) ) { if ( TbArray :: popValue ( 'small' , $ htmlOptions , false ) ) { self :: addCssClass ( 'initialism' , $ htmlOptions ) ; } $ htmlOptions [ 'title' ] = $ word ; return self :: tag ( 'abbr' , $ htmlOptions , $ text ) ; }
Generates an abbreviation with a help text .
53,071
public static function smallAbbr ( $ text , $ word , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'small' ] = true ; return self :: abbr ( $ text , $ word , $ htmlOptions ) ; }
Generates a small abbreviation with a help text .
53,072
public static function quote ( $ text , $ htmlOptions = array ( ) ) { $ paragraphOptions = TbArray :: popValue ( 'paragraphOptions' , $ htmlOptions , array ( ) ) ; $ source = TbArray :: popValue ( 'source' , $ htmlOptions ) ; $ sourceOptions = TbArray :: popValue ( 'sourceOptions' , $ htmlOptions , array ( ) ) ; $ cite = TbArray :: popValue ( 'cite' , $ htmlOptions ) ; $ citeOptions = TbArray :: popValue ( 'citeOptions' , $ htmlOptions , array ( ) ) ; $ cite = isset ( $ cite ) ? ' ' . self :: tag ( 'cite' , $ citeOptions , $ cite ) : '' ; $ source = isset ( $ source ) ? self :: tag ( 'small' , $ sourceOptions , $ source . $ cite ) : '' ; $ text = self :: tag ( 'p' , $ paragraphOptions , $ text ) . $ source ; return self :: tag ( 'blockquote' , $ htmlOptions , $ text ) ; }
Generates a quote .
53,073
public static function help ( $ text , $ htmlOptions = array ( ) ) { $ type = TbArray :: popValue ( 'type' , $ htmlOptions , self :: HELP_TYPE_INLINE ) ; self :: addCssClass ( 'help-' . $ type , $ htmlOptions ) ; return self :: tag ( $ type === self :: HELP_TYPE_INLINE ? 'span' : 'p' , $ htmlOptions , $ text ) ; }
Generates a help text .
53,074
public static function helpBlock ( $ text , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'type' ] = self :: HELP_TYPE_BLOCK ; return self :: help ( $ text , $ htmlOptions ) ; }
Generates a help block .
53,075
public static function formTb ( $ layout = self :: FORM_LAYOUT_VERTICAL , $ action = '' , $ method = 'post' , $ htmlOptions = array ( ) ) { return self :: beginFormTb ( $ layout , $ action , $ method , $ htmlOptions ) ; }
Generates a form tag .
53,076
public static function statefulFormTb ( $ layout = self :: FORM_LAYOUT_VERTICAL , $ action = '' , $ method = 'post' , $ htmlOptions = array ( ) ) { return self :: formTb ( $ layout , $ action , $ method , $ htmlOptions ) . self :: tag ( 'div' , array ( 'style' => 'display: none' ) , parent :: pageStateField ( '' ) ) ; }
Generates a stateful form tag .
53,077
public static function checkBox ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { $ label = TbArray :: popValue ( 'label' , $ htmlOptions , false ) ; $ labelOptions = TbArray :: popValue ( 'labelOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'checkbox' , $ labelOptions ) ; $ input = parent :: checkBox ( $ name , $ checked , $ htmlOptions ) ; return self :: createCheckBoxAndRadioButtonLabel ( $ label , $ input , $ labelOptions ) ; }
Generates a check box .
53,078
public static function listBox ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { if ( isset ( $ htmlOptions [ 'multiple' ] ) ) { if ( substr ( $ name , - 2 ) !== '[]' ) { $ name .= '[]' ; } } TbArray :: defaultValue ( 'displaySize' , 4 , $ htmlOptions ) ; return self :: dropDownList ( $ name , $ select , $ data , $ htmlOptions ) ; }
Generates a list box .
53,079
public static function radioButtonList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ inline = TbArray :: popValue ( 'inline' , $ htmlOptions , false ) ; $ separator = TbArray :: popValue ( 'separator' , $ htmlOptions , ' ' ) ; $ container = TbArray :: popValue ( 'container' , $ htmlOptions , 'span' ) ; $ containerOptions = TbArray :: popValue ( 'containerOptions' , $ htmlOptions , array ( ) ) ; $ labelOptions = TbArray :: popValue ( 'labelOptions' , $ htmlOptions , array ( ) ) ; $ items = array ( ) ; $ baseID = $ containerOptions [ 'id' ] = TbArray :: popValue ( 'baseID' , $ htmlOptions , parent :: getIdByName ( $ name ) ) ; $ id = 0 ; foreach ( $ data as $ value => $ label ) { $ checked = ! strcmp ( $ value , $ select ) ; $ htmlOptions [ 'value' ] = $ value ; $ htmlOptions [ 'id' ] = $ baseID . '_' . $ id ++ ; if ( $ inline ) { $ htmlOptions [ 'label' ] = $ label ; self :: addCssClass ( 'inline' , $ labelOptions ) ; $ htmlOptions [ 'labelOptions' ] = $ labelOptions ; $ items [ ] = self :: radioButton ( $ name , $ checked , $ htmlOptions ) ; } else { $ option = self :: radioButton ( $ name , $ checked , $ htmlOptions ) ; self :: addCssClass ( 'radio' , $ labelOptions ) ; $ items [ ] = self :: label ( $ option . ' ' . $ label , false , $ labelOptions ) ; } } $ inputs = implode ( $ separator , $ items ) ; return ! empty ( $ container ) ? self :: tag ( $ container , $ containerOptions , $ inputs ) : $ inputs ; }
Generates a radio button list .
53,080
public static function inlineRadioButtonList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: radioButtonList ( $ name , $ select , $ data , $ htmlOptions ) ; }
Generates an inline radio button list .
53,081
public static function inlineCheckBoxList ( $ name , $ select , $ data , $ htmlOptions = array ( ) ) { $ htmlOptions [ 'inline' ] = true ; return self :: checkBoxList ( $ name , $ select , $ data , $ htmlOptions ) ; }
Generates an inline check box list .
53,082
public static function uneditableField ( $ value , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'uneditable-input' , $ htmlOptions ) ; $ htmlOptions = self :: normalizeInputOptions ( $ htmlOptions ) ; return self :: tag ( 'span' , $ htmlOptions , $ value ) ; }
Generates an uneditable input .
53,083
public static function searchQueryField ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { self :: addCssClass ( 'search-query' , $ htmlOptions ) ; return self :: textField ( $ name , $ value , $ htmlOptions ) ; }
Generates a search input .
53,084
public static function textFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_TEXT , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a text field .
53,085
public static function passwordFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_PASSWORD , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a password field .
53,086
public static function urlFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_URL , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with an url field .
53,087
public static function emailFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_EMAIL , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with an email field .
53,088
public static function numberFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_NUMBER , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a number field .
53,089
public static function rangeFieldControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RANGE , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a range field .
53,090
public static function textAreaControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_TEXTAREA , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a text area .
53,091
public static function radioButtonControlGroup ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RADIOBUTTON , $ name , $ checked , $ htmlOptions ) ; }
Generates a control group with a radio button .
53,092
public static function checkBoxControlGroup ( $ name , $ checked = false , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_CHECKBOX , $ name , $ checked , $ htmlOptions ) ; }
Generates a control group with a check box .
53,093
public static function dropDownListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_DROPDOWNLIST , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with a drop down list .
53,094
public static function listBoxControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_LISTBOX , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with a list box .
53,095
public static function radioButtonListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_RADIOBUTTONLIST , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with a radio button list .
53,096
public static function inlineRadioButtonListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_INLINERADIOBUTTONLIST , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with an inline radio button list .
53,097
public static function checkBoxListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_CHECKBOXLIST , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with a check box list .
53,098
public static function inlineCheckBoxListControlGroup ( $ name , $ select = '' , $ data = array ( ) , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_INLINECHECKBOXLIST , $ name , $ select , $ htmlOptions , $ data ) ; }
Generates a control group with an inline check box list .
53,099
public static function searchQueryControlGroup ( $ name , $ value = '' , $ htmlOptions = array ( ) ) { return self :: controlGroup ( self :: INPUT_TYPE_SEARCH , $ name , $ value , $ htmlOptions ) ; }
Generates a control group with a search field .