Re: 2 Models - one form

2009-06-01 Thread Ithaka

I think a simple way would be to validate using javascript.  You could
do some ajax or something when the field loses focus and send a
message above it, if it fails.

But other then that i'm not sure i haven't tried anything of that
sort.

On May 29, 1:32 pm, jgadbois jgadb...@gmail.com wrote:
 Thanks that helps a lot...I got it working. Now I have another
 problem :)  I would like the user to add as many ingredients as he/she
 wants.  Basically I have a link (Add another ingredient) that
 executes javascript and adds the new form fields.  This is all working
 fine and saving to the db via saveAll().  However, if for some reason
 validation fails, I lose the form fields added via javascript.  Is
 there any way to get around this?  In other words I think somehow the
 controller needs to detect the count of submitted ingredients and pass
 that back to the view.  Any ideas on how to do this?

 On May 29, 11:22 am, Ithaka justin_d1...@hotmail.com wrote:

  Pretty simple Jgadbois,

  Here could be a little example of what u would want. (in cakephp 1.2)

  //this doesn't have to be so complicated but im just showing u the
  options of the create
  //function. create('Recipe'); would automagically bring you to the add
  action.
  echo $form-create('Recipe', array('method' = 'post', 'url' = array
  ('action' = 'add')));
    echo $form-input('Recipe.name');
    echo $form-input('Ingredients.name');
    echo $form-input('Ingredients.quantity');
  echo $form-end();

  That is the code within the view, in the controller you can do all the
  logic you want with this stuff by looking at $this-data.
  $this-data would look something like this:
  array (
         [Recipe] = array (
                                    [name] = hot fudge cake
                                   )
         [Ingredients] = array (
                                         [name] = flower
                                         [quantity] = 2
                                         )
  )

  and to save this information all you need to do is use the saveAll
  function
  $this-Recipe-saveAll($this-data);

  the saveAll method looks for associations and saves the information
  properly.

  I hope this helped you, i'm not sure how new you are so i tried to put
  it as simple as possible and explain things.

  Happy Baking.

  On May 29, 10:44 am, jgadbois jgadb...@gmail.com wrote:

   What is the preferred way for handling a form with elements for
   mutitple models?  In my case, I'd like to have a form where you can
   add a Recipe with all of it's Ingredients (a recipe hasMany
   ingredients).  How would I handle this?  I'm new to CakePHP so I'm a
   little confused.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



radio buttons and observeField

2009-05-29 Thread Ithaka

Hi everybody,

I was just wondering if any has come across this or knows what i might
be doing wrong.

the problem:
I have a couple of radio buttons, i am observing these radio buttons
with ajax observeField.  When clicked the radio buttons update a div
which has a select box in it.  I have another observeField on the
select box that will update another select box.  All of this works
fine.  Except for one small thing with the radio buttons.  They only
set the XHR request once.  So after i use them once, nothing updates.

here is the code i use, maybe some one could give em some pointers or
see something i don't.  Maybe it's not even the code it's just
something that happens with the radio buttons.

[code]
/*** within the Reservation_sites/add.ctp view ***/

!-- table of radio buttons, probably not the
best way to do this, but it's just a test --
table cellpadding=0 cellspacing=0
tr
td class=radioSeparation
?php
echo 
$form-radio('ReservationSiteOptions.findByRegion', array(__
('Region', true), __('Province', true)), array('legend' = false,
'separator' = '/tdtd class=radioSeparation'));
?
/td
/tr
/table
!-- the div to be updated --
div id=category
/div
?php
$optCat = array('url' = 'update_category', 'update' = 'category');
//checking the source file showed me the ids of the radio buttons.
echo $ajax-observeField('ReservationSiteOptionsFindByRegion0',
$optCat);
echo $ajax-observeField('ReservationSiteOptionsFindByRegion1',
$optCat);
?

/*** function of update_category in reservation_sites controller ***/
function update_category()
{
Configure::write('debug', 0);
$frenchFlag = $this-_getCurrentLang(); // used for dynamic setting
of DB data in proper language.
$name = 'region_id';
$id = $this-data['ReservationSiteOptions']['findByRegion'];
if($id == 0) {
//region selected.
if($frenchFlag == true) {
$category = $this-Region-find('list', array('fields' 
= array
('Region.id', 'Region.nom')));
} else {
$category = $this-Region-find('list', array('fields' 
= array
('Region.id', 'Region.name')));
}
$name = 'region_id';
} else {
//province selected.
if($frenchFlag == true) {
$category = $this-Province-find('list', 
array('fields' = array
('Province.id', 'Province.nom')));
} else {
$category = $this-Province-find('list', 
array('fields' = array
('Province.id', 'Province.name')));
}
$name = 'province_id';
$this-log($category);
}
$this-set(compact('category', 'name'));
}

/*** within the Reservation_sites/update_category.ctp view **/
?php
if(!empty($category)) {
echo $form-select('ReservationSiteOptions.'.$name, $category, null,
array('id' = 'categoryList'));
} else {
__('There are no buildings in this region or province.');
}
echo $form-select('ReservationSiteOptions.building_id', array(),
null, array('id' = 'buildings'));
$options = array('url' = 'update_select', 'update' = 'buildings');
echo $ajax-observeField('categoryList', $options);
?
[/code]

All other things are for the 2nd select box but there are no problems
with that section so i did not include it.

Thank you for those who take the time to help.  See you guys later.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 2 Models - one form

2009-05-29 Thread Ithaka

Pretty simple Jgadbois,

Here could be a little example of what u would want. (in cakephp 1.2)

//this doesn't have to be so complicated but im just showing u the
options of the create
//function. create('Recipe'); would automagically bring you to the add
action.
echo $form-create('Recipe', array('method' = 'post', 'url' = array
('action' = 'add')));
  echo $form-input('Recipe.name');
  echo $form-input('Ingredients.name');
  echo $form-input('Ingredients.quantity');
echo $form-end();

That is the code within the view, in the controller you can do all the
logic you want with this stuff by looking at $this-data.
$this-data would look something like this:
array (
   [Recipe] = array (
  [name] = hot fudge cake
 )
   [Ingredients] = array (
   [name] = flower
   [quantity] = 2
   )
)

and to save this information all you need to do is use the saveAll
function
$this-Recipe-saveAll($this-data);

the saveAll method looks for associations and saves the information
properly.

I hope this helped you, i'm not sure how new you are so i tried to put
it as simple as possible and explain things.

Happy Baking.

On May 29, 10:44 am, jgadbois jgadb...@gmail.com wrote:
 What is the preferred way for handling a form with elements for
 mutitple models?  In my case, I'd like to have a form where you can
 add a Recipe with all of it's Ingredients (a recipe hasMany
 ingredients).  How would I handle this?  I'm new to CakePHP so I'm a
 little confused.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Multiple DB connections on 1 controller.

2009-02-13 Thread Ithaka

Hi everyone,

I have just released a a website to production and now we want to use
multiple applications within that site.  What I want to know is, is it
possible to tell the controller to select which db config to use?
Because right now, i have the new application in the website and when
i try to go to that section it gives me some auth errors because it
can't find the permissions table and user table. (At least that is
what i believe to be the problem.)

Thank you for any helpful comments.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple DB connections on 1 controller.

2009-02-13 Thread Ithaka


I believe i have found what i was looking for.  But it is still not
working correctly.  I'm assuming something else is not working
correctly.

For those that are curious about have multiple databases in the
controller, go here: https://trac.cakephp.org/ticket/1064

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple DB connections on 1 controller.

2009-02-13 Thread Ithaka

ugh wrong link, here you go:
http://groups.google.com/group/cake-php/browse_thread/thread/eacfade1d52c9071/f5e3c395037043b3

On Feb 13, 2:13 pm, Ithaka justin_d1...@hotmail.com wrote:
 I believe i have found what i was looking for.  But it is still not
 working correctly.  I'm assuming something else is not working
 correctly.

 For those that are curious about have multiple databases in the
 controller, go here:https://trac.cakephp.org/ticket/1064
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



translations in confirm messages part of html-link.

2008-06-18 Thread Ithaka

hey guys,

I was wondering if anyone has had this problem.  All my translations
are working except for those in the confirm messages part of the html-
link.  I'm looking at the source code in the browser and it's showing
me before every accent there is a  placed and that seems to be
the problem.  Once again, just wondering if anyone has encountered
this or could lend me a hand in finding out the problem.  Thanks.ks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Is Cake the right choice for this...?

2008-06-05 Thread Ithaka

hi kwer,

Welcome to cake, if you decide to choose it.

Here are a couple links that i found using google.

http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

http://www.reversefolds.com/articles/show/filehandler

I have used the first link provided when i was building my file upload
system for work.  It was a good example and it was pretty straight
forward.  I just finished reading the second link and it seems pretty
good except you have to use his component for it to work.  So i
suggest you learn CakePHP first before tackling your project since it
probably won't speed up the development if your always trolling the
internet for help.  If you have any problems don't be afraid to search
it before posting on google groups, many of the questions you will
have are already answered, somewhere.

On Jun 5, 4:05 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hi folks,

 I have to develop a file uploading system with the following
 requirements:

 - admin can add clients and projects (multiple projects for 1 client)
 - clients can log in and see files that were uploaded for them (by
 admin)
 - clients can upload files into an selectable project
 - clients and admin can comment uploaded files
 - client gets email when admin uploads new file/writes new comment and
 vice versa

 As I didn't find a out-of-the-box solution I'm about to choose a php
 framework to help me coding this.
 So far, the choice is down to CakePHP Vs. CodeIgniter.
 I already did a tiny project in CodeIgniter and thus I know it doesn't
 come with an authentication system. Knowing about  freak_auth as an
 handy external authentication library I'd still prefer having such a
 basic thin in the core.

 CakePHP on the other side doesn't seem to offer any helpers for file
 uploads, which CI does.

 As I regard authentication as way more complex than file uploading I
 feel like giving Cake a try, although I have to start from the
 scratch.

 Can anyone tell me if Cake's the right choice for my needs?
 (and maybe tell me how you manage file uploads?)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



design help.

2008-05-05 Thread Ithaka

Hey guys,

I've been wokring on a internet site for awhile now but i lost
interest in it near february and i want to try and get back into it.
So i'm gonna put it into CakePHP (which i did last time i was on it),
but the problem i am trying to get rid of is this.

I have a left and right side, the right being the control panel/menu,
left: the information.  So i've been thinking and i was wondering if
anyone had any suggestions on how they would do this.  1. have the
content_for_layout in the left side, and have a element or just put
the menu in the default layout. 2. have content_for_layout in both
side and have to  update both of them on every view. (doesn't sound so
efficient).  Those are 2 options i've come up with.  I'd really like
it if someone had a better idea or maybe something more effiecient.

Note: i have one page that would be using that right menu but not
statically, should that be with the options above or does anyone have
any suggestions.

Thank you in advance for any replies and/or any help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: accents not working with __()

2008-05-01 Thread Ithaka

Correction to my previous post: (était =  #233tait (without space))

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



accents not working with __()

2008-04-30 Thread Ithaka

Hi guys,

I was just wondering if any has come across this problem and found a
solution.  I've just finished doing my internationalization for french
and i found that if i do __('message', true); the accents will be
shown in there code form (était = était).  So what i can tell from
this is that it isn't being echo'd since it's in a variable or
function and this is causing the code to be placed and not the accent
character.  My CakePHP version is 1.2.0.6311.

Thanks in advance.e.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Passing variables to the layout.

2008-04-16 Thread Ithaka

...and???  Been looking at those sites, no sure what your trying to
point out.  Still trying to fix my problem.

On Apr 16, 1:58 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
 http://tempdocs.cakephp.org/http://book.cakephp.org/

 http://cakebaker.42dh.com/2007/04/05/whats-new-in-cakephp-12/

 hth - S

 On 16/04/2008, Ithaka [EMAIL PROTECTED] wrote:





  Hey guys,

  I was wondering if anyone could help me out with this problem.  I am
  currently running cakephp 1.2 and i wish to pass an array to my layout
  so that i may use that array in a drop down list.  I have my drop down
  list working but i'm having trouble getting my array to the layout.  I
  looked at this blog (http://cake-php.blogspot.com/2006/09/21-things-
  you-must-know-about-cakephp.html) but unfortunetely it's in 1.1 and
  the command he uses (? $this-_viewVars['somedata'] =
  array('some','data'); ? ) isn't working.  I've been searching around
  the API but haven't found a solution yet.  Thanks in advance!- Hide quoted 
  text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Passing variables to the layout.

2008-04-16 Thread Ithaka

ok well i am confused.  Don't worry it's not what you told me, it's
what i did.  Because i tried that in my layout before and it didn't
work, so i tried it just now after reading your post, just to see and
it worked.  So i mut ahve done something wrong the first time and
thought it didn't work.  But anyways thanks.  And at the same time i
found a way that it could ahve worked if your solution didn't work.
Pass the array to the params array, doesn't sound like a good solution
but it worked.  So thank you for making me see i did something stupid
and im glad it wasn't soemthing difficult.

On Apr 16, 2:42 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
 in the controller
             $testArray = Array('foo' = 'bar')
             $this-set('testArray', $testArray);

 in the view
     ?php print_r($testArray); ?

 try that

 On 16/04/2008, Ithaka [EMAIL PROTECTED] wrote:





  ...and???  Been looking at those sites, no sure what your trying to
  point out.  Still trying to fix my problem.

  On Apr 16, 1:58 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
  http://tempdocs.cakephp.org/http://book.cakephp.org/

  http://cakebaker.42dh.com/2007/04/05/whats-new-in-cakephp-12/

   hth - S

   On 16/04/2008, Ithaka [EMAIL PROTECTED] wrote:

Hey guys,

I was wondering if anyone could help me out with this problem.  I am
currently running cakephp 1.2 and i wish to pass an array to my layout
so that i may use that array in a drop down list.  I have my drop down
list working but i'm having trouble getting my array to the layout.  I
looked at this blog (http://cake-php.blogspot.com/2006/09/21-things-
you-must-know-about-cakephp.html) but unfortunetely it's in 1.1 and
the command he uses (? $this-_viewVars['somedata'] =
array('some','data'); ? ) isn't working.  I've been searching around

the API but haven't found a solution yet.  Thanks in advance!- Hide
  quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Too much automagic??

2008-02-25 Thread Ithaka

Hi,

I'm currently building a App for my work and in the layout we have our
login information instead of having a seperate page to do it.  The
problem i found, and have been trying to fix, is that when i go into
some of the pages, like edit the posts section and i am not logged in,
cakephp will input the username and password of the user that posted
that comment.  After looking in the source of the page i see that the
form grabs the information from data and inputs it into the fields, so
u literally see the values of those fields as the username and
password, which isn't that good of a security mesure :P.  So yes,
before people stop reading and start posting, Why don't u just have
the users log in or block them from editing if they don't have an
account?!?!  I know, but that's not the point, i wish to learn the
cause as to why my formhelper is generating the username and password
for the posted user in the login fields.  Thank you in advance, i'll
be looking into this more as the day goes on.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Too much automagic??

2008-02-25 Thread Ithaka

Hey thanks,

I figured out a way to get rid of the values, i simply put value = 
in the options array and it works, but thank you for your help.  I
will keep your code snippet in mind if something should araise later
on.

On Feb 25, 10:58 am, rtconner [EMAIL PROTECTED] wrote:
 If you are putting things into $this-data - yeah that is where cakes
 magic is. Cake has claimed the variable data as it's own.

 If you don't like the automagic, then just dont use $this-data. Code
 like that below works very well for me, when I dont want to use the
 automated for filling.

 $user = $this-User-read(null, $id);
 $this-set('user', $user);

 On Feb 25, 7:41 am, Ithaka [EMAIL PROTECTED] wrote:



  Hi,

  I'm currently building a App for my work and in the layout we have our
  login information instead of having a seperate page to do it.  The
  problem i found, and have been trying to fix, is that when i go into
  some of the pages, like edit the posts section and i am not logged in,
  cakephp will input the username and password of the user that posted
  that comment.  After looking in the source of the page i see that the
  form grabs the information from data and inputs it into the fields, so
  u literally see the values of those fields as the username and
  password, which isn't that good of a security mesure :P.  So yes,
  before people stop reading and start posting, Why don't u just have
  the users log in or block them from editing if they don't have an
  account?!?!  I know, but that's not the point, i wish to learn the
  cause as to why my formhelper is generating the username and password
  for the posted user in the login fields.  Thank you in advance, i'll
  be looking into this more as the day goes on.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



In need of guidance. multiple tables in model.

2008-02-13 Thread Ithaka

Hi everyone,

I've been searching the net trying to find some information about some
work that i am doing.  What i wish to do is filter all my posts by the
site_id's.  But now to make the select box easier for the user to
understand i wish the select box to show the name of the sites and
they can choose which site posts they wish to view.  Now the problem
i'm having to solve is getting the name of the site into the select
box, the select box is in the posts page.

So let's check if i'm in the right direction...sort of.  Right now i
have the $uses variable in my posts_controller with 'posts' and
'sites' which i believe would make the controller look at the tables
posts and sites?  Now the view is where i'm having the problems, of
course.  It cannot find $site.  I've tried setting 'sites' to $site
but that does not seem to work( $this-set('sites', $site) ) and then
for the select i have  $form-select($this-Site-findAll('name')).  I
had also added array('controller' = 'sites') in the select options to
see if that would do anything but i don't think that is what i want
since that only grabs the controller of sites.

Thank you to everyone who replies, and please if you can give atleast
a little description of your solution, not just links to some articles
that i have most likely already read, thank you again.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-06 Thread Ithaka

It still isn't working.

I put the javascript into app/webroot/js/
I put the javascript in project directory/webroot/js
I put the images in app/webroot/img
I put the images in project directory/webroot/img

And on the layout i have the html that finds the images but the
javascript doesn't seem to.

P.s. i made a typo with the script tags on my last post, it was
actually src.

On Feb 5, 5:25 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
 It should be pointing to /js/images.js , mod_rewrite will take care of
 the rest. Put your javascript in app/webroot/js/ .

 And

  script type=text/javascript
 rel=project directory/js/images.js/script

 should be:

  script type=text/javascript
 src=project_directory/js/images.js/script

 On Feb 5, 2008 6:57 PM, Ithaka [EMAIL PROTECTED] wrote:





  Hi dardo,

  Yes, i did as juan instructed i did $helpers with javascript and all
  those required in the controller.  And i checked in the source code
  and i found this quite odd.  script type=text/javascript
  rel=project directory/js/images.js/script, i made it so that it
  would generate in the head section.  But can u tell me why it's
  pointing to projectdirectory/js/images.js?? i thought cake had enough
  js folders already.  After I discovered this, I copied a js folder to
  match that directory yet it still does not work.  I'll keep trying
  stuff but this is getting strange.

  On Feb 5, 3:29 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
   Juan (in his first post) is suggesting that you put in the controller:

   var $helpers = array('Html', 'Form', 'Javascript');

   Also check the html rendered to the browser ('view source' in your
   browser) for the presence of your javascript, and check that  it is
   accessible via the linked url.

   On Feb 5, 2008 6:09 PM, Ithaka [EMAIL PROTECTED] wrote:

Quick update:  Juan, i understand where u are coming from with your
message.  The reason why i said i don't have anything on my app is
because i'm just doing the layout right now and i'm trying to load
javascript onto the layout.  So i a quick app close to teh blog
tutorial to test something and i load the javascript helper into the
controller.  I almost have the solution...the java loads, i believe,
but it still doesn't do anything.  And if your wondering, the java for
the layout is for my graphic buttons that are in the header part of
the layout.

On Feb 5, 2:36 pm, Ithaka [EMAIL PROTECTED] wrote:
 I've already done that so i'm missing something here.

 On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] wrote:

  El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

   No... i don't have any anything on my site yet except a default
   layout, how would i make a controller for the layout?

  I suggest you start reading the manual 
  (http://manual.cakephp.org/), and
  try to complete the tutorial
  (http://manual.cakephp.org/appendix/blog_tutorial) to get used with 
  the
  framework.- Hide quoted text -

 - Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-06 Thread Ithaka

Fixed it!

I just added it as normal html coding and it worked, i must have
something wrong in cakephp codes somewhere, i will investigate
further, but thanks everyone!

On Feb 6, 9:19 am, Ithaka [EMAIL PROTECTED] wrote:
 It still isn't working.

 I put the javascript into app/webroot/js/
 I put the javascript in project directory/webroot/js
 I put the images in app/webroot/img
 I put the images in project directory/webroot/img

 And on the layout i have the html that finds the images but the
 javascript doesn't seem to.

 P.s. i made a typo with the script tags on my last post, it was
 actually src.

 On Feb 5, 5:25 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:



  It should be pointing to /js/images.js , mod_rewrite will take care of
  the rest. Put your javascript in app/webroot/js/ .

  And

   script type=text/javascript
  rel=project directory/js/images.js/script

  should be:

   script type=text/javascript
  src=project_directory/js/images.js/script

  On Feb 5, 2008 6:57 PM, Ithaka [EMAIL PROTECTED] wrote:

   Hi dardo,

   Yes, i did as juan instructed i did $helpers with javascript and all
   those required in the controller.  And i checked in the source code
   and i found this quite odd.  script type=text/javascript
   rel=project directory/js/images.js/script, i made it so that it
   would generate in the head section.  But can u tell me why it's
   pointing to projectdirectory/js/images.js?? i thought cake had enough
   js folders already.  After I discovered this, I copied a js folder to
   match that directory yet it still does not work.  I'll keep trying
   stuff but this is getting strange.

   On Feb 5, 3:29 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
Juan (in his first post) is suggesting that you put in the controller:

var $helpers = array('Html', 'Form', 'Javascript');

Also check the html rendered to the browser ('view source' in your
browser) for the presence of your javascript, and check that  it is
accessible via the linked url.

On Feb 5, 2008 6:09 PM, Ithaka [EMAIL PROTECTED] wrote:

 Quick update:  Juan, i understand where u are coming from with your
 message.  The reason why i said i don't have anything on my app is
 because i'm just doing the layout right now and i'm trying to load
 javascript onto the layout.  So i a quick app close to teh blog
 tutorial to test something and i load the javascript helper into the
 controller.  I almost have the solution...the java loads, i believe,
 but it still doesn't do anything.  And if your wondering, the java for
 the layout is for my graphic buttons that are in the header part of
 the layout.

 On Feb 5, 2:36 pm, Ithaka [EMAIL PROTECTED] wrote:
  I've already done that so i'm missing something here.

  On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] 
  wrote:

   El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

No... i don't have any anything on my site yet except a default
layout, how would i make a controller for the layout?

   I suggest you start reading the manual 
   (http://manual.cakephp.org/), and
   try to complete the tutorial
   (http://manual.cakephp.org/appendix/blog_tutorial) to get used 
   with the
   framework.- Hide quoted text -

  - Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-06 Thread Ithaka

Found another way to fix it.

There is a controller called pages.ctb, in this file i added
javascript as a helper.

Then i did $javascript-link(); and it worked.  And im guessing to
make sure that js still works, when i enter in other pages that i
should start javascript aswell.

I leave this final comment for people that are having a hard time
starting with cake, hopefully this helps people.

On Feb 6, 9:31 am, Ithaka [EMAIL PROTECTED] wrote:
 Fixed it!

 I just added it as normal html coding and it worked, i must have
 something wrong in cakephp codes somewhere, i will investigate
 further, but thanks everyone!

 On Feb 6, 9:19 am, Ithaka [EMAIL PROTECTED] wrote:



  It still isn't working.

  I put the javascript into app/webroot/js/
  I put the javascript in project directory/webroot/js
  I put the images in app/webroot/img
  I put the images in project directory/webroot/img

  And on the layout i have the html that finds the images but the
  javascript doesn't seem to.

  P.s. i made a typo with the script tags on my last post, it was
  actually src.

  On Feb 5, 5:25 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:

   It should be pointing to /js/images.js , mod_rewrite will take care of
   the rest. Put your javascript in app/webroot/js/ .

   And

    script type=text/javascript
   rel=project directory/js/images.js/script

   should be:

    script type=text/javascript
   src=project_directory/js/images.js/script

   On Feb 5, 2008 6:57 PM, Ithaka [EMAIL PROTECTED] wrote:

Hi dardo,

Yes, i did as juan instructed i did $helpers with javascript and all
those required in the controller.  And i checked in the source code
and i found this quite odd.  script type=text/javascript
rel=project directory/js/images.js/script, i made it so that it
would generate in the head section.  But can u tell me why it's
pointing to projectdirectory/js/images.js?? i thought cake had enough
js folders already.  After I discovered this, I copied a js folder to
match that directory yet it still does not work.  I'll keep trying
stuff but this is getting strange.

On Feb 5, 3:29 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
 Juan (in his first post) is suggesting that you put in the controller:

 var $helpers = array('Html', 'Form', 'Javascript');

 Also check the html rendered to the browser ('view source' in your
 browser) for the presence of your javascript, and check that  it is
 accessible via the linked url.

 On Feb 5, 2008 6:09 PM, Ithaka [EMAIL PROTECTED] wrote:

  Quick update:  Juan, i understand where u are coming from with your
  message.  The reason why i said i don't have anything on my app is
  because i'm just doing the layout right now and i'm trying to load
  javascript onto the layout.  So i a quick app close to teh blog
  tutorial to test something and i load the javascript helper into the
  controller.  I almost have the solution...the java loads, i believe,
  but it still doesn't do anything.  And if your wondering, the java 
  for
  the layout is for my graphic buttons that are in the header part 
  of
  the layout.

  On Feb 5, 2:36 pm, Ithaka [EMAIL PROTECTED] wrote:
   I've already done that so i'm missing something here.

   On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] 
   wrote:

El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

 No... i don't have any anything on my site yet except a 
 default
 layout, how would i make a controller for the layout?

I suggest you start reading the manual 
(http://manual.cakephp.org/), and
try to complete the tutorial
(http://manual.cakephp.org/appendix/blog_tutorial) to get used 
with the
framework.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Having problems with javascript.

2008-02-05 Thread Ithaka

Hi,

I'm having a problem with javascript in cakephp 1.2.  As if that
wasn't obvious enough.

The Problem:
I wish to load javascript in the layout for my buttons and other
little functions i will implement later on.  I've been looking for the
past 2 days and i always see the same thing.
$javascript-link('script') and $_scripts_for_layout.  So i try doing
these in my layout yet the javascript does not load.  I keep getting
the error: undefined function: javascript and call to a member
function link() on a non object in... Another small problem i found
was that there are so many js folders in place, i don't know which one
to put them in.  I assumed it was in webroot/js/ but to make sure, i
put them everywehre i could.

Thank you in advance to everyone that leaves a positive response and/
or solution.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-05 Thread Ithaka

I've already done that so i'm missing something here.

On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] wrote:
 El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

  No... i don't have any anything on my site yet except a default
  layout, how would i make a controller for the layout?

 I suggest you start reading the manual (http://manual.cakephp.org/), and
 try to complete the tutorial
 (http://manual.cakephp.org/appendix/blog_tutorial) to get used with the
 framework.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-05 Thread Ithaka

No... i don't have any anything on my site yet except a default
layout, how would i make a controller for the layout?

On Feb 5, 3:01 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] wrote:
 El mar, 05-02-2008 a las 08:43 -0800, Ithaka escribió:





  Hi,
 Hello?

  I'm having a problem with javascript in cakephp 1.2.  As if that
  wasn't obvious enough.

  The Problem:
  I wish to load javascript in the layout for my buttons and other
  little functions i will implement later on.  I've been looking for the
  past 2 days and i always see the same thing.
  $javascript-link('script') and $_scripts_for_layout.  So i try doing
  these in my layout yet the javascript does not load.  I keep getting
  the error: undefined function: javascript and call to a member
  function link() on a non object in... Another small problem i found
  was that there are so many js folders in place, i don't know which one
  to put them in.  I assumed it was in webroot/js/ but to make sure, i
  put them everywehre i could.

  Thank you in advance to everyone that leaves a positive response and/
  or solution.

 Are you loading the JavaScript Helper on the controller?

 --
 No a la matriculación obligatoria:http://noalamatricula.wordpress.com
 Se libre usando Software Libre:http://www.gnu.org/
 Mi Blog:http://juanfgs.wordpress.com- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-05 Thread Ithaka

Quick update:  Juan, i understand where u are coming from with your
message.  The reason why i said i don't have anything on my app is
because i'm just doing the layout right now and i'm trying to load
javascript onto the layout.  So i a quick app close to teh blog
tutorial to test something and i load the javascript helper into the
controller.  I almost have the solution...the java loads, i believe,
but it still doesn't do anything.  And if your wondering, the java for
the layout is for my graphic buttons that are in the header part of
the layout.

On Feb 5, 2:36 pm, Ithaka [EMAIL PROTECTED] wrote:
 I've already done that so i'm missing something here.

 On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] wrote:



  El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

   No... i don't have any anything on my site yet except a default
   layout, how would i make a controller for the layout?

  I suggest you start reading the manual (http://manual.cakephp.org/), and
  try to complete the tutorial
  (http://manual.cakephp.org/appendix/blog_tutorial) to get used with the
  framework.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Having problems with javascript.

2008-02-05 Thread Ithaka

Hi dardo,

Yes, i did as juan instructed i did $helpers with javascript and all
those required in the controller.  And i checked in the source code
and i found this quite odd.  script type=text/javascript
rel=project directory/js/images.js/script, i made it so that it
would generate in the head section.  But can u tell me why it's
pointing to projectdirectory/js/images.js?? i thought cake had enough
js folders already.  After I discovered this, I copied a js folder to
match that directory yet it still does not work.  I'll keep trying
stuff but this is getting strange.

On Feb 5, 3:29 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote:
 Juan (in his first post) is suggesting that you put in the controller:

 var $helpers = array('Html', 'Form', 'Javascript');

 Also check the html rendered to the browser ('view source' in your
 browser) for the presence of your javascript, and check that  it is
 accessible via the linked url.

 On Feb 5, 2008 6:09 PM, Ithaka [EMAIL PROTECTED] wrote:





  Quick update:  Juan, i understand where u are coming from with your
  message.  The reason why i said i don't have anything on my app is
  because i'm just doing the layout right now and i'm trying to load
  javascript onto the layout.  So i a quick app close to teh blog
  tutorial to test something and i load the javascript helper into the
  controller.  I almost have the solution...the java loads, i believe,
  but it still doesn't do anything.  And if your wondering, the java for
  the layout is for my graphic buttons that are in the header part of
  the layout.

  On Feb 5, 2:36 pm, Ithaka [EMAIL PROTECTED] wrote:
   I've already done that so i'm missing something here.

   On Feb 5, 3:23 pm, Juan F. Gimenez Silva [EMAIL PROTECTED] wrote:

El mar, 05-02-2008 a las 11:12 -0800, Ithaka escribió:

 No... i don't have any anything on my site yet except a default
 layout, how would i make a controller for the layout?

I suggest you start reading the manual (http://manual.cakephp.org/), and
try to complete the tutorial
(http://manual.cakephp.org/appendix/blog_tutorial) to get used with the
framework.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---