# |
Sep 23rd 2011, 10:58 |
dakota |
fenix`: or, perhaps better would be to use static methods, then you can just do Convert::boolVal() anywhere |
# |
Sep 23rd 2011, 10:58 |
fenix` |
got it |
# |
Sep 23rd 2011, 10:58 |
fenix` |
then $convert->boolVal(); |
# |
Sep 23rd 2011, 10:58 |
dakota |
fenix`: yup |
# |
Sep 23rd 2011, 10:58 |
dakota |
fenix`: so you'd have to create a instance of the object yourself |
# |
Sep 23rd 2011, 10:57 |
fenix` |
ok so $convert = new Convert(); |
# |
Sep 23rd 2011, 10:57 |
dakota |
fenix`: App::uses is basically the same as include($filename); |
# |
Sep 23rd 2011, 10:57 |
dakota |
fenix`: neither |
# |
Sep 23rd 2011, 10:56 |
fenix` |
or is it like App::Convert()? |
# |
Sep 23rd 2011, 10:56 |
fenix` |
i get call to member function on a non-object |
# |
Sep 23rd 2011, 10:56 |
fenix` |
$this->Convert->boolVal(1); |
# |
Sep 23rd 2011, 10:56 |
fenix` |
App::uses('Convert', 'Lib'); |
# |
Sep 23rd 2011, 10:54 |
rchavik |
if you put in appcontroller, then it will be avialable app wide, before class , then only in that particular class instance, in method, well, in method and its views |
# |
Sep 23rd 2011, 10:52 |
rchavik |
up to you.. :) |
# |
Sep 23rd 2011, 10:52 |
fenix` |
inside class dec? or inside function |
# |
Sep 23rd 2011, 10:51 |
fenix` |
so where do i put App::uses? outside the class declarations? |
# |
Sep 23rd 2011, 10:50 |
rchavik |
App::import is for 1.3 |
# |
Sep 23rd 2011, 10:49 |
fenix` |
that didn't work so i 'll try yours |
# |
Sep 23rd 2011, 10:49 |
fenix` |
rchavik: manual says use this format: App::uses('PaymentProcessor', 'Lib'); |
# |
Sep 23rd 2011, 10:48 |
dakota |
yeah, I'd make a utility class in libs/ |
# |
Sep 23rd 2011, 10:48 |
rchavik |
libs/convert.php -> App::import('Lib', 'convert'); |
# |
Sep 23rd 2011, 10:48 |
fenix` |
basic utility functions, stuff like value conversion. |
# |
Sep 23rd 2011, 10:47 |
dakota |
fenix`: what kind of functions? |
# |
Sep 23rd 2011, 10:47 |
rchavik |
it's the lib dir (inside the app) |
# |
Sep 23rd 2011, 10:45 |
fenix` |
anyway, im looking for the simplest way to have functions that are accessible to both controllers and views |
# |
Sep 23rd 2011, 10:45 |
fenix` |
oh. right |
# |
Sep 23rd 2011, 10:45 |
dakota |
vendor assets == javascript, css, image, etc. |
# |
Sep 23rd 2011, 10:44 |
fenix` |
upport for vendor assets have been removed for 1.3. It is recommended that you take any vendor assets you have and repackage them into plugins. See Plugin assets for more information. |
# |
Sep 23rd 2011, 10:35 |
dakota |
fenix`: who says vendors aren't supported in 2.0? |
# |
Sep 23rd 2011, 10:33 |
fenix` |
with a libs class do i have to extend anything? |
# |
Sep 23rd 2011, 10:28 |
fenix` |
vendors are no longer supported in 2.0.0, does this apply to libs? |
# |
Sep 23rd 2011, 10:27 |
rchavik |
http://book.cakephp.org/2.0/en/getting-started/cakephp-folder-structure.html?highlight=Lib |
# |
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 |