return str_replace(LD.$name.RD, $value, $string);
<div class="controls">
{select id="bike_type"}
{if option_first_row}<option value="">Select a Value</option>{/if}
<option {selected} value="{option_value}" >{option_name}</option>
{/select}
</div>
The Notice goes away if I remove value="{option_value}". It does not like the curly brackets. How can I change this so it is okay with the curly brackets? function _parse_var_single($name, $value, $string)
{
// parse date variables where applicable
if (in_array($name, (array) $this->date_vars))
{
return $this->parse_date_variables($string, array($name => $value));
}
// Simple Variable - Find & Replace & Return
if (is_string($value))
{
return str_replace(LD.$name.RD, $value, $string);
}
//
// Complex Paths and Typography Variables
//
// If the single variable's value is an array, then
// $value[0] is the content and $value[1] is an array
// of parameters for the Typography class OR an indicator of a path variable
if (is_array($value) && count($value) == 2 && is_array($value[1]))
{
$raw_content = $value[0];
// Make our path switches
if (isset($value[1]['path_variable']) && $value[1]['path_variable'] === TRUE)
{
if (preg_match_all("#".LD."\s*".$name."=(.*?)".RD."#", $string, $matches))
{
$done = array();
foreach ($matches[0] as $full)
{
if (in_array($full, $done))
{
continue;
}
$link = ee()->functions->create_url(ee()->functions->extract_path($full).'/'.$value[0]);
//$single_quote = str_replace("'", '"', $matches['0']);
//$double_quote = str_replace("'", '"', $matches['0']);
//[0] => {id_path="about/test"}
//[1] => "about/test"
// Switch to double quotes
$single = str_replace(array('"', "'"), "'", $full);
$double = str_replace(array('"', "'"), '"', $full);
//echo $single.' - '.$double.'<br>';
$string = str_replace($single, $double, $string);
//echo $string;
//echo '<br>-----------------------<br>';
$string = str_replace($double, $link, $string);
$done[] = $full;
}
}
return $string;
}
$prefs = array();
foreach (array('text_format', 'html_format', 'auto_links', 'allow_img_url', 'convert_curly') as $pref)
{
if (isset($value[1][$pref]))
{
$prefs[$pref] = $value[1][$pref];
}
}
// Instantiate Typography only if necessary
ee()->load->library('typography');
ee()->typography->initialize(array(
'convert_curly' => (isset($prefs['convert_curly']) && $prefs['convert_curly'] == 'n') ? FALSE : TRUE)
);
$value = ee()->typography->parse_type($raw_content, $prefs);
}
if (isset($raw_content))
{
$this->conditional_vars[$name] = $raw_content;
}
// SPOKE Modification. I commented out the return. It was causing a PHP Notice. It is because it does not like any info inside of an option.
return str_replace(LD.$name.RD, $value, $string);
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE