Platon Technologies
not logged in Login Registration
open source software development celebrating 10 years of open source development! Monday, May 29, 2023
About Us
Open Source
Index  »  Projects  »  phpMyEdit  »  Documentation  »  HTML  »  Options variability

4.11. Options variability

This section does not descibe new field options. It just extends the possibility of their initialization. Options variability can be applied to each field option.

There is often a situation when you want to have some field option in effect only on particular page(s). But on other pages you do not want to have this option in effect. There are pages where a field option should be taken into consideration, but there are also pages where the option should not appear.

A good example for this is the ['trimlen'] option. Imagine you set something like this:

Example 4-43. Init without options variability

$opts['fdd']['col_name']['trimlen'] = 30;
This will trim the maximum length of text to 30 characters on all possible pages, which in this case are:

  • table list
  • table filter
  • record view
  • record delete

This is nice and it will work as expected, however on the record view page it may be desirable to see the whole field content, not only first 30 characters. Similarly we could want this also for delete page.

Thus there is a possiblity to restrict a particular option to affect only selected types of pages. In our case we want to resctrict the ['trimlen'] option to affect the table listing and table filtering pages. This can be done in the following way. Take a look at "|LF" string in the definition.

Example 4-44. Init with options variability

$opts['fdd']['col_name']['trimlen|LF'] = 30;

Each restriction letter stands for particular page type. They are the same as those described in list under Display options subsection.

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy