Call to a member function getPagesLinks() on string