Don’t know if I worded the question right, but basically what I want to know is if there is an easier (shorter) way of doing the following:
switch( $type ) {
case 'select': $echo = $this->__jw_select( $args ); break;
case 'checkbox': $echo = $this->__jw_checkbox( $args ); break;
case 'radio': $echo = $this->__jw_radio( $args ); break;
case 'input': $echo = $this->__jw_input( $args ); break;
case 'textarea': $echo = $this->__jw_textarea( $args ); break;
default: return null;
}
Is there any way I could do something like $echo = $this->__jw_{$type}( $args );? I tried this code but of course, it failed. Any ideas?
or even more simply,