Recent content by asprin

  1. asprin

    XF 2.3 Downgrade addon's build?

    I ran the build release command on my addon and once the zip file was created (let's say it's v2) I bumped up the version (so now it's v3). Then I made some changes to some files (controllers, routes, templates etc). But now I realize I want to undo all those changes. So is there a way to have...
  2. asprin

    XF 2.3 Scratch Pad Thingy

    Where was the spelling error? In the code block you shared, I can't detect it...I'm curious now.
  3. asprin

    Poll Byte

    Thank you for the suggestion. I can certainly work something out.
  4. asprin

    XF 2.3 Retaining value for all pages of a thread?

    SELECT COUNT(*) FROM post WHERE thread_id = ? AND user_id = ? will give you all the posts made by the user in the thread. There's no pagination concept here since you're doing a COUNT aggregation which will return only a single numeric value.
  5. asprin

    XF 2.2 Required form element error message via phrase

    Thanks. Based on an earlier question of mine (where I learned about the verifyXXX() method), I was thinking of resorting to it as the final option. But I'm guessing there's no other way to achieve this so I'll go with this one only. It's a little interesting that for standard str columns, we...
  6. asprin

    XF 2.2 Required form element error message via phrase

    Any suggestions for being able to use own phrase for a required field that has allowedValues attribute? Don't like generic "Please enter a valid value" message.
  7. asprin

    XF 2.2 Entity field "required"=true does not work when type if UINT

    Is the "verify" part of the function name a predefined one? What I mean by that is whether XF, as a system, will look for any functions in the entity class file that starts with "verify" and run it during save/update (just like how _preSave() and _postSave() work) Or is it a custom function...
  8. asprin

    XF 2.2 Entity field "required"=true does not work when type if UINT

    In my custom entity, I have a field such as: 'foo' => ['type' => self::UINT, 'required' => true] The form is something like this: <xf:selectrow label="Foo" value="{$entity.foo}" name="foo"> <xf:option value="">Select One</xf:option> <option value="1">Abc</option> <option...
  9. asprin

    XF 2.2 Access $config variables in a Controller?

    Would it be possible to access $config['db']['dbname'] from inside an Admin controller? I would like to show some data related to the custom tables that my addon creates, so would need information about the database name (things like size on file, row count etc)
  10. asprin

    XF 2.2 xf:toggle check on click on xf:datarow

    Any suggestions? Perhaps @Jeremy P The goal is to have the checkbox get checked whenever any section of a row is clicked. Pretty similar to this https://stackoverflow.com/a/36045589 (I know it can be done via custom javascript but was wondering if it's supported out of the box)
  11. asprin

    XF 2.2 Conditional Template Extension?

    Sorry, but if you could can you share light on what this extension tag is used for? Like under which use case...seems interesting to me.
  12. asprin

    XF 2.2 Using keyed array in template

    Worked like a charm. Thanks.
  13. asprin

    XF 2.2 Using keyed array in template

    My controller has this: $colors = ['30' => 'blue', '55' => 'green']; $viewParams = [ 'colors' => $colors, 'entity1' => $entity1, 'entity2' => $entity2 ]; return $this->view('ASP\Foo:bar', 'asp_foo_bar', $viewParams); And my template has this <xf:comment> {$entity1.sys_id} -->...
  14. asprin

    XF 2.2 Conditional delete from database with entity framework

    Try with this (not tested obviously) $rows = \XF::finder('myaddon:myentity')->where('timestamp', '>', $timestamp); foreach($rows as $singleRow){ $singleRow->delete(); }
Back
Top Bottom