# |
Sep 23rd 2011, 10:23 |
fenix` |
as in use an include statement or does phpcake have a library system? |
# |
Sep 23rd 2011, 10:21 |
rchavik |
make it a lib |
# |
Sep 23rd 2011, 10:20 |
fenix` |
so to access one function in both a view and a controller, i have to create it both a helper and appcontroller? |
# |
Sep 23rd 2011, 10:14 |
fenix` |
nvm googled it. |
# |
Sep 23rd 2011, 10:11 |
fenix` |
can you access helper functions from controllers or are they just for views? |
# |
Sep 23rd 2011, 10:02 |
ujjain |
How do I get sublinks under my Google results? |
# |
Sep 23rd 2011, 09:56 |
jgonca |
) |
# |
Sep 23rd 2011, 09:56 |
fenix` |
jgonca: yeah shows up under helpers as a general topic, i figure that was was just about the existing helpers. |
# |
Sep 23rd 2011, 09:54 |
jgonca |
it shows up, but it's not in the first results |
# |
Sep 23rd 2011, 09:53 |
fenix` |
rchavik: thanks, wierd that didn't show up in a search |
# |
Sep 23rd 2011, 09:52 |
rchavik |
http://book2.cakephp.org/en/views/helpers.html |
# |
Sep 23rd 2011, 09:52 |
jgonca |
fenix: but I think they've followed the same idea |
# |
Sep 23rd 2011, 09:51 |
fenix` |
jgonca: yeah i searched the 2.0 book no luck for creating helpers |
# |
Sep 23rd 2011, 09:51 |
jgonca |
~tell fenix` about book2 |
# |
Sep 23rd 2011, 09:50 |
jgonca |
fenix: you'll need to check the 2.0 docs, then |
# |
Sep 23rd 2011, 09:50 |
fenix` |
jgonca: is that valid for 2.0.0? |
# |
Sep 23rd 2011, 09:49 |
fenix` |
ok thanks. |
# |
Sep 23rd 2011, 09:49 |
fenix` |
is it just class Xhelper extends AppHelper{ function blah(){} }? |
# |
Sep 23rd 2011, 09:49 |
jgonca |
fenix: http://book.cakephp.org/view/1097/Creating-Helpers |
# |
Sep 23rd 2011, 09:47 |
byqsri |
hi .. I would use in my application date with repetitions (every monday etc...) ... exists in Cakphp some plugin to do this? |
# |
Sep 23rd 2011, 09:46 |
fenix` |
dakota: whats involved in writing a custom helper? |
# |
Sep 23rd 2011, 09:46 |
dakota |
rchavik: Well, I suppose a NULL != '' |
# |
Sep 23rd 2011, 09:46 |
rchavik |
dakota, it seems that it does not like NULLs |
# |
Sep 23rd 2011, 09:46 |
dakota |
fenix`: I remember telling you yesterday, controllers are only for 'controlling' the data flow between models and views. If you want a method/function that you want to run in your views, it should go into a helper |
# |
Sep 23rd 2011, 09:45 |
fenix` |
if i add doCalculation($x, $y) to appcontroller can i call it from a view? |
# |
Sep 23rd 2011, 09:44 |
fenix` |
can you access controller functions from views? |
# |
Sep 23rd 2011, 09:42 |
rchavik |
yes.. must be my code.. checking again now |
# |
Sep 23rd 2011, 09:41 |
dakota |
rchavik: 1.3? |
# |
Sep 23rd 2011, 09:41 |
dakota |
odd, there's even a test case for it :/ |
# |
Sep 23rd 2011, 09:41 |
rchavik |
~tell rchavik about broken |
# |
Sep 23rd 2011, 09:40 |
rchavik |
dakota, okay.. i thought so, but it does not work |
# |
Sep 23rd 2011, 09:39 |
dakota |
https://github.com/cakephp/cakephp/blob/master/cake/tests/cases/libs/set.test.php#L655 |
# |
Sep 23rd 2011, 09:38 |
dakota |
'/User[email=]' |
# |
Sep 23rd 2011, 09:38 |
dakota |
rchavik: even simpler |
# |
Sep 23rd 2011, 09:37 |
dakota |
so you could probably use that? |
# |
Sep 23rd 2011, 09:36 |
dakota |
rchavik: it supports regex |
# |
Sep 23rd 2011, 09:36 |
rchavik |
eg, get all users who have no email |
# |
Sep 23rd 2011, 09:35 |
rchavik |
is there a way for Set::extract() to filter by empty fields |
# |
Sep 23rd 2011, 08:51 |
destinydriven |
ADmad, thank you |
# |
Sep 23rd 2011, 08:51 |
destinydriven |
dakota, thanks |
# |
Sep 23rd 2011, 08:51 |
destinydriven |
it works :D |