Re: Associated model won't load

2010-02-16 Thread Furuno
Okay somebody please tell me that this is some kind of mystical phenomenon : yeah, I've tried using containable behaviors, not using pagination, not using admin routes, redownload the cakephp library, reinstalling apache and mysql, and anything I can think about other that reinstall the OS and upgr

Re: Error: The view for PostsController::index() was not found.

2010-02-16 Thread John Andersen
Check that you index.ctp file is named index.ctp, not Index.ctp or other variants :) Enjoy, John On Feb 17, 1:59 am, ldjpr wrote: > I just started to give a test drive to CakePHP following the blog > tutorial. I am getting the following errors: > > Error: The view for PostsController::index()

Re: Form helper doesn't show correct field type when using another model

2010-02-16 Thread John Andersen
You probably have to not only state that you use the State model, but also the Person model. Or it may be enough if you in the view, creates the state field using 'State.state', so that the forms helper, know to which model the state belong. Hope this helps you on the way, John On Feb 17, 6:28 

Re: SSL and https

2010-02-16 Thread Jeremy Burns
Any takers on this please? Jeremy Burns jeremybu...@me.com On 12 Feb 2010, at 05:00, Jeremy Burns wrote: > I am using the security component from app_controller. In some > controllers I have this in my beforeFilter: > > if (in_array($this->params['action'], $action)): > $th

Re: Accessing Model.Method from Component using ClassRegistry

2010-02-16 Thread Miles J
Your AppModel is being used instead of the actual model. This usually happens when your model is misspelt or its filename is wrong. On Feb 16, 8:00 pm, amiable_indian wrote: > I am trying to access one of the models ( Example ) from my Component > ( TestComponent ). The Example model is similar t

Accessing Model.Method from Component using ClassRegistry

2010-02-16 Thread amiable_indian
I am trying to access one of the models ( Example ) from my Component ( TestComponent ). The Example model is similar to what is shown in cakephp example-code on page : http://book.cakephp.org/view/72/Additional-Methods-and-Properties To access the Model class, I tried ClassRegistry::init method

Form helper doesn't show correct field type when using another model

2010-02-16 Thread aveev
Hi, I'm a new cake user... I have this table ddl CREATE TABLE IF NOT EXISTS `people` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `pob` varchar(25) DEFAULT NULL, `dob` date NOT NULL, `address` text NOT NULL, `created` datetime DEFAULT NULL, `modified`

Couple of REST questions

2010-02-16 Thread SonnyBurnette
I just setup a simple example to test REST. I have been able to create, edit, delete, etc. How do I ignore REST calls to delete and edit but still allow it from the normal web interface? example: The web interface can go to www.domain.com/users/edit/5 but I don't want to allow any REST calls there

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread calzone
Thank you John. I love the internet. Here I have requested help on a problem I encountered and it came from halfway around the world! I have discovered the source of the issue finally: Amazingly, if you are using the security component and have a disabled a field on a form, the data submission w

Re: Web Service cakePHP

2010-02-16 Thread ivan
what with REST cakePHP, we can send many data (array)? What easy to implementation is it? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. T

Re: Web Service cakePHP

2010-02-16 Thread ivan
What you have the best recommendation tutorial about make REST with cakePHP? please give me simple helper but the best helper. At now i make final task in my university. Thanks before. God Bless You all. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP

Re: Ajax update without url / Just to show/hide some inputs

2010-02-16 Thread edwingt
I solved doing this echo $form->input('Periodico',array('onclick' =>"Effect.toggle('period', 'blind');")); because I already have scriptaculous working on my app. On 16 feb, 18:15, edwingt wrote: > Thanks Jhon > > On 16 feb, 10:11, John Andersen wrote: > > > What you want to do is not an ajax re

Error: The view for PostsController::index() was not found.

2010-02-16 Thread ldjpr
I just started to give a test drive to CakePHP following the blog tutorial. I am getting the following errors: Error: The view for PostsController::index() was not found. Error: Confirm you have created the file: /htdocs/cake/app/views/posts/ index.ctp I am sure the files have been created. I hav

Re: Ajax update without url / Just to show/hide some inputs

2010-02-16 Thread edwingt
Thanks Jhon On 16 feb, 10:11, John Andersen wrote: > What you want to do is not an ajax request, just use ordinary > javascript to hide/show the element. > Enjoy, >    John > > On Feb 16, 5:48 pm, edwingt wrote: > > > I have a questio, > > is posible to create an ajax call just to show and hide

Re: Associated model won't load

2010-02-16 Thread Furuno
WIll try once I got to back to my office (it's 6.30 AM currently)... thanks! On 17 Feb, 03:58, John Andersen wrote: > I assume that you are not using the Containable behaviour, so my last > suggestion is - have a look at the Containable behaviour, I use it > myself and it saved a lot of time when

Re: How do I populate a model with XML

2010-02-16 Thread Greg Skerman
XML is some stock data i need to pull back on a daily basis. I will store the data in a table once i've got it, but i want to be able to deal with the XML data as a cake model before that. On Wed, Feb 17, 2010 at 3:10 AM, John Andersen wrote: > What is the content of the XML data? What is the pur

Re: Can't configure Memcached properly

2010-02-16 Thread Kareem Sabri
I see, I misunderstood. I've altered my core configuration file and now have: Cache::config('_cake_core_', array('engine' => 'File')); Cache::config('_cake_model_', array('engine' => 'File')); Cache::config('default', array( 'engine' =>

Re: Can't configure Memcached properly

2010-02-16 Thread Pablo Viojo
The configuration that I send allows you to use memcached (or whatever you like) for all caches but the internal cake's cache (that should use file) I have this configuration in a prod environment (using several memcached servers) and it works fine. Regards, Pablo Viojo pvi...@gmail.com http://

Re: Can't configure Memcached properly

2010-02-16 Thread Kareem Sabri
Thanks for your reply Pablo. I'm able to use CakePHP's File Engine for cacheing, however this has numerous drawbacks when compared to memcached: I don't cache view files, because all of my pages require the controller to run and usually a database query as well, so I cache database queries. Cach

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread John Andersen
Have you tried a debug($this->data) in the beforeFilter method? Anyway, I hope you find a solution, wish you good night here from Latvia :) John On Feb 16, 10:09 pm, calzone wrote: > Your assumption is correct. Basically, all login and admin functions > should be managed over ssl and I want to

Re: Associated model won't load

2010-02-16 Thread John Andersen
I assume that you are not using the Containable behaviour, so my last suggestion is - have a look at the Containable behaviour, I use it myself and it saved a lot of time when I want to be sure that I retrieve not only one model but also associated models from up to several levels of associations.

Re: Associated model won't load

2010-02-16 Thread Furuno
Well, actually, yes... :) To make sure that everything runs fine, I'm actually creating the refinements of my final prototype application (an online exam system), and I've obviously copy paste anything from the protype code, the new stuff here is just pagination. I've tried removing pagination too

Re: Associated model won't load

2010-02-16 Thread John Andersen
Have you checked that the Subject model filename is subject.php? And the model is named Subject not subject? Just trying to throw something around, which usually creates these kind of problems :) Maybe copy/paste the Subject model into a post! John On Feb 16, 10:20 pm, Furuno wrote: > tried

Re: Associated model won't load

2010-02-16 Thread Furuno
tried that too... still no luck... Really, I think I've exhausted a lot of methods already but still can't fix it... On 17 Feb, 03:09, John Andersen wrote: > Damn :) Ok, have you tried adding the uses variable? > > [code] >    var $uses = array('Subject'); > [/code] > > in the Subjects controller

Re: How to include a button which links to a view?

2010-02-16 Thread Miles J
Or you can just do it the normal way: Go to On Feb 16, 8:17 am, sebb86 wrote: > WebbedIT > > It works. Thanks a lot! :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread calzone
Your assumption is correct. Basically, all login and admin functions should be managed over ssl and I want to turn off ssl when it's not necessary. I could try commenting out the redirect stuff to really rule it out, but considering all my other admin and non-admin, ssl and non ssl controllers wor

Re: Associated model won't load

2010-02-16 Thread John Andersen
Damn :) Ok, have you tried adding the uses variable? [code] var $uses = array('Subject'); [/code] in the Subjects controller! John On Feb 16, 9:49 pm, Furuno wrote: > well, I'm afraid it's only in the post... > > On 17 Feb, 02:38, John Andersen wrote: > > > Are you missing a semicolon in

Re: Associated model won't load

2010-02-16 Thread Furuno
well, I'm afraid it's only in the post... On 17 Feb, 02:38, John Andersen wrote: > Are you missing a semicolon in this code? > > [code] > class Subject extends AppModel { >         var $belongsTo = 'Program'} > > ?> > [/code] > > just after 'Program' ? or was it a type in the post :) > Enjoy, >

Re: Associated model won't load

2010-02-16 Thread John Andersen
Are you missing a semicolon in this code? [code] [/code] just after 'Program' ? or was it a type in the post :) Enjoy, John On Feb 16, 9:01 pm, Furuno wrote: > 1.2.6... > > On 17 Feb, 01:57, andy wrote: > > > Do you know what version of CakePHP you are running? > > > On Feb 16, 10:00 am, F

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread John Andersen
Thanks :) I am not sure about what happens in your beforeFilter method. Can I understand that in case the method is called with a secure connection, but the security component determines a unsecure is needed, then it redirects? And vice verse? Question: Can one of these redirects be the reason fo

Re: Associated model won't load

2010-02-16 Thread Furuno
1.2.6... On 17 Feb, 01:57, andy wrote: > Do you know what version of CakePHP you are running? > > On Feb 16, 10:00 am, Furuno wrote: > > > > > Nope... :( > > > Just to make sure, I tried that once again with : > > $this->set('subjects', $this->Subject->find('all')); > > > still no luck... > > >

Re: Associated model won't load

2010-02-16 Thread andy
Do you know what version of CakePHP you are running? On Feb 16, 10:00 am, Furuno wrote: > Nope... :( > > Just to make sure, I tried that once again with : > $this->set('subjects', $this->Subject->find('all')); > > still no luck... > > On 17 Feb, 00:56, andy wrote: > > > > > Does it work if you

Re: Associated model won't load

2010-02-16 Thread Furuno
Nope... :( Just to make sure, I tried that once again with : $this->set('subjects', $this->Subject->find('all')); still no luck... On 17 Feb, 00:56, andy wrote: > Does it work if you try doing a $this->Subject->find() instead of > using paginate?  Just to see if that works... > > On Feb 16, 9:3

Re: Associated model won't load

2010-02-16 Thread andy
Does it work if you try doing a $this->Subject->find() instead of using paginate? Just to see if that works... On Feb 16, 9:37 am, Furuno wrote: > Okay, so, I have two models called Program and Subject, here's the > classes : > > program.php > class Program extends AppModel { >         var $h

Re: how to change an string to int

2010-02-16 Thread lenin kumar
Thanks you .. On Tue, Feb 16, 2010 at 8:41 PM, Furuno wrote: > Well, you can use the intval() function from PHP, example : > > var $strings = intval('100'); > > Also check the PHP docs from http://php.net/docs.php > > On 16 Feb, 16:56, lenin kumar wrote: > > dear all, > > > > i am new to cakePH

Re: Using saveAll to insert new fields, update old fields

2010-02-16 Thread andy
Here is how the form looks with one existing record (event)... and then with one newly added to the DOM/HTML (before saving... ) using jQuery: This is the first event. This is the first event. I have it just clone an existing form input section and replace the fields with a

Re: how to change an string to int

2010-02-16 Thread Furuno
Well, you can use the intval() function from PHP, example : var $strings = intval('100'); Also check the PHP docs from http://php.net/docs.php On 16 Feb, 16:56, lenin kumar wrote: > dear all, > > i am new to cakePHP  please help me to solve my issue > > i am inserting some value to database as

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread calzone
CONTROLLER function admin_edit($id) { debug($this->data); if(!empty($this->data)) { $this->Category->save($this->data); } } APP CONTROLLER var $components = array('Sec

Associated model won't load

2010-02-16 Thread Furuno
Okay, so, I have two models called Program and Subject, here's the classes : program.php subject.php And the controllers : programs_controller.php 20); function admin_index() { $this->set('programs', $this->paginate('Program')); } } ?> subjects_controller.ph

Re: parent/child navigation best practices

2010-02-16 Thread LunarDraco
I've found over the course of many years, that there are no hard fast rules to this. There is not one single pattern to follow. Primarily because the relationships and when you want to see the related information is based on context. In other words sometimes you want to see the related information

Re: How do I populate a model with XML

2010-02-16 Thread John Andersen
What is the content of the XML data? What is the purpose of the data? If you already have a structure in the database that fits the XML data, what actually is your issue? Do I understand your correctly or wrongly :) John On Feb 16, 1:53 pm, Greg wrote: > Hi, > > I'm writing a site that needs

Re: Why would $this->data show up an empty array after submit?

2010-02-16 Thread John Andersen
How does the beforeFilter code in the AppController look like? How does the form in the view look like? How does the action code look like in your CategoryController? John On Feb 16, 6:44 pm, calzone wrote: > This is a problem I just came up against and I can't figure out what > might be causi

Why would $this->data show up an empty array after submit?

2010-02-16 Thread calzone
This is a problem I just came up against and I can't figure out what might be causing it. I have a Category model that actsAs tree. When I submit a form to edit or create a category, nothing happens. Adding debug code to my controller to output the value of $this->data as the very first line in t

Re: how to disable bottom CakePHP section (query, errors, ...)

2010-02-16 Thread sebb86
Miles J Thank you very much, thats it. :) If others want to change the output-style, see here: http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this

Re: How to include a button which links to a view?

2010-02-16 Thread sebb86
WebbedIT It works. Thanks a lot! :) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegr

Re: Ajax update without url / Just to show/hide some inputs

2010-02-16 Thread John Andersen
What you want to do is not an ajax request, just use ordinary javascript to hide/show the element. Enjoy, John On Feb 16, 5:48 pm, edwingt wrote: > I have a questio, > is posible to create an ajax call just to show and hide some iput > fields. Without calling a controller action. > Im using >

Ajax update without url / Just to show/hide some inputs

2010-02-16 Thread edwingt
I have a questio, is posible to create an ajax call just to show and hide some iput fields. Without calling a controller action. Im using $options = array('url' => period,'update' => 'period', 'complete' => "Element.appear('period');"); echo $ajax->observeField('EventoPeriodico',$options); The fi

how to change an string to int

2010-02-16 Thread lenin kumar
dear all, i am new to cakePHP please help me to solve my issue i am inserting some value to database as per rule i created table name values in table i created a field named phone number int after inserting, saw the database there is some default value starting from 24etc.. after changing the fi

How do I populate a model with XML

2010-02-16 Thread Greg
Hi, I'm writing a site that needs to digest external XML data from a web service. The data then needs to be associated to reference tables in the database. I figure i need to $useTable = false to make the new XML model not point at a database, and $_schema to define the model's data structure, bu

Anyone else noticing it's taking forever to get articles approved?

2010-02-16 Thread Chad Smith
Has anyone else noticed that it's taking forever to get articles approved to the bakery? I have a few articles on there and made some updates to them as a good baker should as they mature and find better ways of doing things. It's been in the pending state for about 6 days now. It used to take l

Re: Web Service cakePHP

2010-02-16 Thread Chad Smith
I agree with cronet, It's revolutionary for a PHP Framework to have an API built into it natively. Look at the others out there Symfony, CodeIgniter, Zend ... do they have a built-in already configured REST API for the data? Not that I know of. So it doesn't support SOAP. With The Easy API : h

Re: HABTM with extra fields frustrations

2010-02-16 Thread rich...@home
So, now the data is saving, I've come up with another issue: Validation. I've added some validation to the join table to ensure the weight field is populated: class PostsTag extends AppModel { var $belongsTo = array( "Post", "Tag" ); var $

Re: HABTM with extra fields frustrations

2010-02-16 Thread rich...@home
Oops, missed out the view (note the HATBM field indexes): create("Post", array("action"=>$this->action)) ?> input("Post.id") ?> input("Post.name") ?> input("Tag.0.PostsTag.tag_id", array("options"=> $tags))?> input("Tag.0.PostsTag.weight")?> input("Tag.1.PostsTag.tag_id", array("options"=> $tags)

Re: HABTM with extra fields frustrations

2010-02-16 Thread rich...@home
Many thanks for the reply. I've successfully managed to get my HABTM models saving its extra field. Just for the record, if anyone else is looking for the answer: class Post extends AppModel { var $hasAndBelongsToMany = array( "Tag"=>array( "with"=

Re: How to include a button which links to a view?

2010-02-16 Thread WebbedIT
You've got your title tag in $html->image instead of $html->link: $html->link($html->image("delete.png", array("alt" =>"delete")), array("controller" =>&contr, "action" => "delete", $row[$class] ['id']), array('class'=>'delete', "title" => "delete"), sprintf(__('Are you sure you want to delete# %s

Re: Can someone explain ORM

2010-02-16 Thread WebbedIT
Something going wrong in your associations or bindings as Subcat.cat_id is in a directly related model. Can you supply the associations for the model you are running find from, then your bindings you are applying, the find command you are running and the resulting SQL that it's having problems wit

Re: Jquery Popup Form

2010-02-16 Thread WebbedIT
I don't use jQuery or YenDesign, but I have done some work on modal forms using Prototype and ModalBox. An article on how I did that can be found at: http://www.webbedit.co.uk/blog_posts/view/tutorial-cakephp-modalbox-crud You need to make sure that your form is not being submitted as a normal f

Re: HABTM with extra fields frustrations

2010-02-16 Thread WebbedIT
Yes you manually specify the relationship, but you still create it as a hasAndBelongsToMany. Try reading teknoid's excellent article: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ And whilst there it may be worth reading his other HABTM articles,

Re: Web Service cakePHP

2010-02-16 Thread cronet
you could add soap support simply by loading a soap class (e.g. nusoap) as vendor... It's much simpler using the built in rest functions... but that depends on what webservice you want to create or use. On 15 Feb., 10:43, ivan wrote: > What cakePHP support REST only? What cakePHP support SOAP? an

Re: Clone register and all his relationship

2010-02-16 Thread WebbedIT
I'm not sure where you'd have a situation where you would want a carbon copy of another record, normally you would want to change something, especially if it's a registration (unique username/email?). When I use copy/clone features I normally pull out my data array and pass it to a form view which

Re: Using saveAll to insert new fields, update old fields

2010-02-16 Thread WebbedIT
In your first two representations of your data array there was no second event. As long as the fields you are inserting for the 2nd event follow the data['Event'][1]['fieldname'] format then it should all be ok. I'm confident that you should be able to submit a form that has been built dynamicall