# |
May 25th 2017, 20:31 |
inoas |
I had the basic twig things going but that saved me a lot of time |
# |
May 25th 2017, 20:31 |
inoas |
thank you so much to get me started/fueld and not having to reinvent everything |
# |
May 25th 2017, 20:31 |
WyriHaximus |
inoas: yeah I know, but I don't have a lot of time for it now. Might be a month or two before I get to it. So glad to see you're figuring it out, and learning a lot in the process :) |
# |
May 25th 2017, 20:30 |
meder_ |
ok sec |
# |
May 25th 2017, 20:30 |
inoas |
then Twig can cache it as PHP |
# |
May 25th 2017, 20:30 |
inoas |
so that you can write the string as a twig file |
# |
May 25th 2017, 20:30 |
inoas |
it should probably also be able to take an identifier |
# |
May 25th 2017, 20:30 |
inoas |
WyriHaximus: well that's what I am doing at the moment... |
# |
May 25th 2017, 20:29 |
jeremyharris |
meder_ try running `$this->Attachments->newEntity($attachment)` on one of your attachments to see what it produces |
# |
May 25th 2017, 20:29 |
WyriHaximus |
Using twig templates instead of PHP templates in all my projects. I'm also looking into making a filter or a function that takes a string and renders a twig template. |
# |
May 25th 2017, 20:29 |
jeremyharris |
this tells me that you have no Result entity (which is okay, it uses the default) and it is not patching the attachments array into entities https://gist.github.com/anonymous/70f9f90f2830ecf9614cc4f2a3cf6f28#file-entities-php-L14 |
# |
May 25th 2017, 20:28 |
jeremyharris |
also remove result_id, that should be automatically set on save |
# |
May 25th 2017, 20:28 |
meder_ |
ok |
# |
May 25th 2017, 20:28 |
jeremyharris |
for one |
# |
May 25th 2017, 20:28 |
jeremyharris |
remove the id |
# |
May 25th 2017, 20:27 |
meder_ |
sorry |
# |
May 25th 2017, 20:27 |
meder_ |
lot of file upload stuff there, but i think the issue is the id is blank as you said |
# |
May 25th 2017, 20:27 |
jeremyharris |
yeah I’m just getting confused by the differences |
# |
May 25th 2017, 20:27 |
meder_ |
i know it's recommended to paste the real code but honestly there was a crap ton of stuff i had to chop off. |
# |
May 25th 2017, 20:27 |
meder_ |
yes |
# |
May 25th 2017, 20:27 |
jeremyharris |
meder_ your Attachments table is in a plugin called Results, right? |
# |
May 25th 2017, 20:27 |
inoas |
but we cannot allow the "design agencies" that work with us to get access to the source code in any way... and we need revisions and translation, so we do it through the database |
# |
May 25th 2017, 20:26 |
inoas |
do you actually use TwigView to write twig template files instead of php ones within projects? cause it looked to me like that was its golden use case |
# |
May 25th 2017, 20:25 |
jeremyharris |
meder_ $attachments contains keys that your gist doesn’t even set |
# |
May 25th 2017, 20:25 |
inoas |
plugin_type_uuid_revision-uuid.twig |
# |
May 25th 2017, 20:25 |
inoas |
cause my twig files come from the database and look like FlexiCms_document_76ad7ef8_863b_456b_9490_c63d6ce0657a_76ad7ef8_863b_456b_9490_c63d6ce0657a.twig |
# |
May 25th 2017, 20:25 |
meder_ |
hm the id is blank yeah |
# |
May 25th 2017, 20:25 |
inoas |
I am not sure... I really would want to have twig template loading... like loading from a base template - but that won't be so easy |
# |
May 25th 2017, 20:24 |
WyriHaximus |
Yeah TwigView is designed to cover a lot more cases :) |
# |
May 25th 2017, 20:24 |
meder_ |
https://gist.github.com/anonymous/70f9f90f2830ecf9614cc4f2a3cf6f28 jeremyharris |
# |
May 25th 2017, 20:23 |
inoas |
I am just reusing the idea how to get helpers loaded <3 and the extensions :) |
# |
May 25th 2017, 20:23 |
inoas |
TwigView does a lot more |
# |
May 25th 2017, 20:23 |
inoas |
so I do not need to catch all kind of cases |
# |
May 25th 2017, 20:23 |
inoas |
well at least my stuff is tightly integrated |
# |
May 25th 2017, 20:22 |
WyriHaximus |
Aye, and if it doesn't, adept and release a new (major) verison |
# |
May 25th 2017, 20:21 |
inoas |
go the long run ;p? |
# |
May 25th 2017, 20:21 |
WyriHaximus |
inoas: awesome sounds great :D, only one way to find out how it works out in the long run ;) |
# |
May 25th 2017, 20:20 |
jeremyharris |
meder_ I think you are misusing $id there, as it is setting the id of the attachment. you should leave it empty so it is automatically associated with Results |
# |
May 25th 2017, 20:19 |
meder_ |
ok sec |
# |
May 25th 2017, 20:19 |
inoas |
but I am still unsure if the way I do things is good in the long run |
# |
May 25th 2017, 20:19 |
jeremyharris |
yes |