E
E
EVOSandru62017-05-06 22:19:49
Yii
EVOSandru6, 2017-05-06 22:19:49

How to convert a hyphen expression to camelCase with a regular expression?

Good afternoon,
Upon receipt of the current controller:
Yii::$app->controller->id
I get:
begin-end
The controller is called BeginEndController
2 questions:
1. How to turn begin-end into beginEnd using php 2. Is there a similar deformation option using the framework itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
padlyuck, 2017-05-07
@EVOSandru6

why regular? Inflector::id2camel() is. discover there is a lot of useful stuff there. open BaseInflector and see what suits you best

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question