Jump to content

Create new page with api from external script PW 3.0.25


fbg13
 Share

Recommended Posts

I'm trying to create a new page through a file outside of the PW system.

require('path/to/index.php');

$p = new Page();
$p->template = 'basic-page';
$p->parent = '/about/';
$p->title = 'Title';
$p->save();

Error:

  Reveal hidden contents

Echoing $wire->config->urls->assets works.

I'm executing the code from the command line.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...