Created
April 12, 2017 21:14
-
-
Save hissy/b53b581ba1c74906ccc59b4057a67956 to your computer and use it in GitHub Desktop.
Content Import Snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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