Jump to content

Jo Justo

  • Content Count

  • Joined

  • Last visited

Community Reputation

6 Neutral

About Jo Justo

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I just checked my values in a Ubuntu 18 distro and sure enough I get 0, 1000, 1440 for those 3 settings. Thank you much for this. I will be testing and applying your findings for sure.
  2. For a front-end search form? One strategy I often use is concatenating the selector one input field at a time. Just make sure your add your validation. Something like this: $selector = ''; if($place = sanitizer()->selectorValue($input->post->place)) { $input->whitelist('place', $place); $selector .= ", place%=$place"; } if($input->post->doctor) { $input->whitelist('doctor', $input->post->doctor); if($input->post->doctor == '1') { $selector .= ", name=jim"; } elseif($input->post->doctor == '2') { $selector .= ", name=jon"; } elseif($input->post->doctor == '3') { $selector .= ", name=jake"; } } $limit = 12; $template = doctor; $parent = doctors; $selector .= ", sort=sort, limit=$limit"; $selector = "template=$template, parent=$parent" . $selector; $results = pages()->find->($selector);
  3. To whoever might be searching this topic, I just recently found out about $config->appendTemplateFile and started using it in a delayed template method. In my xml type templates (e.g. rss.php), "exit" seems to have the same effect (bypassing the _main.php template). if(input()->urlSegment1 != 'rss') throw new Wire404Exception(); $rss = wire('modules')->get('MarkupRSS'); $rss->title = 'RSS Feed'; $rss->description = ''; $rss->render($items); exit; But for AJAX, i might be inclined to use the suggested solutions above.
  4. I use an IDE and found it stressful to have to work-around deploying config.php This is how I found your thread. Thank you! I integrated your solution into my own workflow and came up with this to share back here: /site/config.php (like @bernhard except last line) // include config file from outside of the repo $client = 'config-' . end(explode('/',__FILE__, -2)); include("../$client.php"); The PHP end() function and the minus 2 in the explode(), always gets the URI domain base. (As long as PW keeps it there.) Since my usual deployment flow is from ABC.dev -> test.mybox.com/ABC -> ABC.com ...in my root folder, safely out of reach (like @bernhard's concept), I then create 3 files each containing config deployment differences. ../config-ABC.dev.php and ../config-ABC.php and ../config-ABC.com.php For those also using PHPStorm, since these files are located out of project, I would add them in Favorites. (And add it's root folders in Deployment Mappings). I can then easily make use of IDE features like "Compare Two Files", "Sync with Deployed to", etc. Removing doubts about what config property I may have missed across the board. No more stress.
  5. Good to know. Thanks. I didn't think to look in the database, and yes, I do see the value in it now but without the labels as you explained. My module implements a WireData. I just use it to store parameters and install some custom classes required for a nightly cron job. I can access the values by $module->get('fieldA'), but I was hoping to get the label too to include in the cron job. I'll probably change the input type to something else that saves both the label and the value. Thanks much all!
  6. Thanks for the quick response. I tried to var_dump the getModuleInfo() but it just gives the module's overview info. I was trying to get deeper, at the Inputfields.
  7. I am trying to get the "text Content" (not the value) portion of an InputfieldSelectMultiple property I created for an installed module. The selected options are saved in PW somewhere. How do I get at it? viz: <select name="fieldA"> <option selected value=0>Content 1</option> <option value=1>Content 2</option> <option selected value=2>Content 3</option> </select> I know its an array and that i'd have to access the options in a loop. But I can't seem to make the right call to any of the methods that return an array. So, here's an example of many that i tried and failed: $module = wire('modules')->get('ImportMyModule'); $field = $module->get('fieldA'); $options = $field->getOptions(); foreach($options as $key => $val) { echo "key: ", $key, " val: ", $val; } I can't figure out to get at just the "text Content" for now , then the selected one's after. (in the above sample "Content 1" and "Content 3") It'll save me a bunch of if's. Thanks forum!
  • Create New...