本文整理汇总了PHP中Contao\StringUtil::srcToInsertTag方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::srcToInsertTag方法的具体用法?PHP StringUtil::srcToInsertTag怎么用?PHP StringUtil::srcToInsertTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contao\StringUtil
的用法示例。
在下文中一共展示了StringUtil::srcToInsertTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertFileSourceToUuid
/**
* Convert file source to uuid before save the model.
* After convert this is an insert tag {{file::uuid}}.
*
* @param EncodePropertyValueFromWidgetEvent $event The event to handle.
*
* @return void
*/
public function convertFileSourceToUuid(EncodePropertyValueFromWidgetEvent $event)
{
$environment = $event->getEnvironment();
$dataDefinition = $environment->getDataDefinition();
$propertiesDefinition = $dataDefinition->getPropertiesDefinition();
$property = $propertiesDefinition->getProperty($event->getProperty());
if (!array_key_exists('rte', $property->getExtra()) || strpos($property->getExtra()['rte'], 'tiny') !== 0) {
return;
}
$event->setValue(StringUtil::srcToInsertTag($event->getValue()));
}
示例2: row
//.........这里部分代码省略.........
if ($this->varValue != \Input::post($this->strInputName)) {
$newPaletteFields = \StringUtil::trimsplit('[,;]', $this->getPalette());
}
}
}
// Adjust the names in editAll mode
if (\Input::get('act') == 'editAll') {
foreach ($newPaletteFields as $k => $v) {
$newPaletteFields[$k] = $v . '_' . $this->intId;
}
if ($this->User->isAdmin) {
$newPaletteFields['pid'] = 'pid_' . $this->intId;
$newPaletteFields['sorting'] = 'sorting_' . $this->intId;
}
}
$paletteFields = array_intersect($postPaletteFields, $newPaletteFields);
// Validate and save the field
if (in_array($this->strInputName, $paletteFields) || \Input::get('act') == 'overrideAll') {
$objWidget->validate();
if ($objWidget->hasErrors()) {
// Skip mandatory fields on auto-submit (see #4077)
if (\Input::post('SUBMIT_TYPE') != 'auto' || !$objWidget->mandatory || $objWidget->value != '') {
$this->noReload = true;
}
} elseif ($objWidget->submitInput()) {
$varValue = $objWidget->value;
// Sort array by key (fix for JavaScript wizards)
if (is_array($varValue)) {
ksort($varValue);
$varValue = serialize($varValue);
}
// Convert file paths in src attributes (see #5965)
if ($varValue && isset($arrData['eval']['rte']) && strncmp($arrData['eval']['rte'], 'tiny', 4) === 0) {
$varValue = \StringUtil::srcToInsertTag($varValue);
}
// Save the current value
try {
$this->save($varValue);
} catch (\Exception $e) {
$this->noReload = true;
$objWidget->addError($e->getMessage());
}
}
}
}
$wizard = '';
$strHelpClass = '';
// Date picker
if ($arrData['eval']['datepicker']) {
$rgxp = $arrData['eval']['rgxp'];
$format = \Date::formatToJs(\Config::get($rgxp . 'Format'));
switch ($rgxp) {
case 'datim':
$time = ",\n timePicker:true";
break;
case 'time':
$time = ",\n pickOnly:\"time\"";
break;
default:
$time = '';
break;
}
$wizard .= ' ' . \Image::getHtml('assets/datepicker/images/icon.svg', '', 'title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['datepicker']) . '" id="toggle_' . $objWidget->id . '" style="cursor:pointer"') . '
<script>
window.addEvent("domready", function() {
new Picker.Date($("ctrl_' . $objWidget->id . '"), {
示例3: srcToInsertTag
/**
* Convert file paths inside "src" attributes to insert tags.
*
* @param string $data The markup string.
*
* @return string The markup with file paths converted to insert tags
*/
public static function srcToInsertTag($data)
{
if (self::isStringUtilAvailable()) {
return StringUtil::srcToInsertTag($data);
}
return \Contao\String::srcToInsertTag($data);
}