These are chat archives for getkirby/chat

24th
Aug 2017
is Krisis
@krisak
Aug 24 2017 09:14
yes
@texnixe are you here?
Sonja Broda
@texnixe
Aug 24 2017 10:24
Yes, now
is Krisis
@krisak
Aug 24 2017 10:27
Is bastian busy or on holidays? I bought felliwship package but never got any response from him
I would like join the slack fun
Sonja Broda
@texnixe
Aug 24 2017 10:28
When did you buy the package? Bastian is not on holiday, he is busy preparing the next preview video
is Krisis
@krisak
Aug 24 2017 10:29
Well yesterday i think :D
Probably inpatient
Impatient
Sonja Broda
@texnixe
Aug 24 2017 10:30
And rightly so
I texted him on Slack
is Krisis
@krisak
Aug 24 2017 10:51
thaaanks
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:18
Where do you usually store your helper functions, lets say I have a function that formats the price for function formatPrice($priceInCents), for now I put this stuff in the config.php but i guess it will get quite long over time
I want to be able to call the function from every template/snippet
Sonja Broda
@texnixe
Aug 24 2017 15:22
I store such methods in a plugin file, or several
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:23
site/plugins/helpers/helpers.php and include from there?
Sonja Broda
@texnixe
Aug 24 2017 15:23
you don't have to include them, these files are auto loaded
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:24
yeah, i know :) just if you have several - but I guess you add them one by one - cool. so site/plugins/helperA.png, site/plugins/helperB.php, etc…
Sonja Broda
@texnixe
Aug 24 2017 15:25
you don't even need to put them into a separate directory, it works if you just put the file in the plugins folder (folder is cleaner, of course)
but you can't put several files in a subfolder
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:26
site/plugins/helpers/helpers.php // inside this file I would include helperA,B,C manually
site/plugins/helpers/helperA.php
site/plugins/helpers/helperB.php
site/plugins/helpers/helperC.php
Sonja Broda
@texnixe
Aug 24 2017 15:26
that won't work!
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:27
:-O
Sonja Broda
@texnixe
Aug 24 2017 15:27
you can have site/plugins/helper-a.php and site/plugins/helper-b.php etc.
or site/plugins/helper-a/helper-a.php and site/plugins/helper-b/helper-b.php etc.
And don't use camelCase in file names, please
Oh sorry, I missed your comment, yes, that will work, if you include the files manually
Pascal Küsgen
@Pascalmh
Aug 24 2017 15:30
cool :) thanks