Skip to content

Commit 57cb28f

Browse files
committed
Codeigniter with react code refactoring
1 parent dc18b06 commit 57cb28f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

application/views/react/content.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
<?php
88
// Get component class name to render it.
9-
$module_class = str_replace('_', '', ucwords($_module_name, '_'));
10-
11-
if( strpos( $module_class, '/' ) ) {
12-
$module_class = ucwords( basename( $module_class ) );
13-
}
9+
$module_class = preg_replace('/[_\/]/', '', ucwords($_module_name, '[_\/]'));
1410
?>
1511
<script type="text/babel">
1612
ReactDOM.render( < <?php echo $module_class; ?> /> , document.getElementById( '<?php echo $_module_dom_tag_id; ?>' ) );

0 commit comments

Comments
 (0)