Skip to content

Instantly share code, notes, and snippets.

@hissy
Created April 12, 2017 21:14
Show Gist options
  • Save hissy/b53b581ba1c74906ccc59b4057a67956 to your computer and use it in GitHub Desktop.
Save hissy/b53b581ba1c74906ccc59b4057a67956 to your computer and use it in GitHub Desktop.
Content Import Snippet
<?php
Route::register('/import', function() {
$request = (string) $_POST['xml'];
if ($request) {
$importer = new \Concrete\Core\Backup\ContentImporter();
$importer->importContentString($request);
}
?>
<form action="/index.php/import" method="post">
<?php
$form = Core::make('helper/form');
echo $form->textarea('xml');
echo $form->submit('submit', 'Import');
?>
</form>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment