Jump to content

Add to PageArray


rooofl
 Share

Recommended Posts

Hello, I am trying to add a page to Page Reference field. Here is what I do:

  $testpage = $pages->get(1252); // Page to edit
  $designersField = $testpage->designers; // Page field to fill
  $designerArray = [];

  $toadd = $pages->get(1200); // Page to add
  array_push($designerArray, $toadd);

  $designersField = PageArray($designerArray);
  // $testpage->save(); should I save?

  var_dump($designersField);

When I var_dump() the page, I can see that my `designer` page has been aded. However in the admin page view, nothing is listed in the AsmSelect field. What do I miss?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...