/** * Replace all ITEM:* placeholders contained in a URL (or a string). * * @param string $url The URL wherein will be replaced the placeholders. * @param F0FTable $table A table object instance from which get known fields to replace. * * @return string The replaced URL. */ private function getReplacedPlaceholders($url, F0FTable &$table) { // Ask to table which are the fields to replace $fields = $table->getKnownFields(); // Replace all placeholders in the URL foreach ($fields as $field) { $url = str_replace('[ITEM:' . strtoupper($field) . ']', $table->get($field), $url); } return $url; }