using page objects with custom files (v11)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mansour
User
Posts: 282

using page objects with custom files (v11)

Post by mansour »

hi,
scenario: i have a database table named as "tableA". normally phpmaker generate list, view , ... , etc for this table. (e.g. tablea_list.php).
i need to use page objects from tablea_list.php in my custom file.
how may i do that?
regards
mansour


mobhar
User
Posts: 11737

Post by mobhar »

You cannot include the *list.php file into your custom files. However, you may include the generated *info.php to get the properties/methods from it.

For example, you want to get the SQL SELECT from the "categories" table:

<?php
include_once "categoriesinfo.php";
$myclass = new ccategories();
echo $myclass->SqlSelect();
?>


rodrigofaustino
User
Posts: 5
Location: brazil

Post by rodrigofaustino »

I use normally file in custom paginalist.php.

<script type="text/javascript">
$(document).ready(function() {
$(".ewToolbar").hide();
});
</script>
<div class="panel panel-default">
<div class="panel-heading">Mensagens</div>
<div class="panel-body">

	<?php include_once "mensagemlist.php"; // Includes an external file ?>
 </div>

</div>

then the page will mensagemlist.php until the hyperlink viewtag
and add the href field: ID
prefix i writing: N.php?showdetail=&ID=
being the personalisado file that is used to mensagemlist.php is M.php
and the file is mensagemview.php is N.php


mobhar
User
Posts: 11737

Post by mobhar »

You're right. The list page can be included into the Custom File content. Sorry, that's my fault. :)

Unfortunately, I just saw two limitations when we include the List page into the Custom Files page:

  1. If the Custom Files and the List pages are generated which contains Header/Footer, then those pages will include the "footer.php" more than once. At least, once in Custom File, and the other in the List page. This will cause the broken Footer (the footer section will be displayed at the top right side of the Custom File page). In addition, "Page_Terminate" method that belongs to the List page will cause unwanted result if we include more than one List pages in Custom Files.

To overcome this issue (assume we include "categorieslist.php" page), then we have to change this code:
<?php include_once "footer.php" ?>
<?php
$categories_list->Page_Terminate();
?>

become:
<?php //include_once "footer.php" ?>
<?php
//$categories_list->Page_Terminate();
?>

Not sure whether ignoring the calling of "Page_Terminate" is recommended or not, but this did the trick. :)

  1. If the List page contains Detail Preview using Preview extension, then this feature will not work at all. Both the Detail Preview Overlay and Preview Row in the row will not work anymore. Perhaps this is caused by the missing link of the php filename that related to the Detail page (?).

Post Reply