Re: Accessing models

2009-12-05 Thread Walther
That is the wrong way. You should use $Model = ClassRegistry::init('ModelName); On Nov 30, 11:07 pm, brassman79 wrote: > so I figured out that I can access a model to save and retrieve data > from components by saying $myvar = new ModelName(); > > etc. > > I have another model that keeps giving

Re: How to combine two views

2009-12-05 Thread j0n4s.h4rtm...@googlemail.com
p.s. I am using elements here but you can just use php's require() or include() On Dec 6, 4:17 am, "j0n4s.h4rtm...@googlemail.com" wrote: > You do not even have to use elements. Just call the views from your > action to enable all the $this->set() calls, and include the views via > $this->element

Re: How to combine two views

2009-12-05 Thread j0n4s.h4rtm...@googlemail.com
You do not even have to use elements. Just call the views from your action to enable all the $this->set() calls, and include the views via $this->element('../controllername/viewname.ctp'), you could also use. This is how I do it, in my example I show registration and login view next to each other:

Re: containable find not ordering

2009-12-05 Thread j0n4s.h4rtm...@googlemail.com
try to place the order in the outside array parts like this http://github.com/ionas/sna/blob/master/www/app/controllers/messages_controller.php#L66 ($just imagen $this->paginate to be your second find() param.) On Dec 5, 11:33 pm, Marcelo Andrade wrote: > Hi there, > > I'm using containable to ge

How much memory should cakephp use?

2009-12-05 Thread James
I recently had some memory leak issues with my site. Php wasn't releasing Simplepie's feed. Through the process of debugging, I started thinking about the memory consumption of my site. Which brought up a couple of questions. 1. On my dev system, the default baked app uses around 9MB; on my site

Re: Mysteriously inserted

2009-12-05 Thread Nancy
Ok, I found out something. It was the line where I was putting out "Stuff". When I commented out that line things were better. I had just forgotten that was supposed to be a fieldset "Stuff". Then I discovered having a /div inside a fieldset ends the fieldset, so that was weird too. Something

Re: Mysteriously inserted

2009-12-05 Thread Nancy
Ok, I found out something. It was the line where I was putting out "Stuff". When I commented out that line things were better. I had just forgotten that was supposed to be a fieldset "Stuff". Then I discovered having a /div inside a fieldset ends the fieldset, so that was weird too. Something

Re: Order results by related model totals (help please)

2009-12-05 Thread nurvzy
Well, I can think of a few ways to achieve the desired result you're looking for. First of all, you should be doing that 'last_job' key creation in your Project model's afterFind($results) callback if you're going to go down the array manipulation route. In regards to pagination, you could do it

Re: Pagination - Wrong URL's (/page:x/page:x/....)

2009-12-05 Thread Mono
Thanks for your answer! But it doesn't works... I tried with: $paginator->options (array ('url' => $this->passedArgs)); and $paginator->options (array ('url' => array_merge ($this- >passedArgs))); $this->passedArgs contains my article_history_id (56) but in both cases, for the 2nd page, the url l

Re: Pagination with GET params

2009-12-05 Thread Mono
Thanks for your answer, but that wasmt working. I found the solution: paginator->options ( 'url' => array ($this->passedArgs, '?' => 'for='. $toSearch)); ... if you want url's with anchor, then use: paginator->options ( 'url' => array ($this->passedArgs, '?' => 'for='. $toSearch, '#' => 'anchor_

containable find not ordering

2009-12-05 Thread Marcelo Andrade
Hi there, I'm using containable to get a set of records like this: $this->Pagamento->contain(array( 'Lancamento'=> array( 'fields'=> array('mes_ano') , 'Unidade'=> array( 'fields'=> array('quadra_id', 'lote')

Re: Mysteriously inserted

2009-12-05 Thread Nancy
This formatting happens in a helper and I return the $out variable and echo it. foreach ($this->data['Resumeitem'] as $ri) { #debug(Sanitize::html($res->formatSection($ri, $count))); echo $res->formatSection($ri,$count); echo "\n\n";

Re: Accessing models

2009-12-05 Thread Piotr Kilczuk
Hello, > I have another model that keeps giving me this error. > > Fatal error: Class 'StatisticsUser' not found in ... > > the problem that I think I'm having is that this is the "join" table > for users and statistics. > > how do I write to this table properly thru cake? So do you have that cla

Re: cakephp htaccess make other application is not reachable

2009-12-05 Thread Piotr Kilczuk
Hello, > i would like to have solution that fully independent. so i think > modify rewriterules is the best. > so far i did not find any rewrite rule that work for this situation. What kind of server is that? Or maybe you already figured it out yourself? Regards, Piotr Check out the new CakePH

Re: Email with unwanted white spaces and special characters

2009-12-05 Thread mike karthauser
Perhaps you could post the php inside your template so we could see it? Also are you sanitizing your email addresses as perhaps there is extra characters being captured that you are giving to your view? Mike Karthauser Brightstorm limited Tel: 07939252144 On 5 Dec 2009, at 12:22, Mauro Ribeir

Re: Complex query issue, grouping and ordering

2009-12-05 Thread Piotr Kilczuk
Hello, > Which 'seems' to be working, altho the 'laptime' value is in a [0] key > outside of the [Lap] array. > > Is this to be expected or am I doing something wrong? Unfortunatelly this is how it works, aggregate fields will have a numeric key. Maybe this can be changed with some SQL alias hac

Re: Self Join Problem

2009-12-05 Thread Piotr Kilczuk
Hello, > You can see, that the self join relation could not be dissolved. So, I > could not display the name of the precursor as I want. Where is my > mistake. How about setting $this->Project->recursive to a higher value? Regards, Piotr Check out the new CakePHP Questions site http://cakeqs.or

Re: Converting SQL query into CakePHP using self join

2009-12-05 Thread Piotr Kilczuk
Hello, >> I need to convert the following: >> >> SELECT * >> FROM `laps` >> WHERE `id` = ( >> SELECT `id` >> FROM `laps` AS `alt` >> WHERE `alt`.`user_id` = `laps`.`user_id` >> ORDER BY `lap_time` ASC >> LIMIT 1 ) >> ORDER BY `lap_time` ASC >> LIMIT 10 Really? :) OK, sth like that: $this->Lap->

Re: Using different database connections for different database actions

2009-12-05 Thread Piotr Kilczuk
Hello, Since nobody answered you yet, l'll try to answer your question... > I'd like to find out if anyone can point me either to an online > article or describe whether it is possible to setup CakePHP to use > different database connections for different MySQL actions. > > eg one connection for

Re: Where do I begin

2009-12-05 Thread kdubya
What control panel? CakePHP has no "control panel." If you are thinking CakePHP is something like Front Page, that is not how it is at all. The CakePHP interface is an API (Application Programing Interface) and you need to write PHP code to use it. Do you know anything about programming in PHP? You

Re: http://localhost/ shows nothing cakephp related

2009-12-05 Thread Piotr Kilczuk
Hello, > What should I do? If you really want to have your CakePHP app at http://localhost/, adjust the Apache DocumentRoot to c:/wamp/www/cake_1.2.5/app/webroot/ (restart Apache afterwards). The better way, however, is to create a virtualhost for each of your cakeapp, for example http://app1.lo

Re: shared host setup

2009-12-05 Thread Piotr Kilczuk
Hello, > I am trying to put a site on a shared host. after copying the code on > the server and editing the htaccess files the default cake page says > everything is ok. > > but as soon as i try to access my controllers i get > > > Fatal error: Cannot access empty property in public_html/cake/libs

Re: CakephpController could not be found

2009-12-05 Thread Piotr Kilczuk
Hello, > I have decided to create my new website with CakePHP. > > This experience is already stopped. when I open the page > http://localhost/cakephp/ > > I have put the cakephp files in C:\xampp\htdocs\CakePHP Seems like you have put it in htdocs... What's the exact (absolute) path to app/webr

CakephpController could not be found

2009-12-05 Thread 00Cake
Hi all, I have decided to create my new website with CakePHP. This experience is already stopped. when I open the page http://localhost/cakephp/ I have the following message: Error: CakephpController could not be found. Error: Create the class CakephpController below in file: app \controllers

shared host setup

2009-12-05 Thread slippy
hi, I am trying to put a site on a shared host. after copying the code on the server and editing the htaccess files the default cake page says everything is ok. but as soon as i try to access my controllers i get Fatal error: Cannot access empty property in public_html/cake/libs/ controller/com

Re: CakeFest IV - America - Help us pick a location!

2009-12-05 Thread Matsinet
Vote Midamerica Chicago, St. Louis, Kansas City or maybe Nashville 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, s

Re: Noob having problems getting started.

2009-12-05 Thread BearState
Thanks Jeremy, Having done further digging since I posted, I have found that the problem regarding my httpd.conf setup which was NOT properly loading mod_rewrite.so. The book didn't mention this requisite. :( The file configuration I had setup works fine as well as does the one you sugges

Re: Baking a HABTM Model

2009-12-05 Thread yevge...@gmail.com
Cakephp core thinks about any table in same way. So if table consists of several words then system sigularize just last one. 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 th

problem/doubt with many-to-many relations

2009-12-05 Thread Lorenzo Bettini
Hi I'm following this tutorial (in particular Part 4): http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake4/section4.html it uses a join table for a many-to-many relation between Users and Products (representing favorite products of users): CREATE TABLE products_users ( produ

Re: download API documentation and book

2009-12-05 Thread Lorenzo Bettini
Marcelo Andrade wrote: > On Thu, Dec 3, 2009 at 7:42 AM, Lorenzo Bettini wrote: >> is there a version of APIs and book documentation to be downloaded for >> offline browsing? >> >> thanks in advance >>Lorenzo > > http://groups.google.com/group/cake-php/browse_thread/thread/5f45c1d0779c716

Re: Containable query

2009-12-05 Thread Tonu Tusk
ok - probably not the most efficient, but the following should work if your relationships are setup in the models $submissions = $this->Submission->find('all', array('fields' => array ('DISTINCT student_id'), 'recursive' => -1); $student_ids =Set::extract($submissions, '/Submission/student_id'); /

cake-php@googlegroups.com

2009-12-05 Thread Ragnis
that works: $html->link('sth', array('controller' => 'Accounts', 'action' => 'Manage', '?' => array('var1' => 'sth', 'var2' => 'sthelse'))); But that doesn't: echo $form->create('Accounts', array('url' => array ('controller' => 'Accounts', 'action' => 'Manage', '?' => array('var1' => 'sth'

http://localhost/ shows nothing cakephp related

2009-12-05 Thread Sandcake
I'm running Wamp5. I installed Cakephp 1.2.5 to c:/wamp/www/cake_1.2.5 When I run the browser to http://localhost/cake_1.2.5/ everything runs just fine, but http://localhost/ alone doesn't show anything related to cakephp. I have uncommented the line LoadModule rewrite_module modules/ mod_rewrite.

Re: Containable query

2009-12-05 Thread Tonu Tusk
Hi there I'm not fully awake yet, but it might be worth trying to think of things "in reverse" so to speak (and not ideal, but maybe split into two separate cake calls) so rather than putting the find method on the data that you ultiamtely want, put the find query on the model with the clause

Re: Noob having problems getting started.

2009-12-05 Thread Jeremy Burns
Your directory structure doesn't look right. The directory 'cakephp' is effectively the root of your site. The files/folders within it should be: .htaccess /app /cake /docs (optional, but useful) index.php /vendors All of the files and folders that you create go in the /app folder. If you follow

Re: Does redirect clear variables?

2009-12-05 Thread Jeremy Burns
Thanks for the tip. That isn't in the docs (although it is in the API). Regrettably, that doesn't work either - it is clearing the variables. However, I solved this issue now (very simply and elegantly) and am in the process of writing up my solution, which I'll post back here). On Dec 4, 5:49 pm,

Noob having problems getting started.

2009-12-05 Thread BearState
Hello, I have downloaded CakePHP, Windows XP. I am referencing the book "Beginning CakePHP" by David Golding. I have Apache on my staging server, but it has many things there, so I set up a cakephp package as follows: /cakephp cake apps todo modules/item.php con

Re: Ajax/Cakephp/combobox

2009-12-05 Thread mike karthauser
Perhaps posting some code for us to look at? Mike Karthauser Brightstorm limited Tel: 07939252144 On 5 Dec 2009, at 05:22, jagadeesh puthukkudi wrote: > In CakePHP 1.2 i am facing a new problem for drop down selection of > state corresponding to country .I used ajax and cake1.2 > > My code wo

Re: Mysteriously inserted

2009-12-05 Thread John Andersen
I would like to know what you are doing with the $out variable later on in the code, until it is printed out/sent to the layout/view. Can you provide the code? Enjoy, John On Dec 5, 12:42 am, Nancy wrote: > This has me going nuts.  I'm using 1.2.5 and I'm calling a helper that > formats some h

Re: Here is my database schema,please peovide me model for his.

2009-12-05 Thread John Andersen
Thanks Marcelo, I do know you can define your way around it, but if you anyway are designing the database, then by following the standards you will avoid this task. Anands database design certainly was not near anykind that I would have designed, which is why I suggested Anand to follow the CakePH