本文整理汇总了PHP中TextHelper::camelize方法的典型用法代码示例。如果您正苦于以下问题:PHP TextHelper::camelize方法的具体用法?PHP TextHelper::camelize怎么用?PHP TextHelper::camelize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextHelper
的用法示例。
在下文中一共展示了TextHelper::camelize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: visual_effect
/**
* Returns a JavaScript snippet to be used on the AJAX callbacks for starting
* visual effects.
*
* Example:
* ScriptaculousHelper::visual_effect('highlight', 'posts',
* array('duration' => 0.5 ));
*
* If no '$element_id' is given, it assumes "element" which should be a local
* variable in the generated JavaScript execution context. This can be used
* for example with drop_receiving_element():
*
* ScriptaculousHelper::drop_receving_element(..., array(...
* 'loading' => ScriptaculousHelper::visual_effect('fade')));
*
* This would fade the element that was dropped on the drop receiving element.
*
* You can change the behaviour with various options, see
* http://script.aculo.us for more documentation.
*
* @param type <description>
* @param type <description>
* @param type <description>
*
* @return string <description>
*/
function visual_effect($name, $element_id = FALSE, $js_opt = array())
{
$element = $element_id ? "'{$element_id}'" : 'element';
switch ($name) {
case 'toggle_appear':
case 'toggle_blind':
case 'toggle_slide':
return sprintf("new Effect.toggle(%s, '%s', %s)", $element, substr($name, 7), JsHelper::options_for_javascript($js_opt));
}
return sprintf("new Effect.%s(%s, %s)", TextHelper::camelize($name), $element, JsHelper::options_for_javascript($js_opt));
}
示例2: insert_html
/**
* Inserts HTML at the specified 'position' relative to the DOM element
* identified by the given 'id'.
*
* 'position' may be one of:
*
* 'top':: HTML is inserted inside the element, before the
* element's existing content.
* 'bottom':: HTML is inserted inside the element, after the
* element's existing content.
* 'before':: HTML is inserted immediately preceeding the element.
* 'after':: HTML is inserted immediately following the element.
*
* @param type <description>
* @param type <description>
* @param type <description>
*
* @return type <description>
*/
function insert_html($position, $id, $content)
{
$insertion = TextHelper::camelize($position);
$this->call('new Insertion.' . $insertion, $id, $content);
}
示例3: test_camelize
function test_camelize()
{
$foo = TextHelper::camelize('foo_bar_baz/FOO is great');
$this->assertEqual('FooBarBazFOOIsGreat', $foo);
}