Re: Big problem with using Model 1.3

2011-02-16 Thread Jeremy Burns | Class Outfit
This still feels very wrong. I think you need to simplify.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 06:01, damia...@gmail.com wrote:

> It work. I check directly url to function and returned data. I want
> display resault by helper
> 
> function getGroupsList(){
> 
>App::import('Controller', 'groups');
> 
>$group = new GroupsController();
> 
>return $group->groupList();
> 
>}
> In view:
> getUsersList();?>
> 
> I think that is problem and show me error:
> Undefined property: GroupController::$Groups [APP/controllers/
> group_controller.php, line 30]
> 
> When i use in another function:
> 
> App::import('Model', "Users");
> 
> $user = new Users();
> 
> $this->set('users', $user->find('all') );
> 
> All is fine but I need associations in future. I know one way to:
> $this->Model1->Model2->find(). Is another way to instead of this?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Big problem with using Model 1.3

2011-02-16 Thread Jeremy Burns | Class Outfit
Yes, you can do a find in models that are linked by association. So your 
example $this->Model1->Model2->Model3->find() is valid.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 06:01, damia...@gmail.com wrote:

> It work. I check directly url to function and returned data. I want
> display resault by helper
> 
> function getGroupsList(){
> 
>App::import('Controller', 'groups');
> 
>$group = new GroupsController();
> 
>return $group->groupList();
> 
>}
> In view:
> getUsersList();?>
> 
> I think that is problem and show me error:
> Undefined property: GroupController::$Groups [APP/controllers/
> group_controller.php, line 30]
> 
> When i use in another function:
> 
> App::import('Model', "Users");
> 
> $user = new Users();
> 
> $this->set('users', $user->find('all') );
> 
> All is fine but I need associations in future. I know one way to:
> $this->Model1->Model2->find(). Is another way to instead of this?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Big problem with using Model 1.3

2011-02-16 Thread Jeremy Burns | Class Outfit
That is really complicated and probably unnecessary code. You shouldn't be 
importing models into a view - a view is just there to render the output of a 
controller function. Why can't you gather this data in your controller and just 
pass it as a variable?

Where is your getGroupsList function?

Have you read the guide - at all?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 05:52, damia...@gmail.com wrote:

> It work. I check directly url to function and returned data. I want
> display resault by helper
> 
> function getGroupsList(){
> 
>App::import('Controller', 'groups');
> 
>$group = new GroupsController();
> 
>   return $group->groupList();
> 
>}
> In view:
> getUsersList();?>
> 
> App::import('Model', "Users");
> 
> $user = new Users();
> 
> $this->set('users', $user->find('all') );
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Big problem with using Model 1.3

2011-02-16 Thread Jeremy Burns | Class Outfit
You don't need a lot of the code you have written as Cake does it for you, 
assuming you write it correctly.

If you have a table 'groups' this is all you need:

/app/controllers/groups_controller.php
class GroupsController extends AppController {

var $name = "Groups";
var $components = array();

etc...

/app/models/group.php
class Group extends AppModel {
var $name = "Group";
var $primaryKey = 'id_group';


Then your find ought to work.

Note that Cake automatically ties the 'groups' table to the right model, and 
connects the right controller to the right model too. You need to make sure 
your filenames are right too.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 17 Feb 2011, at 03:42, damia...@gmail.com wrote:

> I change names but my problem don't solved.
> 
> Undefined property: GroupsController::$Group [APP/controllers/
> groups_controller.php, line 30]
> 
> 
> On 17 Lut, 03:51, "Krissy Masters"  wrote:
>> Names are backwards.
>> 
>> Controllers are plural
>> class GroupsController extends AppController {
>> 
>> Models are singular
>> class Group extends AppModel {
>> 
>> K
>> 
>> -Original Message-
>> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>> 
>> Of damia...@gmail.com
>> Sent: Wednesday, February 16, 2011 11:17 PM
>> To: CakePHP
>> Subject: Big problem with using Model 1.3
>> 
>> Hi everyone.
>> I have a big problem. I create model and controller:
>> 
>> class GroupController extends AppController {
>> var $name = 'Group';
>> var $uses = array('Groups');
>> var $components = array('Session', 'Auth');
>> 
>> class Groups extends AppModel {
>> var $name = 'Groups';
>> var $useTable = 'groups';
>> var $primaryKey = 'id_group';
>> 
>> When I use:
>> 
>>  $user = $this->Group->find('all');
>> 
>> I see this error:
>> Undefined property: GroupController::$Groups [APP/controllers/
>> group_controller.php, line 30]
>> 
>> Fatal error: Call to a member function find() on a non-object in /home/
>> public_html/simple/app/controllers/group_controller.php on line 30
>> 
>> I know that I can use
>> $this->loadModel('Groups');
>> $groups = $this->Groups->find('all');
>> this work but I need associations in future. I don't know what is
>> going on. I use 1.3.6.
>> 
>> Sorry for my English.
>> Thanks for help
>> 
>> --
>> Our newest site for the community: CakePHP Video 
>> Tutorialshttp://tv.cakephp.org
>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>> others with their CakePHP related questions.
>> 
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> athttp://groups.google.com/group/cake-php
>> 
>> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How much to charge?

2011-02-16 Thread Jeremy Burns | Class Outfit
The only way to price something is to:
- get the proper requirements
- make sure they are what the customer wants
- write them up and get the client to sign it off
- work out how long it will take you to do it
- double it (because you always underestimate)
- make sure the customer agrees that the time and price will rise if they make 
changes
- decide how much each of your hours is worth
- multiply the hours by the hourly rate
- hold your breath while you give the number to your client
- get half the money up front
- get a proper contract between you signed
- instruct a lawyer now because clients like to hold out on payment


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 16 Feb 2011, at 22:47, euromark wrote:

> its a suggestive question like "what car should i bye"
> plus its not even remotely cake related
> 
> so nobody in this group will probably be able to help you with this...
> 
> 
> 
> On 16 Feb., 23:17, hydra12  wrote:
>> I've been offered a one-time job to develop a database driven form for
>> someone's website.  I don't have any idea what to charge.  I've done
>> some of this before, but always when I was on salary.  Anybody want to
>> give me some advice?
>> 
>> Thanks in advance!
>> 
>> hydra12
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How much to charge?

2011-02-16 Thread Jeremy Burns | Class Outfit
£36.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 16 Feb 2011, at 22:47, euromark wrote:

> its a suggestive question like "what car should i bye"
> plus its not even remotely cake related
> 
> so nobody in this group will probably be able to help you with this...
> 
> 
> 
> On 16 Feb., 23:17, hydra12  wrote:
>> I've been offered a one-time job to develop a database driven form for
>> someone's website.  I don't have any idea what to charge.  I've done
>> some of this before, but always when I was on salary.  Anybody want to
>> give me some advice?
>> 
>> Thanks in advance!
>> 
>> hydra12
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: FPDF: pass variable from controller to view

2011-02-16 Thread Jeremy Burns | Class Outfit
Do you need to go to another page (by which I presume you mean view)? Could it 
not be another controller (or model) function? If so, just pass your data as 
variables in the function. You can then redirect to a 'completed' or 'post 
action' page afterwards.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 16 Feb 2011, at 09:41, Antar wrote:

> Thanks for your suggestion Sanjib. I am looking at it now and I may
> end up using it but it would mean rewriting some existing reports and
> I would prefer to avoid that.
> 
> On Feb 15, 5:05 pm, Antar  wrote:
>> I am using $this->redirect() which explains why I lose the values. Is there
>> an alternative to $this->redirect()?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: In "jp-graph" how to display value at the top of each bar graph.

2011-02-16 Thread Jeremy Burns | Class Outfit
Well said.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 16 Feb 2011, at 08:42, Dr. Tarique Sani wrote:

> On Wed, Feb 16, 2011 at 2:07 PM, sanjib dhar  wrote:
>> solved.
>> 
> 
> Please,
> 
> Even if you have solved it - it would be nice if you post how you
> solved it. It would be help someone in the future.
> 
> Don't just take - give back as well.
> 
> Cheers
> Tarique
> 
> 
> -- 
> =
> PHP for E-Biz: http://sanisoft.com
> =
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: INVITATION TO JOB FAIR

2011-02-15 Thread Jeremy Burns | Class Outfit
Just delete it.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 21:13, Robert J. Maiolo wrote:

> and this is why I hate joining email lists...
> 
> On Mon, Feb 14, 2011 at 6:30 AM, job fair  wrote:
> AMA Business JOB FAIR on 26 & 27 Feb @ Palace Ground.Exp-0-7yrs.Onspot
> hiring upto 2000 JObs.Resume at resume@gmail.com.fwd IT 2 UR FRND
> 
> 
> Dear Friends
> AMA Business is organizing an IT job fair specially for fresher.
> Below are the feature of job fair
> * 100 Software companies
> * 1000 + Jobs
> * One place multiple option to select job
> * No marks barrier
> * Specially for fresher
> * Interview on various technology
> * One written test valid for 100 companies
> * One interview valid for 100 companies
> * Experienced are also welcome
> 
> Below are technology in Job fair
> 
> * C, C++, Unix
> * .Net, C#, ASP.Net,Windows, Mobile
> application
> * Java, JSP, EJB, RMI, Web logic
> * Testing Manual & Automation
> * Mainframe
> * BizTalk, SharePoint, Dynamics Family
> * SQL Server, SSIS, SSRS
> * OracleApps Financial Technical &
> Functional
> * Network Admin, Unix Admin, Windows Admin
> 
> To join, and for more info submit your resume on “
> resume@gmail.com “
> 91-9741541952
> www.amabusiness.com
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Jeremy Burns | Class Outfit
Some more info would help us help you. Can you show the actual error?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 15:14, sanjib dhar wrote:

> Hi!
> I got unfinished class declaration  error.
> 
> On Tue, Feb 15, 2011 at 8:10 PM, Stephen  
> wrote:
> What error message do you get? Configure is usually the way to go.
> 
> On 15 February 2011 13:52, sanjibdhar...@gmail.com  
> wrote:
> I tried Configure::write('company', 'xxx);  in bootstrap.php and to
> access the constant I wrote
> var $company = Configure::read('company'); in AppController but it
> gives syntax error.Can somebody tell me how to access the constant or
> there is another way of to define a global constant through whole app.
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> 
> -- 
> Kind Regards
>  Stephen @ NinjaCoderMonkey
> 
>  www.ninjacodermonkey.co.uk
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Do not save Modified

2011-02-14 Thread Jeremy Burns | Class Outfit
Got it - I understand, and I'm sorry I was wrong. The way I read it was that 
you telling him not to put the value in the array. My bad.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 07:05, Dr. Tarique Sani wrote:

> Please read what I wrote :-)
> 
> If you set Modified in your data array then the value you set will be
> saved and will not be inserted automagically  - some of the relevant
> lines from Save method of modle.php are
> 
> foreach (array('created', 'updated', 'modified') as $field) {
>   if (array_key_exists($field, $v) && empty($v[$field])) {
>   unset($v[$field]);
>   }
> }
> 
> 
> Got it?
> 
> You are right in saying that you never need to set the modified in
> most cases but this is no "most cases"
> 
> Cheers
> Tarique
> 
> 
> On Tue, Feb 15, 2011 at 12:25 PM, Jeremy Burns | Class Outfit
>  wrote:
>> That isn't so; I never set modified in the data array. It is set in 
>> /cake/libs/model.php
>> 
>> I know that doesn't answer the question, but this is not the right direction.
>> 
>> My initial thought is to create a class that extends Model that includes a 
>> custom save function that does not set modified. How you make that trigger 
>> on a reorder only is beyond me at this point. Someone far more experienced 
>> than me give some better advice.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.com
>> http://www.classoutfit.com
>> 
>> On 15 Feb 2011, at 05:25, Dr. Tarique Sani wrote:
>> 
>>> If modified is set in your Data then that value will be saved in the 
>>> database
>>> 
>>> Rest I leave you to figure out ;-)
>>> 
>>> Cheers
>>> Tarique
>>> 
>>> On Tue, Feb 15, 2011 at 10:32 AM, Krissy Masters
>>>  wrote:
>>>> Does anyone know if it is possible to not auto save the Modified field?
>>>> 
>>>> I am doing a drag / drop re-order and this updates each records" order"
>>>> field therefor editing the modified timestamp.
>>>> Might confuse the end user since the average person will not think they
>>>> actually edited the record yet every record now says Modified 10 mins ago.
>>>> 
>>>> function _reOrder($currentModel, $order) {
>>>> 
>>>>$count = -1;//count will start at zero
>>>>foreach ( $order as $k => $v ) {
>>>>$count++;
>>>>$this->$currentModel->id = $v;
>>>>$this->$currentModel->saveField('order', $count);
>>>> 
>>>>}
>>>> }
>>>> 
>>>> Thanks,
>>>> 
>>>> K
>>>> 
>>>> --
>>>> Our newest site for the community: CakePHP Video Tutorials 
>>>> http://tv.cakephp.org
>>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>>> others with their CakePHP related questions.
>>>> 
>>>> 
>>>> 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
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> =
>>> PHP for E-Biz: http://sanisoft.com
>>> =
>>> 
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>> 
>>> 
>>> 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
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
> 
> 
> 
> -- 
> =
> PHP for E-Biz: http://sanisoft.com
> =
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: help with guest table update

2011-02-14 Thread Jeremy Burns | Class Outfit
The first thing you are doing wrong is using Model->query; you might as well 
skip Cake altogether and write your app in plain old PHP.

You raised a similar query a few days ago, and this warrants the same solution. 
Here it is again (amended with your new models and fields):



Sounds like you need to have a line of code in the controller's view method 
that calls a simple model function:

$this->FocikiGuest->recordVisit($id, $user['User']['id'], $this->user['id']);

In the model:

function recordVisit($id, $userId, $guestId) {
$this->updateAll(
array(
'FocikiGuest.user_id' => $userId,
'FocikiGuest.guest_id' => $guestId
),
array('FocikiGuest.id' => $id)
);
}

Or you could just call it directly from the view method in the controller:

$this-> FocikiGuest->updateAll(
array(
'FocikiGuest.user_id' => $user['User']['id'],
'FocikiGuest.guest_id' => $this->user['id']
),
array('FocikiGuest.id' => $id)
);

This way, whenever the view method is called (in other words, each time the 
page is rendered) you record the user_id and guest_id.



Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 06:11, chris...@yahoo.com wrote:

> Hi All,
> Ok guys, what am I doing wrong...?
> 
> $this->Guest->query('UPDATE fociki_guests' .  'SET user_id =
> ($user['User']['id'])' . ' AND guest_id = ($this->user['id'])');
> 
> I need to update guest table every time its accessed by users to any
> User page. First I need to make this code straight it up... Please
> help. I can't make it work...
> 
> Thanks
> chris
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Do not save Modified

2011-02-14 Thread Jeremy Burns | Class Outfit
That isn't so; I never set modified in the data array. It is set in 
/cake/libs/model.php

I know that doesn't answer the question, but this is not the right direction.

My initial thought is to create a class that extends Model that includes a 
custom save function that does not set modified. How you make that trigger on a 
reorder only is beyond me at this point. Someone far more experienced than me 
give some better advice.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 05:25, Dr. Tarique Sani wrote:

> If modified is set in your Data then that value will be saved in the database
> 
> Rest I leave you to figure out ;-)
> 
> Cheers
> Tarique
> 
> On Tue, Feb 15, 2011 at 10:32 AM, Krissy Masters
>  wrote:
>> Does anyone know if it is possible to not auto save the Modified field?
>> 
>> I am doing a drag / drop re-order and this updates each records" order"
>> field therefor editing the modified timestamp.
>> Might confuse the end user since the average person will not think they
>> actually edited the record yet every record now says Modified 10 mins ago.
>> 
>> function _reOrder($currentModel, $order) {
>> 
>>$count = -1;//count will start at zero
>>foreach ( $order as $k => $v ) {
>>$count++;
>>$this->$currentModel->id = $v;
>>$this->$currentModel->saveField('order', $count);
>> 
>>}
>> }
>> 
>> Thanks,
>> 
>> K
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
> 
> 
> 
> -- 
> =
> PHP for E-Biz: http://sanisoft.com
> =
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: find all not working.

2011-02-14 Thread Jeremy Burns | Class Outfit
Are the two models joined with an association (hasMany, belongsTo etc) - even 
if not directly?

If so, all you need to do is:

$variable = $this->Company->Role->find('all');

None of that model loading or db setting stuff - totally unneeded.

If the models aren't joined, join them if you can; it'll improve your whole app.

If they are not joined directly, you can just walk along the daisy chain:

$variable = $this->Company->Department->User->etc->etc->Role->find('all');

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 00:05, Shinya Koizumi wrote:

> On Mon, Feb 14, 2011 at 12:58 PM, Jeremy Burns | Class Outfit 
>  wrote:
> That all looks a little unusual. Can you explain in non-code terms what you 
> are trying to do?
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 14 Feb 2011, at 20:55, cake-learner wrote:
> 
> > Very often i got this error and i had to do custom query why it's not
> > putting '*'?
> >
> > $this -> loadModel( 'Company.Role' );
> > $this -> Role -> useDbConfig = $this -> db_name;
> > $arrRoles = $this -> Role -> find( "all" );
> >
> > Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> > check the manual that corresponds to your MySQL server version for the
> > right syntax to use near 'FROM `roles` AS `Role`   WHERE 1 = 1' at
> > line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 535]
> >
> > Code | Context
> >
> > $sql  =   "SELECT  FROM `roles` AS `Role`   WHERE 1 = 1   "
> > $error=   "1064: You have an error in your SQL syntax; check 
> > the manual
> > that corresponds to your MySQL server version for the right syntax to
> > use near 'FROM `roles` AS `Role`   WHERE 1 = 1' at line 1"
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials 
> > http://tv.cakephp.org
> > Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> > others with their CakePHP related questions.
> >
> >
> > 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
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> I am just trying to search on Model from different Controller.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable usage will not allow population of associated model view file data. Only find('all') is working. I am doing something wrong?

2011-02-14 Thread Jeremy Burns | Class Outfit
No - because he was then containing another Model. There was nothing wrong with 
the statement. It was a parsing error inside the view.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 15 Feb 2011, at 00:02, Jamie wrote:

> It looks like an improperly closed parenthesis to me. This is the
> array for the PlanDetail contain that you supplied:
> 
>'PlanDetail' =>
>array('fields' =>
>array('id',
>  'effective_date',
>  'expiration_date',
>  'active',
>  'name',
>  'plan_type_id',
>  'max_benefit',
>  'deductible',
>  'preventive',
>  'basic',
>  'major',
>  'ortho',
>  'company_id',
>  'plan_type_id',
>  'plan_detail_note_id'),
> 
> Notice how there's only one closing parenthesis at the end? You're
> missing one. You need two: one to close the array of fields and one to
> close the PlanType array. So, that's throwing off the rest oo -f your
> array, and explains why you have an extra parenthesis at the very end
> of your query statement.
> 
> - Jamie
> 
> On Feb 14, 2:15 pm, OldWest  wrote:
>> $plan['PlanDetail']['Company']['company_logo_url']
>> 
>> Nothing is populated. The company_logo_url is in the Company mode. And the
>> Company model is associated to the PlanDetail company_id (as you can see
>> below). In my debug(), ALL field data is showing,
>> 
>> ...[Company] => Array
>> (
>> [id] => 20
>> [company_logo_url] => madison_dental.gif
>> )...
>> 
>> but the value is not being populated (in my view). It all works perfectly
>> fine if I just do a
>> 
>> $this->Plan->find('all');
>> 
>> Here is my containable query:
>> 
>> $this->Plan->find('all',
>> array('contain' =>
>> array('PlanDetail' =>
>> array('fields' =>
>> array('id',
>>   'effective_date',
>>   'expiration_date',
>>   'active',
>>   'name',
>>   'plan_type_id',
>>   'max_benefit',
>>   'deductible',
>>   'preventive',
>>   'basic',
>>   'major',
>>   'ortho',
>>   'company_id',
>>   'plan_type_id',
>>   'plan_detail_note_id'),  
>> 
>>  'Company' =>
>> array('fields'=>
>> array(
>> 'id',
>> 'company_logo_url'
>> )),
>> 
>> 'PlanType' =>
>> array('fields'=>
>> array(
>> 'id',
>> 'name'
>> ))
>> 
>> ;
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable usage will not allow population of associated model view file data. Only find('all') is working. I am doing something wrong?

2011-02-14 Thread Jeremy Burns | Class Outfit
You have the data in the array, you just haven't found the right path. Working 
your way into an array is easy if you do lots of debugging and take it a step 
at a time.

So if your variable is coming into your method as $plan, are you doing a 
foreach loop on it? Something like:

foreach ($plan as $row):
...
endforeach;

If so, try this:

$row['PlanDetail']['Company']['company_logo_url'];

If that isn't right, debug out $row and look at it to work out your path.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 14 Feb 2011, at 22:52, OldWest wrote:

> Hi Jeremy,
> 
> I am using a foreach() to product records results, but I tried:
> 
> $plan[0]['PlanDetail']['Company']['company_logo_url'];
> 
> And as expected (and as you mentioned), (because its a loop) it did not 
> produce anything.
> 
> My earlier post was an error when I had the ['Plan']... as part of the echoed 
> array.
> 
> I also tried:
> 
> $plan[]['PlanDetail']['Company']['company_logo_url']; (removed the index 
> number). no luck.
> 
> It looks like I need to strip the numerical array elements from the 
> containable output, and I briefly recall an option that allowed me to do 
> this. But I can't find it!!
> 
> If you have any other ideas, please feel free to mention them : ) I am going 
> to keep searching...
> 
> Headache : (
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable usage will not allow population of associated model view file data. Only find('all') is working. I am doing something wrong?

2011-02-14 Thread Jeremy Burns | Class Outfit
So the value is there in the array. I see you are echoing out 
$plan['Plan']['PlanDetail']['Company']['company_logo_url'];, which doesn't 
exist.

Assuming this variable is called $plan and you are not doing any for/foreach 
loops, to echo that value out you'd start at the top and walk your way down the 
tree until you reach the field you want, so you'd use:

echo $plan[0]['PlanDetail']['Company']['company_logo_url'];

Does that produce anything?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 14 Feb 2011, at 22:34, OldWest wrote:

> Hi Jeremy,
> 
> Company logo url is not echoed when using my containable as it stands: echo 
> $plan['Plan']['PlanDetail']['Company']['company_logo_url']; (with 
> non-containable native relationship find('all') works just fine -- data 
> echoes as expected).
> 
> PlanDetail belongsTo Company w/ foreign key: company_id
> 
> Company hasMany PlanDetail w/ foreign key: company_id
> 
> Here is a sample record debug w/ containable applied:
> Array
> (
> [0] => Array
> (
> [Plan] => Array
> (
> [id] => 7
> [created] => 2011-01-10 14:11:40
> [modified] => 2011-02-03 18:35:29
> [plan_detail_id] => 32
> [monthly_cost] => 25.49
> [dental_cost] => 0.00
> [age_id] => 2
> [applicant_id] => 1
> [state_id] => 1
> )
> 
> [PlanDetail] => Array
> (
> [id] => 32
> [effective_date] => 2011-01-10 14:07:00
> [expiration_date] => 2011-01-10 14:07:00
> [active] => 1
> [name] => Classic 1500
> [plan_type_id] => 2
> [max_benefit] => 0.00
> [deductible] => $75/year
> [preventive] => 90%
> [basic] => 75%
> [major] => 50%
> [ortho] => 
> N/A
> 
> 
> [company_id] => 4
> [plan_detail_note_id] => 9
> [Company] => Array
> (
> [id] => 4
> [company_logo_url] => nationwide_logo.png
> )
> 
> [PlanType] => Array
> (
> [id] => 2
> [name] => Indemnity
> )
> 
> )
> 
> )
> 
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: find all not working.

2011-02-14 Thread Jeremy Burns | Class Outfit
That all looks a little unusual. Can you explain in non-code terms what you are 
trying to do?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 14 Feb 2011, at 20:55, cake-learner wrote:

> Very often i got this error and i had to do custom query why it's not
> putting '*'?
> 
> $this -> loadModel( 'Company.Role' );
> $this -> Role -> useDbConfig = $this -> db_name;
> $arrRoles = $this -> Role -> find( "all" );
> 
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'FROM `roles` AS `Role`   WHERE 1 = 1' at
> line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 535]
> 
> Code | Context
> 
> $sql  =   "SELECT  FROM `roles` AS `Role`   WHERE 1 = 1   "
> $error=   "1064: You have an error in your SQL syntax; check the 
> manual
> that corresponds to your MySQL server version for the right syntax to
> use near 'FROM `roles` AS `Role`   WHERE 1 = 1' at line 1"
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Plz can somebody tell what is the use of 'admin'=>false in loginAction

2011-02-14 Thread Jeremy Burns | Class Outfit
If a user is logged in as admin, links will automatically be routed to the 
admin prefix version of the method. Therefore, it would send a user to the 
admin_login() method, not login(). The admin_login() method doesn't exist, so 
you'll get a 'method not found' error. By adding 'admin' => false to the link 
or redirect, the admin prefix will be ignored and the path will be login(), not 
admin_login().

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 14 Feb 2011, at 11:08, ravi wrote:

> $this->Auth->loginAction = array('admin' => false, 'controller' =>
> 'members', 'action' => 'login');
> 
> Thanks,
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: I want to add Auth authentication in all views.

2011-02-14 Thread Jeremy Burns | Class Outfit
No you don't. As AD7Six said earlier, you need to look at isAuthorized(); 
http://book.cakephp.org/view/396/authorize#!/view/247/AuthComponent-Methods

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 14 Feb 2011, at 13:16, Leonardo Hidalgo Piña wrote:

> need to use acl
> 
> http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application
> 
> 2011/2/14 sanjibdhar...@gmail.com 
> I have a app where I want to add Auth authentication in all
> views.There will be one rule as only admin can access "add"
> views.Other views can be accessed by everybody.
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> 
> -- 
> Leonardo Hidalgo Piña
> Desarrollador Web
> http://braindeveloper.me
> 
> MSN: leohida...@gmail.com
> Celular: (+56) (99) 632 5603
> Skype: r0cket82
> Twitter: rocket82
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Variable scope problem

2011-02-13 Thread Jeremy Burns | Class Outfit
I know you've already had a few replies, but can you outline in a simple 
non-code sentence exactly what you are trying to achieve (rather than why your 
code isn't working)?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 14 Feb 2011, at 06:28, adam_g2000 wrote:

> The edit method in my controller is successfully being passed a
> variable called $categoryID. I'm using the variable to query another
> model, which happens successfully and the title field from the model
> is displayed in the view via the variable defined here.
> 
> App::import('Model','Category');
> $cat = new Category();
> $category = $cat->field('title', array('id' => $categoryID));
> $this->set('category', $category);
> 
> My problem arises in the second if statement in the method. By the
> time I need the variable to pass through redirect it seems to have
> fallen out of scope and I cannot figure out why - the variable appears
> to be empty.
> 
> Here is the method.
> 
>   function edit($id = null, $categoryID = null) {
>   App::import('Model','Category');
>   $cat = new Category();
>   $category = $cat->field('title', array('id' => $categoryID));
>   $this->set('category', $category);
>   if (!$id && empty($this->data)) {
>   $this->Session->setFlash(__('Invalid subcategory', 
> true));
>   $this->redirect(array('action' => 'index'));
>   }
>   if (!empty($this->data)) {
>   if ($this->Subcategory->save($this->data)) {
>   $this->Session->setFlash(__('The subcategory 
> has been saved',
> true));
>   $this->redirect(array(
>   'controller' => 'subcategories',
>   'action' => 'index',
>   $categoryID
>   ));
>   } else {
>   $this->Session->setFlash(__('The subcategory 
> could not be saved.
> Please, try again.', true));
>   }
>   }
>   if (empty($this->data)) {
>   $this->data = $this->Subcategory->read(null, $id);
>   }
>   $categories = $this->Subcategory->Category->find('list');
>   $resources = $this->Subcategory->Resource->find('list');
>   $this->set(compact('categories', 'resources'));
>   }
> 
> Please be gentle, I've spent a couple of months now reading the
> cookbook and a textbook and a series of tutorials - though I am a
> newbie! If anyone can offer any assistance and point out why this
> might be I'd be very grateful. Thanks in advance.
> 
> Adam.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Variable scope problem

2011-02-13 Thread Jeremy Burns | Class Outfit
I have a couple of suggestions - unless I am missing the point here.

Is category_id a field on the subcategories table? If so, presumably it's in 
$this->data, so why not just collect the value from there?

You can then use model validation to check it is populated. If it isn't, send 
the user back to the edit view with an appropriate error message. If it is 
there, this bunch of code:

App::import('Model','Category');
$cat = new Category();
$category = $cat->field('title', array('id' => $categoryID));
$this->set('category', $category);

..can be rewritten as follows:

$category = $this->Subcategory->Category->field('title', array('id' => 
$this->data['Subcategory']['category_id']));

I'd also say that you picking up the value of $category before checking for the 
presence of $id. If $id is missing you are redirecting out of there anyway; so 
move the $category code down a bit to save unnecessary work. 


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 14 Feb 2011, at 06:28, adam_g2000 wrote:

> The edit method in my controller is successfully being passed a
> variable called $categoryID. I'm using the variable to query another
> model, which happens successfully and the title field from the model
> is displayed in the view via the variable defined here.
> 
> App::import('Model','Category');
> $cat = new Category();
> $category = $cat->field('title', array('id' => $categoryID));
> $this->set('category', $category);
> 
> My problem arises in the second if statement in the method. By the
> time I need the variable to pass through redirect it seems to have
> fallen out of scope and I cannot figure out why - the variable appears
> to be empty.
> 
> Here is the method.
> 
>   function edit($id = null, $categoryID = null) {
>   App::import('Model','Category');
>   $cat = new Category();
>   $category = $cat->field('title', array('id' => $categoryID));
>   $this->set('category', $category);
>   if (!$id && empty($this->data)) {
>   $this->Session->setFlash(__('Invalid subcategory', 
> true));
>   $this->redirect(array('action' => 'index'));
>   }
>   if (!empty($this->data)) {
>   if ($this->Subcategory->save($this->data)) {
>   $this->Session->setFlash(__('The subcategory 
> has been saved',
> true));
>   $this->redirect(array(
>   'controller' => 'subcategories',
>   'action' => 'index',
>   $categoryID
>   ));
>   } else {
>   $this->Session->setFlash(__('The subcategory 
> could not be saved.
> Please, try again.', true));
>   }
>   }
>   if (empty($this->data)) {
>   $this->data = $this->Subcategory->read(null, $id);
>   }
>   $categories = $this->Subcategory->Category->find('list');
>   $resources = $this->Subcategory->Resource->find('list');
>   $this->set(compact('categories', 'resources'));
>   }
> 
> Please be gentle, I've spent a couple of months now reading the
> cookbook and a textbook and a series of tutorials - though I am a
> newbie! If anyone can offer any assistance and point out why this
> might be I'd be very grateful. Thanks in advance.
> 
> Adam.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: New vs Old and need help - FEMALE NEEDS HELP!

2011-02-12 Thread Jeremy Burns | Class Outfit
I guess it all depends if you want an answer or not.

Sent from my iPhone

On 13 Feb 2011, at 05:54, ibejohn818  wrote:

> I say just ask your questions.
> 
> There are three possible events that can occur.
> 
> 1) Somebody attempts to answer
> 2) Nobody attempts to answer
> 3) Somebody unloads a holier-than-thou rant that you are not following
> the 10 commandments of the internet set in place when Al Gore parted
> the seas and invented the Dubya-Dubya-Dubya
> 
> 
> Good luck
> 
> On Feb 11, 4:52 pm, "Krissy Masters" 
> wrote:
>> I do not think it matters if your new and need help or old cakepro and need
>> help. Why the need to emphasize?
>> 
>> New you say! Are you? Well then let me just drop everything, BREAKING NEWS!
>> A NEW USER TO CAKE! Holy shit say it's not so!
>> 
>> People on the board for more than a month can tell by the name basically if
>> your new or not and the depth of the question gives it away too in most
>> cases.
>> 
>> I maybe I should put Girl Needs Help, maybe damsel in distress will get more
>> replies?
>> 
>> People will help, you so saying your new over and over is just irritating.
>> Once these NEW people are on the board a while they too will see just how
>> dumb it is to see post after post saying just how new people are.
>> 
>> Krissy => 4 months, 3 days using cake so do I still qualify as new or do I
>> have to phrase my questions with old hag needs help :P
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HOW TO DO THIS.

2011-02-12 Thread Jeremy Burns | Class Outfit
No-one will give out their Skype id as that opens the channels for being a help 
desk. Fine if you want to pay, but is bound to offend when you are declined.

This forum is a really, really good place to get help. Stick with it - you will 
get everything you need from here.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 12 Feb 2011, at 16:20, sanjib dhar wrote:

> Ok,thanks for your great advice.I will try to maintain all the jeremy's 
> step.If possible can u give me u'r skype id.I had opened a company with 
> kolkata,India clients.I want to work.But the problem is nobody help me out 
> locally because I am senior most.I often search in internet and get help.I 
> previously work in ror.If possible give me some advice.again thanks for u'r 
> great advice.
> 
> 
> On Sat, Feb 12, 2011 at 9:03 PM, euromark  wrote:
> when i go through the list of new messages in the group and i read
> "HOW TO DO THIS" or "PLEASE HELP"
> it just freaks me out
> 
> every other person on this group manages to summarize the problem in a
> short sentence
> this way you as a reader know right away what the problem is about
> you are not getting more help my SHOUTING (thats what capital letters
> are for, by the way)
> around cries of help...
> and THEN - only then - i will not feel offended and probably try to
> help you.
> 
> kinda ironic that just a few days ago a thread regarding this subject
> has been started:
> http://groups.google.com/group/cake-php/browse_thread/thread/c7bc0bb2a530ec08/c047cad1a7fcf0ec
> I like jeremy's etiquette guide :)
> 
> sincerely
> mark
> 
> 
> On 12 Feb., 07:22, sanjib dhar  wrote:
> > solved by view sln.
> >
> > On Sat, Feb 12, 2011 at 10:43 AM, sanjibdhar...@gmail.com <
> >
> >
> >
> >
> >
> >
> >
> > sanjibdhar...@gmail.com> wrote:
> > > OK sorry.
> >
> > > On Feb 12, 9:58 am, Jeremy Burns | Class Outfit
> > >  wrote:
> > > > Very respectful. Well done. I suspect he does know the answer.
> >
> > > > Jeremy Burns
> > > > Class Outfit
> >
> > > > jeremybu...@classoutfit.comhttp://www.classoutfit.com
> >
> > > > On 12 Feb 2011, at 04:24, sanjib dhar wrote:
> >
> > > > > "HOW TO DO THIS" is not an appropriate title for your thread!
> > > > > by the way
> > > > > this means u don't know the answer right.
> > > > > On Sat, Feb 12, 2011 at 5:10 AM, euromark 
> > > wrote:
> > > > > "HOW TO DO THIS" is not an appropriate title for your thread!
> > > > > by the way
> >
> > > > > On 11 Feb., 18:27, sanjib dhar  wrote:
> > > > > > What will be the function like?Can you please send me.I am new in
> > > cakephp.
> >
> > > > > > On Fri, Feb 11, 2011 at 6:55 PM, Mattijs 
> > > > > > 
> > > wrote:
> > > > > > > Well,
> >
> > > > > > > You can't sum price directly in your query since you are showing
> > > each
> > > > > > > record individually as well, so I guess you'll need a combination.
> >
> > > > > > > a) in your controller: find('all', array('order' =>
> > > 'Contractor.name,
> > > > > > > Table.dt'))
> > > > > > > b) in your view: sum up price while iterating. Whenever you get a
> > > new
> > > > > > > contractor: display sum and reset
> >
> > > > > > > Alternatively, you could create a function in your Contractor
> > > model,
> > > > > > > retrieving all contractors with contained items and have that
> > > function
> > > > > > > calculate the sum into the contractor results.
> >
> > > > > > > On 11 feb, 13:56, "sanjibdhar...@gmail.com" <
> > > sanjibdhar...@gmail.com>
> > > > > > > wrote:
> > > > > > > > I have a table
> > > > > > > > id
> > > > > > > > buyer_id
> > > > > > > > item_code
> > > > > > > > contractor_id
> > > > > > > > price
> > > > > > > > dt
> > > > > > > > item_name
> >
> > > > > > > > Now 

Re: New vs Old and need help - FEMALE NEEDS HELP!

2011-02-11 Thread Jeremy Burns | Class Outfit
A couple of things get to me:
- Really really long posts - get to the frikking point
- Swathes of badly formatted code that no one is going to read
- Constantly being 'new'
- Asking for massive amounts of help before doing any research at all
- Asking if something will work before even trying it - if you tried it you'd 
know
- Asking for a complete off the shelf solution to a problem ("build me an app, 
please")
- Multiple posts from the same person on the same subject
- "Cake (or PHP) has a bug because my code doesn't work"
- Not trying (or following correctly) a suggested solution
- "No worries - I fixed it" without explaining how or why

Delete. Or stroppy reply.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 12 Feb 2011, at 01:53, Ryan Snowden wrote:

> Or Noobhag
> 
> Neat
> 
> On 12 February 2011 09:04, Larry E. Masters  wrote:
>> Old hag might get some of us old timers attention.
>> --
>> Larry E. Masters
>> 
>> On Fri, Feb 11, 2011 at 6:52 PM, Krissy Masters 
>> wrote:
>>> 
>>> I do not think it matters if your new and need help or old cakepro and
>>> need
>>> help. Why the need to emphasize?
>>> 
>>> New you say! Are you? Well then let me just drop everything, BREAKING
>>> NEWS!
>>> A NEW USER TO CAKE! Holy shit say it's not so!
>>> 
>>> People on the board for more than a month can tell by the name basically
>>> if
>>> your new or not and the depth of the question gives it away too in most
>>> cases.
>>> 
>>> I maybe I should put Girl Needs Help, maybe damsel in distress will get
>>> more
>>> replies?
>>> 
>>> People will help, you so saying your new over and over is just irritating.
>>> Once these NEW people are on the board a while they too will see just how
>>> dumb it is to see post after post saying just how new people are.
>>> 
>>> Krissy => 4 months, 3 days using cake so do I still qualify as new or do I
>>> have to phrase my questions with old hag needs help :P
>>> 
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>> 
>>> 
>>> 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
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HOW TO DO THIS.

2011-02-11 Thread Jeremy Burns | Class Outfit
Very respectful. Well done. I suspect he does know the answer.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 12 Feb 2011, at 04:24, sanjib dhar wrote:

> "HOW TO DO THIS" is not an appropriate title for your thread!
> by the way
> this means u don't know the answer right.
> On Sat, Feb 12, 2011 at 5:10 AM, euromark  wrote:
> "HOW TO DO THIS" is not an appropriate title for your thread!
> by the way
> 
> On 11 Feb., 18:27, sanjib dhar  wrote:
> > What will be the function like?Can you please send me.I am new in cakephp.
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Feb 11, 2011 at 6:55 PM, Mattijs  wrote:
> > > Well,
> >
> > > You can't sum price directly in your query since you are showing each
> > > record individually as well, so I guess you'll need a combination.
> >
> > > a) in your controller: find('all', array('order' => 'Contractor.name,
> > > Table.dt'))
> > > b) in your view: sum up price while iterating. Whenever you get a new
> > > contractor: display sum and reset
> >
> > > Alternatively, you could create a function in your Contractor model,
> > > retrieving all contractors with contained items and have that function
> > > calculate the sum into the contractor results.
> >
> > > On 11 feb, 13:56, "sanjibdhar...@gmail.com" 
> > > wrote:
> > > > I have a table
> > > > id
> > > > buyer_id
> > > > item_code
> > > > contractor_id
> > > > price
> > > > dt
> > > > item_name
> >
> > > > Now I want display dt(date) wise billing but contactor also will be in
> > > > sequence like this:
> >
> > > > Contractorbuyer_id  item_code  price
> > > > item_name
> > > > A   12   2112
> > > > Sjgj
> > > > A
> > > > 14..
> >
> > > ---
> > >  ---
> > > > sum(price)
> >
> > > > B
> > > ...
> > >  ...
> > > > B
> > >  
> > > ...
> > >  ...
> > > > B
> > > ...
> > >  ...
> >
> > > ---
> > >  ---
> > > > sum(price)
> > > > C
> > > ...
> > >  ...
> > > > C
> > > ...
> > >  ...
> > > > C
> > > ...
> > >  ...
> >
> > > ---
> > >  ---
> > > > sum(price)
> >
> > > > how to write the query.
> >
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > > others with their CakePHP related questions.
> >
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > athttp://groups.google.com/group/cake-php
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Redirect URL format not as expected.

2011-02-11 Thread Jeremy Burns | Class Outfit
Take out your customer route - you don't need it. Just use links in the format:

echo $this->Html->link(
'Text',
array(
'controller' => 'controller_name',
'action' => 'action_name',
$variable
)
);

Cake will sort the rest out for you. $variable can be the id if you want, or 
the category.

The reason you are getting the funny url is because you are specifying names 
for the third and forth parameters (id and category), so they appear with a 
colon before them. If you really insist on sending over two parameters, just do 
this:

echo $this->Html->link(
'Text',
array(
'controller' => 'controller_name',
'action' => 'action_name',
$variable,
$category
)
);

Your receiving action will just match the variables with the parameters in 
expects in order:

function action($variable = null, $category = null) {}

The same holds true for a redirect, where the syntax would be:

$this->redirect(
array(
'controller' => 'controller_name',
    'action' => 'action_name',
$variable,
$category
)
);

Note that the 'Text' has gone but the array is the same.


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 21:25, adam_g2000 wrote:

> Hi Guys,
> 
> Firstly, this is my first post, so please be gentle and my apologies
> for any inevitable faux pas should I make any. Secondly, I am aware
> there seems to be much confusion around redirect, I have been studying
> both the Cookbook, CakePHP Application Development (Book) and a series
> of tutorials in Linux Format. I have been learning for a couple of
> months now - though fully admit to being a newbie.
> 
> I'm expecting my problem to be simple, and down to a basic lack of
> understanding of redirect, so again, I apologise if this is answered
> elsewhere - if it is and I've read it, I haven't understood it.
> 
> I have a series of resources, each belonging (HABTM) to a subcategory,
> each subcategory belongs to one category. At the start of the App you
> click on the title of the category, which then filters by passing,
> using custom routing, the name of the category to the subcategory
> controller eg:
> 
> // Provides the category title to the subcategory index/list page
> Router::connect(
>   '/subcategories/:category',
>   array('controller' => 'subcategories', 'action' => 'index'),
>   array(
>   'pass' => array('category')
>   )
> );
> 
> function index($category = null) {
>   if (!empty($category)) {
>   $this->set('category', $category);
>   $conditions = array(
>   'conditions' => array('Category.title' 
> => $category),
>   'order' => 'Subcategory.order 
> ASC'
>   );
>   $subcategories = $this->Subcategory->find('all', $conditions);
>   } else {
>   $this->set('category', 'All');
>   $conditions = array(
>   'order' => array(
>   'Category.title' => 'ASC',
>   'Subcategory.order' => 'ASC'
>   )
>   );
>   $subcategories = $this->Subcategory->find('all', $conditions);
>   }
>   $this->Subcategory->recursive = 0;
>   $this->set('subcategories', $subcategories);
> }
> 
> *This code is only relevant for background info, not the source of the
> fault.*
> 
> This works well. Each link provides the data in the correct url format
> to each subsequent 'thing', subcategory index or resource index.
> 
> The problem I have is with editing. When I need to Edit a Subcategory
> (for example, this will need to work for Resources also) I pass
> parameters (category being the one used to filter, so the one I'm most
> interested in) to the edit controller, and in turn to the view like
> so:
> 
> From subcategory index.ctp:
> 
> link('Edit', array(
>   'controller

Re: Build a string from resultset array (following example)

2011-02-11 Thread Jeremy Burns | Class Outfit
You can use an array in the conditions:

'conditions' => array('Model.id' => $array)

...which does an 'IN' query, in which case you don't need to do the extracting 
etc.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 11 Feb 2011, at 21:14, rgreenphotodesign wrote:

> I changed the query to this and it works, but not sure it's very
> Cakeish
> 
> $conditions = array('Model.id IN ('.$stringOfIds.')');
> 
> On Feb 11, 2:01 pm, rgreenphotodesign 
> wrote:
>> I've followed the example listed on [url]http://nuts-and-bolts-of-
>> cakephp.com/2008/05/13/build-a-string-from-a-resultset-array/[/url] to
>> build a string to pass to a find IN statement. All looks to work
>> expect it's encasing the new string in quotes. Here is what I have so
>> far using cake 1.3.7
>> 
>> [code]
>> $array = $this->ModelA->find->(‘all’, array($conditions));
>> $stringOfIds = implode(‘,’, Set::extract($array, ‘{n}.Model.id’));
>> $conditions = array(‘ModelB.modela_id’ => array($stringOfIds));
>> $this->data = $this->ModelB->find(‘all’, array(‘conditions’ =>
>> $conditions));
>> [/code]
>> This produces the following SQL
>> WHERE `Model`.`id` = (’1,19,186′)
>> It’s putting quotes around the new string an thus not producing the IN
>> query. I know it’s probably simple, but any ideas what’s causing this
>> or an easy way to escape the quotes?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: views = "1234..." numbers

2011-02-10 Thread Jeremy Burns | Class Outfit
Sounds like you need to have a line of code in the controller's view method 
that calls a simple model function:

$this->Model->increment($id);

In the model:

function increment($id) {
$this->updateAll(array('Model.view_count' => 'Model.view_count+1'), 
array('Model.id' => $id));
}

Or you could just call it directly from the view method in the controller:

$this->Model->updateAll(array('Model.view_count' => 'Model.view_count+1'), 
array('Model.id' => $id));

This way, whenever the view method is called (in other words, each time the 
page is rendered) you increment the view_count field by one.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 11 Feb 2011, at 03:31, chris...@yahoo.com wrote:

> Hi Jeremy,
> What I'm looking for is to set the data,... say to set field views in
> Video table increment by 1 every time page accessed. To set data,...
> NOT to retrive.
> 
> Thanks
> chris
> 
> 
> 
> On Feb 10, 1:11 pm, Jeremy Burns | Class Outfit
>  wrote:
>> RTFM.http://book.cakephp.org/
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 10 Feb 2011, at 20:57, chris...@yahoo.com wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hi Mike,
>>> Yes, I know that I have to read from table,...
>>> But I don't know how... LOL
>>> the code... anyone can help...?
>> 
>>> Thanks
>>> chris
>> 
>>> On Feb 10, 11:59 am, mike karthauser  wrote:
>>>> On 10 Feb 2011, at 17:30, "chris...@yahoo.com"  wrote:
>> 
>>>>> Hi All,
>>>>> How u All Doinnn...?!
>> 
>>>>> Can anyone teach me how to setup views,... so when page is
>>>>> accessed ... it will set field views="increment numbers" like Video
>>>>> views=906, Group views=489, etc.. like how many time page has been
>>>>> accessed.
>> 
>>>> You won't be doing any counts in the view, rather updating the count when 
>>>> the action is called and passing that value to the view.
>> 
>>>> All you'll need to do is to get a count value from your table and then 
>>>> resave it after you have added 1. You may also want to do this as an ajax 
>>>> call in JavaScript when you have played say half of the video as then it 
>>>> won't be affected if bots hit the page or people refresh loads
>> 
>>>>> Thanks
>>>>> chris
>> 
>>>>> --
>>>>> Our newest site for the community: CakePHP Video 
>>>>> Tutorialshttp://tv.cakephp.org
>>>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
>>>>> others with their CakePHP related questions.
>> 
>>>>> To unsubscribe from this group, send email to
>>>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>>>> athttp://groups.google.com/group/cake-php
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: views = "1234..." numbers

2011-02-10 Thread Jeremy Burns | Class Outfit
RTFM. http://book.cakephp.org/

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 20:57, chris...@yahoo.com wrote:

> Hi Mike,
> Yes, I know that I have to read from table,...
> But I don't know how... LOL
> the code... anyone can help...?
> 
> Thanks
> chris
> 
> 
> 
> On Feb 10, 11:59 am, mike karthauser  wrote:
>> On 10 Feb 2011, at 17:30, "chris...@yahoo.com"  wrote:
>> 
>>> Hi All,
>>> How u All Doinnn...?!
>> 
>>> Can anyone teach me how to setup views,... so when page is
>>> accessed ... it will set field views="increment numbers" like Video
>>> views=906, Group views=489, etc.. like how many time page has been
>>> accessed.
>> 
>> You won't be doing any counts in the view, rather updating the count when 
>> the action is called and passing that value to the view.
>> 
>> All you'll need to do is to get a count value from your table and then 
>> resave it after you have added 1. You may also want to do this as an ajax 
>> call in JavaScript when you have played say half of the video as then it 
>> won't be affected if bots hit the page or people refresh loads
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Thanks
>>> chris
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: should be able to access model easier

2011-02-10 Thread Jeremy Burns | Class Outfit
You can. In your example, '$this' refers to the current controller. If the 
controller is users_controller, you get to its model by $this->User. You can do 
the same with anything in the uses array, and you can also reach related models 
by daisy chaining them. So if User hasMany Post hasMany Comment, you can do 
this:

$this->User->Post->Comment to get to the the Comment model.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 19:45, cake-learner wrote:

> Why not we can't access models by
> $this -> Controller -> ModelName( I meant all models defined in
> $uses )
> or
> $this -> Controller -> Uses -> ModelName?
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cakephp App::import() broken

2011-02-10 Thread Jeremy Burns | Class Outfit
I wasn't necessarily referring to that file - is there something else doing an 
echo? Unless, of course, the problem goes away if you remove that content.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 17:55, RLR wrote:

> I thought that was the problem to... the file only contains:
> 
>$str = "hello world";
> ?>
> 
> no echo, no trailing return or whitespace.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Cakephp App::import() broken

2011-02-10 Thread Jeremy Burns | Class Outfit
Looks like a file in your vendor files is echoing something to screen before 
the main output starts - this is an HTML error.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 17:48, RLR wrote:

> Sorry for the broken post. I prematurely hit return.
> 
> 
> I am struggling with a strange bug regarding cakephp´s App::import
> function.
> 
> cakephp version 1.3.6
> php 5.3
> 
> I have a working cake app. Auth login and redirecting to home page
> works fine.
> As soon as I put the following line in app_controller the Auth
> component and redirecting breaks with the following errors:
> 
> App::import('Vendor', 'DateCalc', array('file' => 'date_calc.php'));
> 
> Error in browser:
> Cannot modify header information - headers already sent by (output
> started at path-to-my-app/app/vendors/date_calc.php:1
> 
> I have tested this with a simple file only containing something like:
>$str = "hello world";
> ?>
> 
> 
> Can someone confirm this on php 5.3 ?
> 
> Thanks!
> 
> Ronald
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: sving values of check boxes

2011-02-09 Thread Jeremy Burns | Class Outfit
What happens when you just use $this->Form->input() instead? It ought to still 
render as a checkbox.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 10 Feb 2011, at 06:14, andy_the ultimate baker wrote:

> hoi
> i m trying to save values of check boxes which has property tinyint(1)
> 
> but its going 0 even in $this->data has the values 1
> 
> my controller is as fallows
> 
> 
>  function procedures() {
> 
>if(!empty($this->data)){
>//print_r($this->data);exit;
>$this->TreatmentProcedure->create();
>if ($this->TreatmentProcedure->saveAll($this->data)) {
>  $this->Session->setFlash('the procedure has been saved', true);
>  $this->redirect(array('action'=>'procedures'));
>}else{
>$this->Session->setFlash('the procedure could not be saved',
> true);
>$this-> redirect(array('action'=>'procedures'));
>  }
> 
>}
> 
>  }
> 
> my view is as fallows
> 
> 
>
>   class="txt-black">
>
>  Form-
>> checkbox('bone_marrow_aspiration'); ?>
>  Bone Marrow Aspiration
>  Form-
>> checkbox('trifine_biopsy'); ?>
>  Trifine Biopsy
>
>
>  Form-
>> checkbox('cytogenetics'); ?>
>  Cytogenetics and Flow Cytometry
>  Form-
>> checkbox('lumbar_puncture'); ?>
>  Lumbar puncture
>
>
>  Form-
>> checkbox('csf_collection'); ?>
>  CSF Collection
>  Form-
>> checkbox('intrathecal'); ?>
>  Intrathecal
>
>
>  Form-
>> checkbox('trucut_biopsy'); ?>
>  Trucut Biopsy
>  Form-
>> checkbox('central_line'); ?>
>  Central Line
>
>
>  Form-
>> checkbox('pleural_tapping'); ?>
>  Pleural Tapping
>  Form-
>> checkbox('peritoneal_tapping'); ?>
>  Peritoneal Tapping
>
> 
>  
> 
> i have checked all the values and field are right but instade of 1 its
> going 0 in table
> 
> please helpme
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: baking complete cakephp applicaation

2011-02-09 Thread Jeremy Burns | Class Outfit
No - it's strictly forbidden unless you have read (or even glanced at) the 
online book and tutorials: http://book.cakephp.org/

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Feb 2011, at 10:24, ambati kiran wrote:

> Hi guys,
> 
> I had set up cake console successfully on my windows machine. Now i have a 
> database called 'major' i want to create application based on the database 
> tables.
> Can i do that?
> If yes please help me doing that.
> Thank you,
> Kiran
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Emty query result

2011-02-09 Thread Jeremy Burns | Class Outfit
$variable = "SOME SQL STATEMENT;";

if ($variable):
$this->Model->query($variable);
else:
// oops - the query is empty - do something else instead
endif;

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Feb 2011, at 08:44, Gopinath T.M wrote:

> i dont no can you please say how do i check variable empty or not...
> 
> On Wed, Feb 9, 2011 at 2:12 PM, Jeremy Burns | Class Outfit 
>  wrote:
> Then why not check for empty before you call the function?
> 
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 9 Feb 2011, at 08:40, Gopinath T.M wrote:
> 
>> 
>> ya its empty... in some case it may have value
>> On Wed, Feb 9, 2011 at 2:08 PM, Jeremy Burns | Class Outfit 
>>  wrote:
>> What code are you writing that triggers this error? Are you using the 
>> Model->query method? If so, what variable are you sending in? Is it empty? 
>> (This is just wild guess work.)
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.com
>> http://www.classoutfit.com
>> 
>> On 9 Feb 2011, at 07:36, Gopinath T.M wrote:
>> 
>> > Warning (512): SQL Error: 1065: Query was empty [CORE/cake/libs/model/
>> > datasources/dbo_source.php, line 549]
>> >
>> > how do i overcome from this error...
>> >
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials 
>> > http://tv.cakephp.org
>> > Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> > others with their CakePHP related questions.
>> >
>> >
>> > 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
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
>> 
>> 
>> -- 
>> Regards
>> Gopinath T.M
>> 9944944659
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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
> 
> 
> 
> -- 
> Regards
> Gopinath T.M
> 9944944659
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Emty query result

2011-02-09 Thread Jeremy Burns | Class Outfit
Then why not check for empty before you call the function?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Feb 2011, at 08:40, Gopinath T.M wrote:

> 
> ya its empty... in some case it may have value
> On Wed, Feb 9, 2011 at 2:08 PM, Jeremy Burns | Class Outfit 
>  wrote:
> What code are you writing that triggers this error? Are you using the 
> Model->query method? If so, what variable are you sending in? Is it empty? 
> (This is just wild guess work.)
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 9 Feb 2011, at 07:36, Gopinath T.M wrote:
> 
> > Warning (512): SQL Error: 1065: Query was empty [CORE/cake/libs/model/
> > datasources/dbo_source.php, line 549]
> >
> > how do i overcome from this error...
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials 
> > http://tv.cakephp.org
> > Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> > others with their CakePHP related questions.
> >
> >
> > 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
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> 
> -- 
> Regards
> Gopinath T.M
> 9944944659
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Emty query result

2011-02-09 Thread Jeremy Burns | Class Outfit
What code are you writing that triggers this error? Are you using the 
Model->query method? If so, what variable are you sending in? Is it empty? 
(This is just wild guess work.)

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Feb 2011, at 07:36, Gopinath T.M wrote:

> Warning (512): SQL Error: 1065: Query was empty [CORE/cake/libs/model/
> datasources/dbo_source.php, line 549]
> 
> how do i overcome from this error...
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: why we use Caching in cakephp?

2011-02-08 Thread Jeremy Burns | Class Outfit
And stop using the "I'm new" card.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 9 Feb 2011, at 07:08, Dr. Tarique Sani wrote:

> On Wed, Feb 9, 2011 at 12:35 PM, hoss7  wrote:
>> i am new in cake,tell me why we use Caching in cakephp? and how can i
>> use it?
> 
> Read http://book.cakephp.org/view/1377/General-Caching
> 
> and while you are at it read the entire book - very helpful
> 
> Cheers
> Tarique
> 
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
> 
> 
> 
> -- 
> =
> PHP for E-Biz: http://sanisoft.com
> =
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: PHP framework

2011-02-08 Thread Jeremy Burns | Class Outfit
Yes. No. Maybe. What would you like us to say?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 8 Feb 2011, at 08:17, appi wrote:

> i want to develop large scale web application ,which is basically
> contains following features
> 
> Online Registration process
> User Accounts
> Huge Data
> Payment Gateway and other security features
> 
> can i go for cakephp framework to build this application
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: array_key_exists php statement

2011-02-06 Thread Jeremy Burns | Class Outfit
As the error says;

> 

Sent from my iPad

On 7 Feb 2011, at 05:56, "chris...@yahoo.com"  wrote:

> Hi guys,...
> how u ding...
> 
> I need help with php statement. I'm getting an error:
> Parse error: syntax error, unexpected ';' in /home/zipmaniak/
> zippopeople.com/html/app/views/gifts/admin_manage.ctp on line 93
> 
> 
> 
> Please some one help me with this...  or if I have to call from
> controller,... how do I do that...?
> 
> params) && $this-
>> params['controller'] == 'gifts' . ---WHAT ELSE IN
> HERE ???--- )): ?>
> 
> Thanks
> Chris
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Pagination Problem in Custom Query

2011-02-05 Thread Jeremy Burns | Class Outfit
It's 'limit' not 'limits'. Not sure if that's the only problem, but it's a 
starter.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 5 Feb 2011, at 07:48, Joseph Buarao wrote:

> Hi Fellow Programmer,
> 
> I getting problem with my code, I don't know what's the reason why the
> sql limit statement is not working on my paginate query. below are my
> codes feel free to suggest, I really Appreciated it.. Thank you in
> advance for your support GUYS...
> 
> $this->paginate = array('conditions' =>  array('Category.slug'=>
> $category),
> 'limits' => 10);
> 
> $feeds_data = $this->paginate('Category');
> 
> By the way, I used hasAndBelongsToMany relationship..
> 
> Thanks..
> 
> 
> Joseph Buarao
> Web Developer
> Azure Web Design.com
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Still stuck with Media View some one please help!!!

2011-02-05 Thread Jeremy Burns | Class Outfit
You need to let your download function know which file to download. You can do 
this by passing the name of the file into the function:

link('Game 1',array('action'=>'download', 'filename1')); 
?>
link('Game 2',array('action'=>'download', 'filename2')); 
?>


function download ($filename = '')
{
   $this->view = 'Media';
   $params = array(
 'id' => $filename,
 'name' => 'example',
 'download' => true,
 'extension' => 'zip',
 'path' => APP . 'gamefiles' . DS);
  $this->set($params);
   }

If you don't want to reveal the name of the file, you could store them in a 
table and pass in the id of the record instead of the filename, then in your 
download function do a find to get the name first.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 5 Feb 2011, at 10:16, newguy wrote:

> I have a display page with follwoing 4 links:
> 
> Select the game to download
> 
> link('Game 1',array('action'=>'download')); ?> li>
> link('Game 2',array('action'=>'download1')); ?> li>
> link('Game 3',array('action'=>'download1')); ?> li>
> Game 4
> 
> 
> On clicking each link a different file should be downloaded.
> 
> I am using Media View to dlownload file placed on my disk but since
> the file name is hardcoded I am able to download only one file through
> the download fucntion, I want to know that is it possible that I just
> pass the name of the file to be downloaded(depending on the link
> clicked) to the download function of media view and the respective
> file is downloaded(extension of all files is zip).
> 
> Heres my controller code:
> 
> function download ()
> {
>$this->view = 'Media';
>$params = array(
>  'id' => 'example.zip,
>  'name' => 'example',
>  'download' => true,
>  'extension' => 'zip',
>  'path' => APP . 'gamefiles' . DS);
>   $this->set($params);
>}
> 
> Guys am new here so please help me witha little more explanation than
> usual.
> 
> Thanks
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Forum Is A Free For All?

2011-02-04 Thread Jeremy Burns | Class Outfit
You're missing my point.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 5 Feb 2011, at 05:52, andy_the ultimate baker wrote:

> The forum is all about to promote innovative thoughts and sharing
> knowledge. but just for the sake of "please" u just cat stop yourself
> by giving an answer for it becouse it is not only the person who is
> reffering you answer but everyone who googled it for the same. and
> believe me u cant c the expression but it help a lot to that third
> person, i never reply anyone just for giving an answer to him/her it
> is for all who are looking for it.
> i always welcome every one even if he is not giving me "please"!
> 
> On Feb 5, 10:34 am, Jeremy Burns | Class Outfit
>  wrote:
>> I agree completely. But the hairs on the back of my neck shake when someone 
>> says "I need a log on. Help me."  Not even please. I know I shouldn't, but 
>> straightaway I think "No - go and make an effort first and then come back 
>> when you're stuck." I have learned loads from this forum and am more than 
>> happy to pay back where I can but won't do someone else's job for them for 
>> free just because they can't be bothered.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 5 Feb 2011, at 05:13, John Maxim wrote:
>> 
>>> I think that's what kept Cake going, a friendly community and fast
>>> response.
>> 
>>> I never complain anyone asks stupid question. It's about learning, not
>>> to feel ashamed of asking. as long as it isn't spamming or asking the
>>> same over and over..and over..
>> 
>>> On Feb 5, 7:40 am, hill180  wrote:
>>>> I did notice some really basic questions that a tutorial could have 
>>>> answered, in those cases, I would recommend what some members did, point 
>>>> them right to the tutorials.  As a community it would be better then a 
>>>> blanket RTFM, in my humble opinion.
>> 
>>>> I know I could have been part of those "people" seeking help as I am new 
>>>> to the forum, although I am new to CakePHP, I am not new to web coding.  I 
>>>> did my due diligence with the manual website, and Google (Bing.. :)   Ok I 
>>>> never used Bing, but if I did it would have been the same Google Results). 
>>>>  I even posted my code when relevant.  Side Note:  The two books I have on 
>>>> CakePHP are now dated with support for 1.2 with many of elements of the 
>>>> API changed.  Hard to understand a change log when you don't understand 
>>>> the fundamentals.  The best teacher was Andrew Perk on youtube.com.  
>> 
>>>> - H
>> 
>>>> On Feb 4, 2011, at 12:46 PM, Dave Maharaj wrote:
>> 
>>>>> I do not know if it’s just me, but I have been on the group 2 and a half 
>>>>> years now and when I first joined I got told “how to ask a question” if 
>>>>> you have code show it, errors show it, if you cannot figure something out 
>>>>> show what your code is now, what you have tried.
>> 
>>>>> Lately the board is full of “I don’t know how show me” and not sure if 
>>>>> anyone has noticed this also but this feeding a stry dog only brings the 
>>>>> dog back for more and more. And people just keep going on and on with it. 
>>>>>  Last week I have pretty much started just opening email , seeing 26 
>>>>> emails and straight to the garbage.
>> 
>>>>> Help group yes! Help me with this please, I can’t seem to figure out how 
>>>>> to……. I have tried… looked …
>> 
>>>>> I’m building site, no how to do so help show me help now and when your 
>>>>> done ftp it up for me too? I just can’t get over that when a question 
>>>>> gets asked now no code not even showing an attempt and the post gets 20 
>>>>> responses.
>>>>> Whats the point of learning it if all you have to do is get 20 people 
>>>>> doing it for you.
>> 
>>>>> Today:
>>>>> So I need capcha confirm for in submit in popup to send show me how!
>> 
>>>>> Tomorrow:
>>>>> AJAX Logon show me how
>> 
>>>>> Sunday:
>>>>> Good job guys take the day off.
>> 
>>>>> Moday:
>>>>> TBD….
>> 
>>>>> Cheers everyone J
>> 
>>>>> --
>>>>&

Re: Forum Is A Free For All?

2011-02-04 Thread Jeremy Burns | Class Outfit
I agree completely. But the hairs on the back of my neck shake when someone 
says "I need a log on. Help me."  Not even please. I know I shouldn't, but 
straightaway I think "No - go and make an effort first and then come back when 
you're stuck." I have learned loads from this forum and am more than happy to 
pay back where I can but won't do someone else's job for them for free just 
because they can't be bothered.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 5 Feb 2011, at 05:13, John Maxim wrote:

> I think that's what kept Cake going, a friendly community and fast
> response.
> 
> I never complain anyone asks stupid question. It's about learning, not
> to feel ashamed of asking. as long as it isn't spamming or asking the
> same over and over..and over..
> 
> On Feb 5, 7:40 am, hill180  wrote:
>> I did notice some really basic questions that a tutorial could have 
>> answered, in those cases, I would recommend what some members did, point 
>> them right to the tutorials.  As a community it would be better then a 
>> blanket RTFM, in my humble opinion.
>> 
>> I know I could have been part of those "people" seeking help as I am new to 
>> the forum, although I am new to CakePHP, I am not new to web coding.  I did 
>> my due diligence with the manual website, and Google (Bing.. :)   Ok I never 
>> used Bing, but if I did it would have been the same Google Results).  I even 
>> posted my code when relevant.  Side Note:  The two books I have on CakePHP 
>> are now dated with support for 1.2 with many of elements of the API changed. 
>>  Hard to understand a change log when you don't understand the fundamentals. 
>>  The best teacher was Andrew Perk on youtube.com.  
>> 
>> - H
>> 
>> On Feb 4, 2011, at 12:46 PM, Dave Maharaj wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> I do not know if it’s just me, but I have been on the group 2 and a half 
>>> years now and when I first joined I got told “how to ask a question” if you 
>>> have code show it, errors show it, if you cannot figure something out show 
>>> what your code is now, what you have tried.
>> 
>>> Lately the board is full of “I don’t know how show me” and not sure if 
>>> anyone has noticed this also but this feeding a stry dog only brings the 
>>> dog back for more and more. And people just keep going on and on with it.  
>>> Last week I have pretty much started just opening email , seeing 26 emails 
>>> and straight to the garbage.
>> 
>>> Help group yes! Help me with this please, I can’t seem to figure out how 
>>> to……. I have tried… looked …
>> 
>>> I’m building site, no how to do so help show me help now and when your done 
>>> ftp it up for me too? I just can’t get over that when a question gets asked 
>>> now no code not even showing an attempt and the post gets 20 responses.
>>> Whats the point of learning it if all you have to do is get 20 people doing 
>>> it for you.
>> 
>>> Today:
>>> So I need capcha confirm for in submit in popup to send show me how!
>> 
>>> Tomorrow:
>>> AJAX Logon show me how
>> 
>>> Sunday:
>>> Good job guys take the day off.
>> 
>>> Moday:
>>> TBD….
>> 
>>> Cheers everyone J
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how decrypt password in view?

2011-02-04 Thread Jeremy Burns | Class Outfit
No, it's a one way encryption.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 10:50, andy_the ultimate baker wrote:

> i have made all validations but when user view he/her profile the
> password get encrypted in view, there is not any way to fix it,
> 
> can i convert that encrypted password in actual one?
> 
> 
> On Feb 4, 3:43 pm, Jeremy Burns | Class Outfit
>  wrote:
>> It's a one way encryption, so that's not possible. The only thing you can do 
>> is how the user the text they are currently inputting (only useful really 
>> when setting or entering a password) or, if they forget, to put in place a 
>> system of resetting and validating a new password.
>> 
>> Might sound like a pain, but it's the most secure way.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 4 Feb 2011, at 10:36, andy_the ultimate baker wrote:
>> 
>>> hi,
>>> friends i want to show the password in view to user but its coming
>>> hash encoded,
>>> can any one tell me how to display password decrypted in view?
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how decrypt password in view?

2011-02-04 Thread Jeremy Burns | Class Outfit
It's a one way encryption, so that's not possible. The only thing you can do is 
how the user the text they are currently inputting (only useful really when 
setting or entering a password) or, if they forget, to put in place a system of 
resetting and validating a new password.

Might sound like a pain, but it's the most secure way.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 10:36, andy_the ultimate baker wrote:

> hi,
> friends i want to show the password in view to user but its coming
> hash encoded,
> can any one tell me how to display password decrypted in view?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Understanding the "M" in MVC?

2011-02-04 Thread Jeremy Burns | Class Outfit
I take your point, and I'll admit that my controllers are often too fat. I call 
model functions as much as possible, but find myself dipping back into the 
controller when I need to use the Auth component, the Session, redirect and so 
on (although I do collect as much info as I can and pass it into the model 
function when possible). Am I alone in that?

What is the principle behind fat model/skinny controller; is it performance, 
efficiency, code cleanliness?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 09:09, AD7six wrote:

> 
> 
> On Feb 4, 8:13 am, Jeremy Burns | Class Outfit
>  wrote:
>> Create a function in your controller that firstly creates the connection 
>> object.
> 
> Holy MVC sacrilege batman. I hope you meant to say model.
> 
> $stuff = $this->Model->somefunction()
> 
> is about as far as a controller should go
> 
> AD
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Understanding the "M" in MVC?

2011-02-04 Thread Jeremy Burns | Class Outfit
Shell scripts are beyond my experience, so can't contribute to that one. Sounds 
like this ought to go in a component though, if you want to do it from multiple 
controllers.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 07:45, Ryan Schmidt wrote:

> 
> On Feb 4, 2011, at 01:13, Jeremy Burns | Class Outfit wrote:
> 
>> Create a function in your controller that firstly creates the connection 
>> object. Then have the function get the data from the model, which returns an 
>> array to the controller and is stored in a variable in the controller. Now 
>> parse that array running your controller/component function against your 
>> connection object.
> 
> I thought that might be the answer... but what if I not only need to do this 
> from a controller (multiple controllers), but also from shell scripts (in 
> APP/vendor/shells)?
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Understanding the "M" in MVC?

2011-02-03 Thread Jeremy Burns | Class Outfit
Create a function in your controller that firstly creates the connection 
object. Then have the function get the data from the model, which returns an 
array to the controller and is stored in a variable in the controller. Now 
parse that array running your controller/component function against your 
connection object.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 07:06, Ryan Schmidt wrote:

> 
> On Feb 3, 2011, at 23:36, Sam Sherlock wrote:
> 
>> On Feb 3, 2011, at 23:22, Ryan Schmidt wrote:
>> 
>>> It's still unclear to me what the best way is to, for example, define 
>>> additional variables that go with a particular record. My first impulse was 
>>> to define an instance variable in the Model, but in light of the above, 
>>> that doesn't seem correct.
>> 
>> @ryan - the right thing takes some working out
>> 
>> A user 
>> name (full and secondname -- 2 fields)
>> username to login
>> hasMany published recipe's (table)
>> hasMany favorite recipe's ()
>> 
>> A recipee will have 
>> One title (which is made into a slug)
>> One slug (an auto field)
>> hasMany->ingredients (table)
>> belongs to user
> 
> I understand that much; I'm not having any troubles defining columns in my 
> database tables. What I am having trouble with is where to store variables 
> that relate to their rows.
> 
> For example, perhaps I have a table of hostnames and a Hostname model. I have 
> a method that will find() some subset of them. Then I would like to connect 
> to each of them using some network protocol. There is an object (not a model; 
> just a PHP class loaded from the libs directory) that represents that 
> connection. Where should I be storing that object? There will be multiple 
> operations performed over that single connection once it's opened, so I would 
> dislike to have to create the network connection anew in each method; that 
> would be inefficient and wasteful of network resources. It shouldn't be the 
> responsibility of a controller or a shell script to create this connection 
> object; it's directly related to the Hostname model so it should be in that 
> model. If the model were an object representing a hostname instance, then I 
> might have had a private $_connection instance variable, and a public method 
> getConnection(), which creates $this->_connection if it hasn't already been 
> created (i.e. instantiates the connection object, which opens the network 
> connection) and returns it. But since the model is merely a way to get an 
> array of data, I'm unsure what technique I should be using.
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: confused! need urgent help.

2011-02-03 Thread Jeremy Burns | Class Outfit
I am almost tempted to say:

"will u please make it short and approachable to ur point,
becouse no one is having to read a long theses of ur query on the
work
so please make it shor and come in pints, so it would be fine to give
u answer"

...but I won't.

What do you see when you do:



...immediately before this code?

And what error are you getting - is it just a blank td?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 4 Feb 2011, at 05:37, andy_the ultimate baker wrote:

> hi,
> good morning,
> 
> since i morning i am working on one index view where i want to display
> the country. ithe the view i m getting sate and city with its
> respective code properly, but the country is not displaying
> here is my code
> 
> Html->link($city['Country']['title'],
> array('controller' => 'countries', 'action' => 'view', $city['Country']
> ['id'])); ?>
>   
>   
>   Html->link($city['State']['title'],
> array('controller' => 'states', 'action' => 'view', $city['State']
> ['id'])); ?>
>   
>$city['City']['title']; ?> 
>   
>  $this->element('admin/status_links',array('status'=>
> $city['City']['active'],'id'=>$city['City']
> ['id'],'class'=>'city_status'))?>
> 
> please someone give me solution on it
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Understanding the "M" in MVC?

2011-02-03 Thread Jeremy Burns | Class Outfit
Michael

I find the model structure very flexible. I generally set recursive to -1 (this 
means my starting point is this record and none of its associations), and use 
the Containable behaviour; both of these are set in my custom app_model.php 
file, which means they apply to all models by default.

Before even touching a model I thrash out my actual data model as best as I can 
and then build my models around it starting with the associations and 
validation first. I like to make my data tightly integrated so that I can rely 
on relationships, but there are always occasions when a bit of data just 
doesn't link with another, but I know I am going to have to tie them together. 
I also build some generic find queries that I know I will use many times - 
these tend to be fully featured containing all the key related data for a given 
'id'. Saves me building the same query over and over again and it's easier to 
maintain.

When something doesn't fit I and I need to tie unrelated data together (which 
is rare) I do one of three things:
- Store the unrelated data in the session, if it's small and appropriate, or 
even in a config file.
- Use loadModel to make it available to 'this' controller, perform a find and 
store the result in an array for later manipulation = perhaps in the model.
- Use the 'joins' elements to construct my own query (I prefer this to using 
'query'). I also fall back on this method if I want to restrict a record set by 
a condition on one of its relationships using inner joins (Contain uses outer 
joins).

When models are associated correctly you can indeed daisy chain across them to 
call an action on a distant model.

Not sure that totally answers your question, but I hope it gets the ball 
rolling.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 4 Feb 2011, at 05:02, andy_the ultimate baker wrote:

> will u please make it short and approachable to ur point,
> becouse no one is having to read a long theses of ur query on the
> work
> so please make it shor and come in pints, so it would be fine to give
> u answer
> 
> regards
> andy
> 
> On Feb 3, 7:12 pm, Michael Carriere  wrote:
>> Hello everyone!
>> 
>> When recently approached to do some web development for a game whose code 
>> base was in dire need of a rewrite, I was determined on finding a stable, 
>> community supported framework to help speed up the process. I appreciate 
>> Cake's file organization, the way layouts are controlled, among other 
>> things, but I seem to be having a difficult time in the way I should be 
>> understanding the "M" in MVC. I've done enough web development in the past 
>> to be familiar with PHP, but more recently I've worked in object-oriented, 
>> compiled languages, as well as a few web tools built with Django. I could 
>> just give up and "do whatever works", but I feel like there's something 
>> powerful to be taken advantage of here, and I hope you guys can help!
>> 
>> How "magical" is the find() function? Should I be able to run one exhaustive 
>> query and get back all the nested data that I need for a View to spit out? I 
>> guess a better question would be: do you find yourself calling find() on 
>> different sets of data, packaging them together yourself (presumably with 
>> the Set class, right?) and then passing that to the view to be displayed?
>> 
>> I have some data that is loosely related, and while I can manage to get at 
>> all of it in one query, it requires me using Containable, and dropping 5-6 
>> associations in. That just seems quite inefficient for me. (Maybe it's not?)
>> 
>> Coming from many OO languages, after you define a class, you instantiate it 
>> as you want to work with an individual object, play with it as you want, and 
>> throw it out. Correct me if I'm wrong, but it seems that MVC's approach is 
>> more geared towards operating on all the data at once? Or at least in the 
>> case of working with a "Model".
>> 
>> This leads to some confusion for me, because the majority of the instances 
>> where I need to access data, it's of a small subset of the data I'm storing 
>> in the DB for my model. My webgame has "Buildings" in it, which belong to a 
>> User's "Village". Sometimes I want to grab information from a specific 
>> Building, and other times I want to grab only the specific Buildings of a 
>> Village. Is it proper to be define a function within the model that grabs or 
>> manipulates data based on this, like 
>> $this->Village->getBuildingsByVillageId()? Better yet, how do you operate on 
>

Re: Blog tutorial not working!

2011-02-03 Thread Jeremy Burns | Class Outfit
See here 
http://articles.classoutfit.com/2009/08/setting-up-cakephp-on-a-11-server/ for 
a tip on getting it to work on 1&1.

Are you certain you don't already have a Posts controller?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 07:37, lebert wrote:

> Hi!
> 
> I'm new to CakePHP, so I decided to download yesterday from the
> website the last stable version 1.3.7 from cakephp.org.
> 
> After struggling to set everything up in my 1&1 hosting, and realizing
> that it only works when installing it in the root of my domain, not in
> a subfolder (if anyone knows a link with an explanation of how to do
> that, it would be very helpful though) I decided to follow the Blog
> tutorial to get in touch with CakePHP. Well, I didn't get very far...
> 
> At the step "11.7.1 Create a Post controller" (http://book.cakephp.org/
> view/1531/Cake-Database-Configuration#!/view/1535/Create-a-Posts-
> Controller), I get the following error when uploading the file created
> there:
> 
> Fatal error: Cannot redeclare class PostsController in /homepages/28/
> d230065733/htdocs/cakePHP/app/controllers/posts_controller.php  on
> line 15
> 
> I've followed exactly what the tutorial says. I've actually started
> over to see if I had missed something, being super careful, but still
> the same error. This is how that file looks like:
> 
>  class PostsController extends AppController {
>   var $helpers = array ('Html','Form');
>   var $name = 'Posts';
> 
>   function index() {
>   $this->set('posts', $this->Post->find('all'));
>   }
> }
> ?>
> 
> If I try the application before uploading this file, I get the obvious
> error that "PostController" does not exist, and asks me to create it.
> If I create it and upload the file (posts_controller.php) without the
> index() function, I get an error saying that "Action index is not
> defined", which is also normal. But when I include that fragment of
> code, then I get the fatal error I mentioned before, with all the
> display on white and the error message on black.
> 
> I've followed the tutorial line by line and I don't see any difference
> between my code and the tutorial. Another weird thing is that the
> fatal error says "on line 15", when the code has only 10... And by the
> way, when I installed and configured the CakePHP project, I got all
> the test things on green, so I don't think it's a configuration
> problem...
> 
> I'm super confused and frustrated, I want to learn CakePHP but it
> sucks to be struggling so early! Any help or advice would be much
> appreciated! I assume that the tutorial works, so I guess that I'm
> doing something wrong, but I have no clue what can it be...
> 
> Thanks so much in advance!
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to validation messages next to the text field?

2011-02-03 Thread Jeremy Burns | Class Outfit
Your best bet is to modify the CSS. If you look at the classes being used 
(Firebug is great for this) you can amend the styles and position them where 
you like.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 11:52, andy_the ultimate baker wrote:

> hi,
> good evening,
> 
> i am trying to get error messages next to my text field, they are
> coming bellow text field and hence the view looks disturb,
> can any one suggest how to get the error messages next to text field
> 
> please!
> 
> best regards
> 
> andy
> (my bakery needs help)
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Great Job on The Cookbook

2011-02-03 Thread Jeremy Burns | Class Outfit
There's a massive difference. We all benefit freely and greatly from other 
people's tireless work to deliver you a great tool that you can use to go and 
make money. Just calling it open source doesn't change that fact or give you 
extra rights. Picking holes in the colour they use for the book seems a little 
petty, thankless and thoughtless. If it troubles you that much you could always 
step up to the plate and do it better.

In truth, if people didn't like my website they probably wouldn't use me. But 
they do, and they do. Will you now stop using Cake? I thought not.


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 09:45, Jens Dittrich wrote:

> really?
> Do you tell visitors of your websites the same?
> If only people who work on it are allowed to critizise, then where do
> you go in terms of quality?
> 
> On 3 Feb., 10:18, Jeremy Burns | Class Outfit
>  wrote:
>> How much did you pay for or contribute to this 'book'? Nothing? Then I think 
>> you lose the right to criticise.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 3 Feb 2011, at 09:12, Jens Dittrich wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> blue colors might look good to some people but blue is a very
>>> exhausting color for the human eye. The receptors for blue color are
>>> the smallest group in the human eye and tehrefore looking at blue
>>> backgrounds and colors is exhausting. Not the way to go for a "book".
>> 
>>> On 3 Feb., 07:50, andy_the ultimate baker
>>>  wrote:
>>>> no maharj
>>>> i m not happy with new cake book,
>>>> the tree structure in manual was very easy to access.
>>>> its very dull look to
>> 
>>>> On Feb 3, 11:30 am, "Dave Maharaj"  wrote:
>> 
>>>>> Nice new look to the cookbook! I think it looks 100% more professional!
>> 
>>>>> Great job to all who made it possible.
>> 
>>>>> Dave
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Great Job on The Cookbook

2011-02-03 Thread Jeremy Burns | Class Outfit
I'm all for constructive criticism.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 09:39, andy_the ultimate baker wrote:

> cake is open source,
> hence every can give there views
> jeremy
> 
> On Feb 3, 2:18 pm, Jeremy Burns | Class Outfit
>  wrote:
>> How much did you pay for or contribute to this 'book'? Nothing? Then I think 
>> you lose the right to criticise.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 3 Feb 2011, at 09:12, Jens Dittrich wrote:
>> 
>>> blue colors might look good to some people but blue is a very
>>> exhausting color for the human eye. The receptors for blue color are
>>> the smallest group in the human eye and tehrefore looking at blue
>>> backgrounds and colors is exhausting. Not the way to go for a "book".
>> 
>>> On 3 Feb., 07:50, andy_the ultimate baker
>>>  wrote:
>>>> no maharj
>>>> i m not happy with new cake book,
>>>> the tree structure in manual was very easy to access.
>>>> its very dull look to
>> 
>>>> On Feb 3, 11:30 am, "Dave Maharaj"  wrote:
>> 
>>>>> Nice new look to the cookbook! I think it looks 100% more professional!
>> 
>>>>> Great job to all who made it possible.
>> 
>>>>> Dave
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Great Job on The Cookbook

2011-02-03 Thread Jeremy Burns | Class Outfit
How much did you pay for or contribute to this 'book'? Nothing? Then I think 
you lose the right to criticise.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 09:12, Jens Dittrich wrote:

> blue colors might look good to some people but blue is a very
> exhausting color for the human eye. The receptors for blue color are
> the smallest group in the human eye and tehrefore looking at blue
> backgrounds and colors is exhausting. Not the way to go for a "book".
> 
> On 3 Feb., 07:50, andy_the ultimate baker
>  wrote:
>> no maharj
>> i m not happy with new cake book,
>> the tree structure in manual was very easy to access.
>> its very dull look to
>> 
>> On Feb 3, 11:30 am, "Dave Maharaj"  wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Nice new look to the cookbook! I think it looks 100% more professional!
>> 
>>> Great job to all who made it possible.
>> 
>>> Dave
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Model debugging

2011-02-03 Thread Jeremy Burns | Class Outfit
Type:

die(debug($variable));

...in your model, and it will stop processing and print $variable to screen.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 08:35, Axel wrote:

> Hello!
> 
> Following a previous comment (http://groups.google.com/group/cake-php/
> browse_thread/thread/f8a2060c617c8fb6/5f50c5ee5ebed975?
> hl=en#5f50c5ee5ebed975), I was starting to put the work on my data in
> the models instead of the controllers. Unfortunately, I have no idea
> how to debug what is inside of my model?  How is it possible to know
> if it is correct? (cake 1.3)
> 
> My case is :
> I'm building a racing game
> 
> I have  CHAMPs (championship) hasMany TEAMs hasMany DRIVER
> I have also CHAMP hasMany RACE hasMany ORDER (race orders).
> I've also TRACK HasMany RACE
> I've also TEAM HasMany ORDER
> 
> So I have a function CalcPackage which determines the package (which
> is the value of the car of my team on a race). To calculate the
> package I need the values of the car (TEAM) and the values of the
> TRACK (in function of the track the car is better or not). The global
> package is a weighted sum of the separate package of 5 elements. This
> function is a function of TEAM model.
> 
> When I create a new RACE, I want my program to calcPackage of
> everyteam.
> 
> So :
> 
> Races_controller.php:
> function add() {
>   (...)
> 
>  $race=$this->data;
> 
>  //Recovery of the list of the team that are part of the race
>  $this->loadModel('Team');
>  $team_list=$this->Team->find('all', array('fields' =>
> array('id'), 'conditions' => array('champ_id' => $race['Race']
> ['champ_id']), 'recursive' => 0));
> 
>  //Package calculkation for that race
>  $team_nb=count($team_list);
> 
>  for($i = 1; $i <= 5; $i++)
>{
>$c_car='c_car'.$i;
>$track_coeff[]=$race['Track'][$c_car];
>}
> 
>  for ($i=0;$i<$team_nb;$i++)
>{
>$this->Team->calcPackage($track_coeff,$team_list[$i]['Team']
> ['id']);
>}
> (...)
> }
> 
> TEAM model :
> 
> function calcPackage($track_coeff,$teamID)
>   {
> 
>$team=$this->findById($teamID);
>$pack=0;
>for($i = 1; $i <= 5; $i++)
>  {
>  $p_car='p_car'.$i;
>  $pack+=$track_coeff[$i-1]*$team['Team'][$p_car];
>  }
> 
>$team['Team']['p_current']=$pack;
>$this->save($team);
>return $pack;
>   }
> 
> 
> 
> 
> 
> The problem is that I don't know if this set up is ok, and I have a
> bug in my model but I'm not able to see which one. What are the
> debugging possibilities?
> 
> Thank you a lot for your answers!
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-02 Thread Jeremy Burns | Class Outfit
Always makes me chuckle when people are asking if their app can handle Facebook 
style traffic. Don't waste time solving problems you don't yet have.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 07:01, keymaster wrote:

> You'll be lucky if you reach a small fraction of the traffic the sites
> in the following thread get:
> 
> http://groups.google.com/group/cake-php/browse_thread/thread/a87ac46d4f590566#
> 
> In particular, watch this wonderful presentation on CakePHP TV,
> entitled: "CakePHP at massive scale on a budget", by Andy Gale.
> 
> http://tv.cakephp.org/video/CakeFoundation/2010/12/24/andy_gale_-_cakephp_at_massive_scale_on_a_budget
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: can any one help in tool tip for icons?

2011-02-02 Thread Jeremy Burns | Class Outfit
Do you mean on an image?

echo $this->Html->image(
'image.png',
array(
'alt' => 'For when the image is missing',
'title' => 'Your tooltip',
'url' => '/',
'width' => 100,
'height' => 100
)
); 

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 04:55, andy_the ultimate baker wrote:

> hi,
> good morning
> today on the desk i got one new task and that is tool tips for links
> which describe the purpose. i never had done this, so please
> please suggest me how to create tool top for icon links.
> 
> regards
> andy
> (trying to start a bakery)
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Users name / changes

2011-02-02 Thread Jeremy Burns | Class Outfit
Decide? I meant downside. ^^

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 04:06, Jeremy Burns | Class Outfit wrote:

> I would always let people change their names - I mean, why wouldn't you? 
> Women change their surname on marriage anyway and it is not impossible that a 
> first name can change too. Jonathan might decide he now wants to be referred 
> to as Jon. Jon then becomes Jane - it happens. I usually make a username an 
> email address because it is a no brainer for the user to come up with and 
> remember, is generally unique (or ought to be) and can be validated. I let 
> users change that too because people move providers/employers and so on.
> 
> I see no decide in letting people change their names. The thing you don't 
> want to change is the id.
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 2 Feb 2011, at 21:49, Dave Maharaj wrote:
> 
>> What are your thoughts on allowing "Users" to change their names?
>> 
>> Talking about real names, not username. 
>> f_name = John 
>> l_name = Smith
>> name_lock = bool , unlocked by default, upon edit of either field (f_name,
>> l_name) name_lock = true; no more edits after that
>> 
>> Really one should know their name well enough that a mistake should not be
>> made. 
>> I was thinking allow a 1 time change if you can't spell your name correctly
>> after that well them I am surprised you figured how to turn the computer on
>> in the first place.
>> 
>> Basic Site : Users name appears on thier profile, that's all. 
>> But there are people out there who would constantly change their names to
>> foolishness and there is simply no man power to watch these changes
>> constantly.
>> 
>> Am I being too hard? Thoughts? Suggestions 
>> 
>> Thanks,
>> 
>> Dave
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Blog example not working - need edit in View

2011-02-02 Thread Jeremy Burns | Class Outfit
You are right - I stand corrected.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 3 Feb 2011, at 01:04, euromark wrote:

> i am guessing its the cake1.3 bug
> do you use ANY variable in the view called $html?
> it destroys both $html and $this->Html helper objects
> 
> @Jeremy
> "If so, they override the defaults, which means that the Html helper
> is not loaded"
> 
> what version are you referring to? cake usually joins both app and
> custom controller helpers together
> at least for the custom controllers. you probably meant the app
> controller
> 
> anyway, use
> var $helpers = array('Html', ...);
> in you own app_controller.php
> and don't use $html as variable and it should work
> 
> 
> On 2 Feb., 17:50, ibejohn818  wrote:
>> What version of PHP/Server/Operating system are you running on?
>> 
>> This very well could be the issue.
>> 
>> On Feb 2, 4:38 am, Huy Nguyen  wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> I'm totally new to CakePHP so I followed the Blog example up to this point
>>> and get error because $this->Html not found in 
>>> View.http://book.cakephp.org/view/1536/Creating-Post-Views
>> 
>>> I believe the right way is $html instead of $this->Html (as pointed out by
>>> another person on Stackoverflow)
>> 
>>> http://stackoverflow.com/questions/4873781/htmlhelper-not-loaded-in-t...
>> 
>>> So I think someone with authority should edit the example in the Book?
>> 
>>> Huy
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Users name / changes

2011-02-02 Thread Jeremy Burns | Class Outfit
I would always let people change their names - I mean, why wouldn't you? Women 
change their surname on marriage anyway and it is not impossible that a first 
name can change too. Jonathan might decide he now wants to be referred to as 
Jon. Jon then becomes Jane - it happens. I usually make a username an email 
address because it is a no brainer for the user to come up with and remember, 
is generally unique (or ought to be) and can be validated. I let users change 
that too because people move providers/employers and so on.

I see no decide in letting people change their names. The thing you don't want 
to change is the id.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 21:49, Dave Maharaj wrote:

> What are your thoughts on allowing "Users" to change their names?
> 
> Talking about real names, not username. 
> f_name = John 
> l_name = Smith
> name_lock = bool , unlocked by default, upon edit of either field (f_name,
> l_name) name_lock = true; no more edits after that
> 
> Really one should know their name well enough that a mistake should not be
> made. 
> I was thinking allow a 1 time change if you can't spell your name correctly
> after that well them I am surprised you figured how to turn the computer on
> in the first place.
> 
> Basic Site : Users name appears on thier profile, that's all. 
> But there are people out there who would constantly change their names to
> foolishness and there is simply no man power to watch these changes
> constantly.
> 
> Am I being too hard? Thoughts? Suggestions 
> 
> Thanks,
> 
> Dave
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Blog example not working - need edit in View

2011-02-02 Thread Jeremy Burns | Class Outfit
That doesn't sound right to me - the convention is $this->Html and it works 
like a peach. If it didn't, there'd be a revolution.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 12:58, Huy Nguyen wrote:

> I just downloaded and installed from http://cakephp.org/ within a few hours 
> ago. 1.3.7
> 
> Yeah I tried $html->link instead of $this->Html. It works now. I just thought 
> someone might clarify and amend the example for those who attempt at it later 
> on?
> 
> :)
> 
> Huy
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Blog example not working - need edit in View

2011-02-02 Thread Jeremy Burns | Class Outfit
Have you included any other helpers anywhere? If so, they override the 
defaults, which means that the Html helper is not loaded. Try adding 'Html' to 
your list of helpers (and 'Form' for good measure, as that will be missing too).

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 12:50, Huy Nguyen wrote:

> The latest one on cakephp.net, 1.3.7.
> 
> 
> On Wed, Feb 2, 2011 at 7:44 PM, Jeremy Burns | Class Outfit 
>  wrote:
> What version of Cake are you using?
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 2 Feb 2011, at 12:43, Huy Nguyen wrote:
> 
>> Sorry for being brief. The error is described in the stackoverflow link.
>> Notice (8): Undefined property: View::$Html [APP\views\posts\index.ctp, line 
>> 27]
>> 
>> 
>> Here is the line:
>> echo $this->Html->link($post['Post']['title'], array('controller' => 
>> 'posts', 'action' => 'view', $post['Post']['id'])); 
>> 
>> I guess it doesnt load the HtmlHelper to View::$Html but instead to global 
>> variable $html?
>> 
>> On Wed, Feb 2, 2011 at 7:40 PM, andy_the ultimate baker 
>>  wrote:
>> clarify ur error clearly
>> 
>> 
>> On Feb 2, 5:38 pm, Huy Nguyen  wrote:
>> > I'm totally new to CakePHP so I followed the Blog example up to this point
>> > and get error because $this->Html not found in 
>> > View.http://book.cakephp.org/view/1536/Creating-Post-Views
>> >
>> > I believe the right way is $html instead of $this->Html (as pointed out by
>> > another person on Stackoverflow)
>> >
>> > http://stackoverflow.com/questions/4873781/htmlhelper-not-loaded-in-t...
>> >
>> > So I think someone with authority should edit the example in the Book?
>> >
>> > Huy
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Blog example not working - need edit in View

2011-02-02 Thread Jeremy Burns | Class Outfit
What version of Cake are you using?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 12:43, Huy Nguyen wrote:

> Sorry for being brief. The error is described in the stackoverflow link.
> Notice (8): Undefined property: View::$Html [APP\views\posts\index.ctp, line 
> 27]
> 
> Here is the line:
> echo $this->Html->link($post['Post']['title'], array('controller' => 'posts', 
> 'action' => 'view', $post['Post']['id'])); 
> 
> I guess it doesnt load the HtmlHelper to View::$Html but instead to global 
> variable $html?
> 
> On Wed, Feb 2, 2011 at 7:40 PM, andy_the ultimate baker 
>  wrote:
> clarify ur error clearly
> 
> 
> On Feb 2, 5:38 pm, Huy Nguyen  wrote:
> > I'm totally new to CakePHP so I followed the Blog example up to this point
> > and get error because $this->Html not found in 
> > View.http://book.cakephp.org/view/1536/Creating-Post-Views
> >
> > I believe the right way is $html instead of $this->Html (as pointed out by
> > another person on Stackoverflow)
> >
> > http://stackoverflow.com/questions/4873781/htmlhelper-not-loaded-in-t...
> >
> > So I think someone with authority should edit the example in the Book?
> >
> > Huy
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Jeremy Burns | Class Outfit
Don't forget you can use 'joins' that can give you the results you want. It's 
just a bit more fiddly.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 07:13, Name256 wrote:

> This would be nice as well. I'm just kind of in a dilemma on my
> current project where I am having problems getting desired results
> while using containable behaviour. I hope that this change will be
> effected on future versoins of CakePHP or it is atleast being
> considered because there are those times that conditions on the
> hasMany or HABTM side will affect the results of an entire query.
> 
> Kind regards.
> Abel
> 
> On Feb 2, 9:55 am, Jeremy Burns | Class Outfit
>  wrote:
>> I think an option to turn this on or off inside the 'contain' element would 
>> be fantastic.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 2 Feb 2011, at 06:52, Name256 wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Fantastic news. I was wondering whether there were going to be any
>>> changes made to the containable behaviour in the results returned from
>>> queries where filters applied to child models can be strictly applied
>>> to the parent model as well to endure that data is filtered
>>> accordingly (I am aware that containable is designed to filter data i
>>> related models only and not the parent model of the query).
>> 
>>> Kind regards.
>> 
>>> Abel
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Jeremy Burns | Class Outfit
I think an option to turn this on or off inside the 'contain' element would be 
fantastic.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 06:52, Name256 wrote:

> Fantastic news. I was wondering whether there were going to be any
> changes made to the containable behaviour in the results returned from
> queries where filters applied to child models can be strictly applied
> to the parent model as well to endure that data is filtered
> accordingly (I am aware that containable is designed to filter data i
> related models only and not the parent model of the query).
> 
> Kind regards.
> 
> Abel
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Strange names in cached views

2011-02-01 Thread Jeremy Burns | Class Outfit
This has come up before, but the answer is not obvious. Here's a stolen reply 
from an earlier post:

This is actually caused by a bug in the PCRE library on Centos / Red Hat. See 
this 
http://blog.echothis.com/2011/01/27/fixing-cakephp-1-3s-cache-key-error-on-red-hat-and-centos/
 blog post  for how to fix it.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 1 Feb 2011, at 15:58, faem...@gmail.com wrote:

> Hi to all,
> 
> I've enabled cache in all actions of one controller and it works right
> in the developer server (local). But in production (MediaTemple) the
> filename of cache files generated always is strange, like kt_u_o_.php
> and because of it sometimes some pages don't show it right.
> 
> I have the same problem like:
> http://groups.google.com/group/cake-php/browse_thread/thread/9ccd140d82b56f5d/3a7b1d85549f4e22?lnk=gst&q=cache+names+file#3a7b1d85549f4e22
> 
> I have the same version of CakePHP (1.3.7) in both servers.
> Local server (Ubuntu 10.10, PHP 5.2.15
> Production server (CentOS 4, PHP 5.2.6
> 
> Anyone known something about that?
> 
> Thanks for advance.
> 
> Israel
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable Results

2011-02-01 Thread Jeremy Burns | Class Outfit
This is (regrettably) how it is supposed to work as it is using outer joins. To 
achieve what you want to do you need to use the 'joins' options, where you can 
specify inner joins, which will filter your results correctly. 
http://book.cakephp.org/view/1047/Joining-tables

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 1 Feb 2011, at 11:18, Name256 wrote:

> Hello,
> 
> I have been trying out the containable behaviour and it seems that the
> applied filter on "contained" models only apply to them and not the
> parent model.
> 
> For example I have a model Transaction and TransactionDetail where
> Transaction hasMany TransactionDetail. If I apply a condition on the
> TransactionDetail, the result still returns all the transactions. I
> did an override of the afterFind method to further filter the data but
> it ended up breaking pagination in the view.
> 
> I have had a look at the many posts where containable has been
> discussed but I'm at a loss as to whether there is another way of
> retrieving paginated data with all conditions applying for all models
> present.
> 
> Kindly assist.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Please help me! almost got crazy...with Tree behavior..

2011-01-31 Thread Jeremy Burns | Class Outfit
He was getting errors when calling a Tree helper method. As the array of 
helpers was set up incorrectly ($actAs instead of $actsAs) the helper wasn't 
loaded, so the method failed.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 31 Jan 2011, at 13:19, rahul jeevan wrote:

> hi
> 
> wat is the actual problem
> 
> On Mon, Jan 31, 2011 at 11:15 AM, Jeremy Burns | Class Outfit 
>  wrote:
> He had $actAs instead of $actsAs, so the behaviour wasn't loading. It's a 
> common mistake.
> 
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 29 Jan 2011, at 11:59, satya prakash wrote:
> 
>> YOU ARE CHECH IN MODEL QUERYES AND CHECK SYNTAX ; OR ' OR " . THESE SOULD BE 
>> CHECK
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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
> 
> 
> 
> -- 
> rahul
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable Query Slow - Am I doing it wrong?

2011-01-31 Thread Jeremy Burns | Class Outfit
AFAIK there is no problem using a fields key inside 'contain'. It's a good way 
of drawing back less data.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 31 Jan 2011, at 17:33, Tilen Majerle wrote:

> i think (i'm not sure), but in contain key you should not use 'fields', 
> 'conditions' and so on keys, because this you should do when you make a model 
> associations, so you should do just this
> 
> {{{
> 
> $this->Category->Behaviors->attach('Containable');
> $tempCategories = $this->Category->find('all', array(
>'fields' => array('id','title','description','order'),
>'order' => array("Parent.title" => "asc","Category.order" => "asc"),
>'contain'=>array(
>'Parent' ,
>'Product' => array(
>   'Variation'
>) 
> )
> ));
> 
> }}}
> 
> but like i saidi'm NOT sure
> 
> 
> --
> Lep pozdrav, Tilen Majerle
> http://majerle.eu
> 
> 
> 
> 2011/1/31 TimG 
> Hey,
> This code below works well but the query is really slow. It adds five
> seconds more to the page request time. Am I doing something wrong or
> is it just the way it is? Also, is there a way to do this with a
> custom query and would it be any quicker? Thanks in advance!
> 
> $this->Category->Behaviors->attach('Containable');
> $tempCategories = $this->Category->find('all', array(
>'fields' => array('id','title','description','order'),
>'order' => array("Parent.title" => "asc","Category.order" => "asc"),
>'contain'=>array(
>'Parent' => array('fields' => 
> array('id','title','description')),
>'Product' => array('fields' => 
> array('id','title','description'),
>'conditions' => array('active'=>1),
>'Variation' => array('fields' => 
> array('id','title','price'))
> ;
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable Query Slow - Am I doing it wrong?

2011-01-31 Thread Jeremy Burns | Class Outfit
Looks alright. What are the indexes and relationships like on the db?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 31 Jan 2011, at 17:23, TimG wrote:

> Hey,
> This code below works well but the query is really slow. It adds five
> seconds more to the page request time. Am I doing something wrong or
> is it just the way it is? Also, is there a way to do this with a
> custom query and would it be any quicker? Thanks in advance!
> 
> $this->Category->Behaviors->attach('Containable');
> $tempCategories = $this->Category->find('all', array(
>   'fields' => array('id','title','description','order'),
>   'order' => array("Parent.title" => "asc","Category.order" => "asc"),
>   'contain'=>array(
>   'Parent' => array('fields' => 
> array('id','title','description')),
>   'Product' => array('fields' => 
> array('id','title','description'),
>   'conditions' => array('active'=>1),
>   'Variation' => array('fields' => 
> array('id','title','price'))
> ;
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Numeric Keys with Form Select

2011-01-30 Thread Jeremy Burns | Class Outfit
By default, the helper will use the id and name (or title) fields from your 
related lookup table, and you populate the options by:

$categories = $this->[Model]->Category->find('list'); ([Model] is the model 
associated with the current controller)

You then pass that variable (using set) into the view from your controller. The 
input:

echo $this->Form->input('category_id');

...will then automatically look for a variable called $categories. If it is 
present, it will use those values, or the variable you have specified 
('category_list', in your case).

If you are deviating away from this standard you can expect the unexpected and 
the need to do some hacking. Looks like the problem is the way you are building 
your options array, or possibly the data type of the underlying field, 
'category'; is that a varchar/char? It really ought to be called category_id to 
meet with conventions, and I would use Form->input, not Form->select.


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 29 Jan 2011, at 21:05, richfarr wrote:

> I'm using the FormHelper (cake 1.3) to create a select box from an
> array. The array uses numbers as keys but the select box ignores those
> numbers and uses a zero-based index for the select box option values.
> I've tried typing the array key to a string using both (string)$key
> and strval($key) with no luck. The select options work when I prepend
> a letter before the numeric key (i.e. 'c'.$key ) but I'd like to avoid
> this hack.
> 
> Is there a way to force FormHelper to use the actual numeric keys
> without prepending a letter? Any help would be appreciated.
> 
> See the following code for illustration:
> 
> // $category_list looks like this
> Array
> (
>[164] => Antiques & Art
>[83] => Baby/Children Needs
>[176] => Boats/Marine/Fishing
>[222] => Books & Magazines
>[287] => Building Materials
>[215] => Business
>[175] => Caravans & Motor Homes
>[169] => Cars & Other Vehicles
>[127] => Clothing & Accessories
>[92] => Computers & Electronics
>[358] => Farm & Agriculture
>[235] => Garage Sales/Yard Sales
>[309] => Garden & Yard
>[178] => General Merchandise
>[138] => Health & Beauty
>[186] => Hobbies & Collectables
>[63] => Household
>[234] => Information
>[388] => Motorbikes & Scooters
>[206] => Musical Instruments
>[449] => Notices
>[305] => Pets and Accessories
>[242] => Positions Vacant
>[236] => Real Estate & Rentals
>[243] => Services
>[143] => Sports Equipment
>[308] => Tools & Equipment
>[300] => Travel & Holiday
> )
> 
> // Output category select box
> echo $form->select(
>   'category',
>   $category_list,
>   $category,
>   array('id'=>'SearchCategories')
> );
> 
> // Outputs like this
> Antiques & Art
> Baby/Children Needs
> Boats/Marine/Fishing
> Books & Magazines
> ...
> 
> // I'd like it to output like this
> Antiques & Art
> Baby/Children Needs
> Boats/Marine/Fishing
> Books & Magazines
> ...
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Please help me! almost got crazy...with Tree behavior..

2011-01-30 Thread Jeremy Burns | Class Outfit
He had $actAs instead of $actsAs, so the behaviour wasn't loading. It's a 
common mistake.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 29 Jan 2011, at 11:59, satya prakash wrote:

> YOU ARE CHECH IN MODEL QUERYES AND CHECK SYNTAX ; OR ' OR " . THESE SOULD BE 
> CHECK
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Please help me! almost got crazy...with Tree behavior..

2011-01-29 Thread Jeremy Burns | Class Outfit
It's $actsAs, not $actAs.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 08:41, raymond wrote:

> Hi, everyone.
> This is second time to post with this kind of content to this group.
> My first time post was gone, never appears, and dunno why, so I m
> writing the post again.
> 
> I just used Tree behavior for category, according to what cakePHP
> manual said.
> But when I used generatetreelist(), it all  times says following:
> 
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'generatetreelist' at line 1 [CORE\cake\libs
> \model\datasources\dbo_source.php, line 684]
> ...
> $sql  =   "generatetreelist"
> $error=   "1064: You have an error in your SQL syntax; check the 
> manual
> that corresponds to your MySQL server version for the right syntax to
> use near 'generatetreelist' at line 1"
> $out  =   null
> ...
> msController::category() - APP\controllers\items_controller.php, line
> 12
> ...
> Query: generatetreelist
> 
> I found that the system actually does not recorgnize what
> generatetreelist() is, but do not know what to do...
> 
> I created table called lkp_itemcate with following fields:
> id, parent_id, lft, rght, name, img_url, level, created, modified
> 
> And made Model class following:
> class Itemcate extends AppModel {
>   var $name = 'Itemcate';
>   var $tablePrefix = 'lkp_';
>   var $useTable = 'itemcate';
> 
>   var $actAs = array('Tree');
> }
> 
> and then used generatetreelist() in controller:
> 
> class ItemsController extends AppController {
>   var $name = 'Items';
>   var $modelClass = 'Itemcate';
>   var $uses = array('Itemcate');
> 
>   function category($act = 'index', $id = null) {
>   ...
>   $list = $this->Itemcate->generatetreelist(null, null, null,
> '   ');
>...
>}
>...
> }
> 
> Please help me to settle with this issue.
> I really can not find what s wrong, googled for 2 hours, but never
> find such a case like mine.
> Best regards, Raymond.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: actAs "Tree" : generatetreelist error

2011-01-29 Thread Jeremy Burns | Class Outfit
It's $actsAs, not $actAs.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 02:44, raymond wrote:

> Hi.
> I have tried Tree behavior just according to manual, but it reports
> error following:
> 
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'generatetreelist' at line 1
> Query: generatetreelist
> 
> I debugged and found that cakePHP does not understand the method
> generatetreelist()
> 
> I have created table 'lkp_itemcate' with following columns:
> id, parent_id, lft, rght, name, img_url, level, created, modified.
> 
> And then created model file:
> 
> class Itemcate extends AppModel {
>   var $name = 'Itemcate';
>   var $tablePrefix = 'lkp_';
>   var $useTable = 'itemcate';
> 
>   var $actAs = array('Tree');
> }
> 
> and inserted following code to controller action:
> 
> $list = $this->Itemcate->generatetreelist(null, null, null,
> '   ');
> 
> Any advice?
> Thanks.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Helper File

2011-01-28 Thread Jeremy Burns | Class Outfit
What version of Cake are you using?

The Html helper is available out of the box. Have you declared any other 
helpers in your controller?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 29 Jan 2011, at 07:44, newguy wrote:

> I tried that but no change I still get the same error :(
> 
> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
>  wrote:
>> Try replacing $html-> with:
>> 
>> echo $this->Html->...
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 29 Jan 2011, at 07:29, newguy wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> here is the code(knownusers.ctp) where I have used the helpers:
>> 
>>> 
>>> >> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
>>> foreach ($knownusers as $thisuser)
>>> {
>>>echo $html->tableCells($thisuser['User']);
>>> }
>> 
>>> ?>
>>> 
>> 
>>> and this is the error which I get when I access
>>> http://localhost:/cake_1.2.5/users/knownusersfrom browser:
>> 
>>> Missing Helper File
>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
>>> or does not exist.
>> 
>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>> 
>>> >> class HTMLHelper extends AppHelper {
>> 
>>> }
>>> ?>
>>> Notice: If you want to customize this error message, create app/views/
>>> errors/missing_helper_file.ctp
>> 
>>> Thanks
>>> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
>>>  wrote:
>>>> Can you show the line of code that is being called and returning this 
>>>> error?
>> 
>>>> Jeremy Burns
>>>> Class Outfit
>> 
>>>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>>>> On 29 Jan 2011, at 07:09, newguy wrote:
>> 
>>>>> Hi guys
>>>>> am new to cakephp and Iam developing a simple user registration and
>>>>> login system for my site, I used two helpers tableHeaders and
>>>>> tableCells in my view code but I get the following errors:
>> 
>>>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
>>>>> or does not exist.
>> 
>>>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>> 
>>>>> I realized that in folder helpers I have a file named empty and there
>>>>> is no code there, so if I understand correctly in order to use helpers
>>>>> I need to put the code in this helper file and should it be in the
>>>>> form of functions, in what way should code be written in this file
>>>>> under folder helper and what should be the name of this file.
>>>>> If someone can please give a small example I would be grateful.
>> 
>>>>> Thanks
>> 
>>>>> --
>>>>> Our newest site for the community: CakePHP Video 
>>>>> Tutorialshttp://tv.cakephp.org
>>>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
>>>>> others with their CakePHP related questions.
>> 
>>>>> To unsubscribe from this group, send email to
>>>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>>>> athttp://groups.google.com/group/cake-php
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Helper File

2011-01-28 Thread Jeremy Burns | Class Outfit
Try replacing $html-> with:

echo $this->Html->...


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 29 Jan 2011, at 07:29, newguy wrote:

> here is the code(knownusers.ctp) where I have used the helpers:
> 
> 
>  echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> foreach ($knownusers as $thisuser)
> {
>   echo $html->tableCells($thisuser['User']);
> }
> 
> ?>
> 
> 
> and this is the error which I get when I access
> http://localhost:/cake_1.2.5/users/knownusers from browser:
> 
> Missing Helper File
> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> or does not exist.
> 
> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
> 
>  class HTMLHelper extends AppHelper {
> 
> }
> ?>
> Notice: If you want to customize this error message, create app/views/
> errors/missing_helper_file.ctp
> 
> 
> Thanks
> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
>  wrote:
>> Can you show the line of code that is being called and returning this error?
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 29 Jan 2011, at 07:09, newguy wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Hi guys
>>> am new to cakephp and Iam developing a simple user registration and
>>> login system for my site, I used two helpers tableHeaders and
>>> tableCells in my view code but I get the following errors:
>> 
>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
>>> or does not exist.
>> 
>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>> 
>>> I realized that in folder helpers I have a file named empty and there
>>> is no code there, so if I understand correctly in order to use helpers
>>> I need to put the code in this helper file and should it be in the
>>> form of functions, in what way should code be written in this file
>>> under folder helper and what should be the name of this file.
>>> If someone can please give a small example I would be grateful.
>> 
>>> Thanks
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Helper File

2011-01-28 Thread Jeremy Burns | Class Outfit
Can you show the line of code that is being called and returning this error?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 29 Jan 2011, at 07:09, newguy wrote:

> Hi guys
> am new to cakephp and Iam developing a simple user registration and
> login system for my site, I used two helpers tableHeaders and
> tableCells in my view code but I get the following errors:
> 
> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> or does not exist.
> 
> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
> 
> I realized that in folder helpers I have a file named empty and there
> is no code there, so if I understand correctly in order to use helpers
> I need to put the code in this helper file and should it be in the
> form of functions, in what way should code be written in this file
> under folder helper and what should be the name of this file.
> If someone can please give a small example I would be grateful.
> 
> Thanks
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Is there any way to incldue all models automatically

2011-01-28 Thread Jeremy Burns | Class Outfit
Two thousand apologies.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 13:45, Stephen wrote:

> On 28 January 2011 13:31, Jeremy Burns | Class Outfit 
>  wrote:
> I'm confused about the challenge you are facing then...?
> 
> I'm not facing any particular challenge, it seems you may have confused me as 
> the thread-starter
> 
> -- 
> Kind Regards
>  Stephen @ NinjaCoderMonkey
> 
>  www.ninjacodermonkey.co.uk
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Is there a way to make all view context available in a helper's method? --psybear

2011-01-28 Thread Jeremy Burns | Class Outfit
Check for $this->params in the helper.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 13:30, psybear83 wrote:

> Hey everybody
> 
> I have a helper which should behave in different ways depending on the
> actual controller and action. But I don't like to pass this
> information as parameters. So I wanted to know - is there a way to let
> the helper know this without having to pass it every time as a
> parameter?
> 
> Thanks,
> Josh
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Is there any way to incldue all models automatically

2011-01-28 Thread Jeremy Burns | Class Outfit
I'm confused about the challenge you are facing then...?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 13:29, Stephen wrote:

> On 28 January 2011 13:15, Jeremy Burns | Class Outfit 
>  wrote:
> If the models are associated you don't need to load them ..
> 
> This is why I said I would hope they were already associated (e.g. daisy 
> chain) :]
> That was just an example
> 
> -- 
> Kind Regards
>  Stephen @ NinjaCoderMonkey
> 
>  www.ninjacodermonkey.co.uk
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Is there any way to incldue all models automatically

2011-01-28 Thread Jeremy Burns | Class Outfit
If the models are associated you don't need to load them. You can access models 
by daisy chaining them, e.g.:

$this->User->Profile->Image->find();


Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 13:05, Stephen wrote:

> I wouldn't want to load all models, all the time, for everything.
> 
> But sometimes I find myself needing to load more than 1 model into my 
> controller, not always, but to make it easier I have something on the lines 
> of this
> 
> #app_controller.php
> function _loadMultipleModels($models=array()) {
> foreach($models as $model) {
> $this->loadModel($model);
> }
> }
> 
> Then within your controller you would do something like:
> 
> $this->_loadMultipleModels(array('User', 'Profile', 'Image'));
> 
> Obviously they are example models, I would hope "User, Profile and Image" are 
> associated.
> 
> 
> On 28 January 2011 03:16, euromark  wrote:
> believe me, you don't wanna do that...
> 
> what exactly is "I run to the model issue so many times"
> 
> 
> On 28 Jan., 00:03, cake-learner  wrote:
> > Is there any way to include all models by default. I run to the model
> > issue so many times defining the relationship so i just want to join
> > manually so i can cut some development time.
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> 
> -- 
> Kind Regards
>  Stephen @ NinjaCoderMonkey
> 
>  www.ninjacodermonkey.co.uk
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Tree behavior does not work!!!

2011-01-28 Thread Jeremy Burns | Class Outfit
It's $actsAs, not $actAs.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 09:00, Raymond Chester wrote:

> Hi, everyone.
> This is second time to post with this kind of content to this group.
> My first time post was gone, never appears, and dunno why, so I m
> writing the post again.
> 
> I just used Tree behavior for category, according to what cakePHP
> manual said.
> But when I used generatetreelist(), it all  times says following:
> 
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'generatetreelist' at line 1 [CORE\cake\libs
> \model\datasources\dbo_source.php, line 684]
> ...
> $sql  =   "generatetreelist"
> $error=   "1064: You have an error in your SQL syntax; check the 
> manual
> that corresponds to your MySQL server version for the right syntax to
> use near 'generatetreelist' at line 1"
> $out  =   null
> ...
> msController::category() - APP\controllers\items_controller.php, line
> 12
> ...
> Query: generatetreelist
> 
> I found that the system actually does not recorgnize what
> generatetreelist() is, but do not know what to do...
> 
> I created table called lkp_itemcate with following fields:
> id, parent_id, lft, rght, name, img_url, level, created, modified
> 
> And made Model class following:
> class Itemcate extends AppModel {
>   var $name = 'Itemcate';
>   var $tablePrefix = 'lkp_';
>   var $useTable = 'itemcate';
> 
>   var $actAs = array('Tree');
> }
> 
> and then used generatetreelist() in controller:
> 
> class ItemsController extends AppController {
>   var $name = 'Items';
>   var $modelClass = 'Itemcate';
>   var $uses = array('Itemcate');
> 
>   function category($act = 'index', $id = null) {
>   ...
>   $list = $this->Itemcate->generatetreelist(null, null, null,
> '   ');
> ...
> }
> ...
> }
> 
> Please help me to settle with this issue.
> I really can not find what s wrong, googled for 2 hours, but never
> find such a case like mine.
> Best regards, Raymond.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: getting an error Unknown column 'State.name' in 'order clause'

2011-01-27 Thread Jeremy Burns | Class Outfit
Try adding:

var $displayField = 'title';

...to the top of your model.

PS: I presume the 'name' field exists in the table?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 06:28, andy_the ultimate baker wrote:

> hi bakers,
> good morning to all but it is not going good for me,
> since morning i m trying to resolve one error
> 
> "Unknown column 'State.name' in 'order clause'"
> 
> but i m not getting where exactly i m wrong,
> can anyone suggest me the solution on it,
> 
> a query is coming out in error is as fallows
> 
> Query: SELECT `State`.`id`, `State`.`title` FROM `states` AS `State`
> WHERE 1 = 1   ORDER BY `State`.`name` ASC
> 
> and my controller is doing this
> 
>   function add() {
> 
>   $states = $this->State->find('list');
>   //print_r($states);exit;
>   $cities = $this->City->find('all',
> array('conditions'=>array($states)));
>   $this->set(compact('states', 'cities'));
> 
> }
> 
> 
> and my model is as fallows
> 
> 
>  class State extends AppModel {
>   var $name = 'State';
>   var $order = "State.name ASC";
> }
> ?>
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: anybody have idea for this

2011-01-27 Thread Jeremy Burns | Class Outfit
It's a CSS thing. Look for the style applied to the flash message and change it 
in your stylesheet.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 28 Jan 2011, at 05:54, Miqdad Ali wrote:

> anybody have  idea for this
> var $validate = array(
> 
>   'name' => array(
>   'rule' =>  
> array('custom','/^[A-Z -.]{1,}$/i'),
>   'required' => true,
>   'message' => 'Please Enter Name'
> 
>)
> )
> this is my model for validating name I want to display this message in red 
> color
> pls help.
> 
> 
> 
> Miqdad Ali
> 
> http://www.miqdadalik.co.cc/
> http://www.miqdadali.co.cc
> 
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Connecting to a remote database via SSH

2011-01-27 Thread Jeremy Burns | Class Outfit
Dave - I got a perfect solution to this a few days ago from Zaky Katalan-Ezra. 
My challenge wasn't connecting to a remote db via SSH using a client (I use 
Sequel Pro) as that works great. What I wanted to do was to create a 
database.php configuration that would allow a local Cake app to connect to the 
remote db, which means that all (distributed) developers can develop and test 
against a single database.

For good measure, here is Zaky's response:

edit /etc/ssh/sshd_config on your local machine
Add:
AllowTcpForwarding yes
GatewayPorts yes

restart sshd

Edit my.cnf on remote machine.
Uncomment the following line.
bind-address   = 127.0.0.1
restart mysql

On you local machine run the following command
ssh -i e-keypair -f remoteu...@remote.com -N -L :localhost:3306
If you are not using ssh key you will be prompt for remote user assword

Edit database.php

var $default = array(
'driver' => 'mysqli',
'persistent' => false,
'host' => '127.0.0.1',
'port'=>,
'login' => 'user',
'password' => 'pass',
'database' => 'schema',
'prefix' => ''
);

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 27 Jan 2011, at 22:13, Dave Maharaj wrote:

> I just setup mySQL workbench on my local machine to connect to my  server / 
> sql database.
>  I do not want phpmyAdmin so I use this to administer my db’s.
>  It connects thru the ssh tunnel. Is that what your looking for? I did not 
> connect it to my localhost (my home machine) though so if that’s what you are 
> in need of I am unsure of that aspect but will follow this post to see if 
> anyone else does.
>  
> Dave
>  
> From: Jeremy Burns [mailto:jeremybu...@classoutfit.com] 
> Sent: Tuesday, January 25, 2011 4:02 PM
> To: cake-php@googlegroups.com
> Subject: Connecting to a remote database via SSH
>  
> Does anyone have any ideas for how to connect to a remote database via SSH? 
> It's a development thing so that people working remotely can develop against 
> the same database hosted on our virtual server.
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Connecting to a remote database via SSH

2011-01-26 Thread Jeremy Burns | Class Outfit
This worked perfectly - thanks Zaky.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 26 Jan 2011, at 07:41, Zaky Katalan-Ezra wrote:

> edit /etc/ssh/sshd_config on your local machine
> Add:
> AllowTcpForwarding yes
> GatewayPorts yes
> 
> restart sshd
> 
> Edit my.cnf on remote machine.
> Uncomment the following line.
> bind-address   = 127.0.0.1
> restart mysql
> 
> On you local machine run the following command
> ssh -i e-keypair -f remoteu...@remote.com -N -L :localhost:3306
> If you are not using ssh key you will be prompt for remote user assword
> 
> Edit database.php
> 
> var $default = array(
> 'driver' => 'mysqli',
> 'persistent' => false,
> 'host' => '127.0.0.1',
> 'port'=>,
> 'login' => 'user',
> 'password' => 'pass',
> 'database' => 'schema',
> 'prefix' => '',
> 
> 
> 
> On Wed, Jan 26, 2011 at 8:24 AM, Jeremy Burns | Class Outfit 
>  wrote:
> I don't think I am explaining myself clearly. I am connecting to the database 
> fine (using Sequel Pro). That is not my problem.
> 
> I want to get my local instance of a CakePHP application to connect to a 
> remote database via SSH, so need to have the right configuration in 
> database.php. That's where I need the guidance.
> 
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 26 Jan 2011, at 06:20, Zaky Katalan-Ezra wrote:
> 
>> 1. You need port 22 and 3306 to be open on the remote server
>> 2. Install mysql workbench
>> 3. In the new connection form set the connection method to tcp over ssh.
>> 4. If you are using terminal and not GUI use ssh tunnel.
>> 
>> And you may find more info here: 
>> http://forums.mysql.com/read.php?30,249779,249779
>> 
>> On Wed, Jan 26, 2011 at 7:21 AM, Jeremy Burns | Class Outfit 
>>  wrote:
>> Thanks - I was hoping that someone could suggest a database.php setting that 
>> would make the connection.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.com
>> http://www.classoutfit.com
>> 
>> On 26 Jan 2011, at 05:01, bdwilton wrote:
>> 
>> > Not sure if this is exactly what you had in mind, but...
>> >
>> > If you have a local work server with a local router which you can open up 
>> > a port on you can use a SSH tunnel on your local work server to forward 
>> > that port to a remote VPN or remote server which has its ports locked down 
>> > but accessible to your IP.  This opens up the port through your router to 
>> > be accessed externally but through SSH to the remote server.
>> >
>> > Just look up SSH Tunnel.
>> >
>> > Brett Wilton
>> > http://wiltonsoftware.com
>> >
>> > On 26/01/2011 8:32 a.m., Jeremy Burns wrote:
>> >> Does anyone have any ideas for how to connect to a remote database via 
>> >> SSH? It's a development thing so that people working remotely can develop 
>> >> against the same database hosted on our virtual server. --
>> >> Our newest site for the community: CakePHP Video Tutorials 
>> >> http://tv.cakephp.org
>> >> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> >> others with their CakePHP related questions.
>> >>
>> >>
>> >> 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
>> >
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials 
>> > http://tv.cakephp.org Check out the new CakePHP Questions site 
>> > http://ask.cakephp.org and help others with their CakePHP related 
>> > questions.
>> >
>> >
>> > 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
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe f

Re: Connecting to a remote database via SSH

2011-01-26 Thread Jeremy Burns | Class Outfit
Thanks - I will give this a go.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 26 Jan 2011, at 07:41, Zaky Katalan-Ezra wrote:

> edit /etc/ssh/sshd_config on your local machine
> Add:
> AllowTcpForwarding yes
> GatewayPorts yes
> 
> restart sshd
> 
> Edit my.cnf on remote machine.
> Uncomment the following line.
> bind-address   = 127.0.0.1
> restart mysql
> 
> On you local machine run the following command
> ssh -i e-keypair -f remoteu...@remote.com -N -L :localhost:3306
> If you are not using ssh key you will be prompt for remote user assword
> 
> Edit database.php
> 
> var $default = array(
> 'driver' => 'mysqli',
> 'persistent' => false,
> 'host' => '127.0.0.1',
> 'port'=>,
> 'login' => 'user',
> 'password' => 'pass',
> 'database' => 'schema',
> 'prefix' => '',
> 
> 
> 
> On Wed, Jan 26, 2011 at 8:24 AM, Jeremy Burns | Class Outfit 
>  wrote:
> I don't think I am explaining myself clearly. I am connecting to the database 
> fine (using Sequel Pro). That is not my problem.
> 
> I want to get my local instance of a CakePHP application to connect to a 
> remote database via SSH, so need to have the right configuration in 
> database.php. That's where I need the guidance.
> 
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 26 Jan 2011, at 06:20, Zaky Katalan-Ezra wrote:
> 
>> 1. You need port 22 and 3306 to be open on the remote server
>> 2. Install mysql workbench
>> 3. In the new connection form set the connection method to tcp over ssh.
>> 4. If you are using terminal and not GUI use ssh tunnel.
>> 
>> And you may find more info here: 
>> http://forums.mysql.com/read.php?30,249779,249779
>> 
>> On Wed, Jan 26, 2011 at 7:21 AM, Jeremy Burns | Class Outfit 
>>  wrote:
>> Thanks - I was hoping that someone could suggest a database.php setting that 
>> would make the connection.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.com
>> http://www.classoutfit.com
>> 
>> On 26 Jan 2011, at 05:01, bdwilton wrote:
>> 
>> > Not sure if this is exactly what you had in mind, but...
>> >
>> > If you have a local work server with a local router which you can open up 
>> > a port on you can use a SSH tunnel on your local work server to forward 
>> > that port to a remote VPN or remote server which has its ports locked down 
>> > but accessible to your IP.  This opens up the port through your router to 
>> > be accessed externally but through SSH to the remote server.
>> >
>> > Just look up SSH Tunnel.
>> >
>> > Brett Wilton
>> > http://wiltonsoftware.com
>> >
>> > On 26/01/2011 8:32 a.m., Jeremy Burns wrote:
>> >> Does anyone have any ideas for how to connect to a remote database via 
>> >> SSH? It's a development thing so that people working remotely can develop 
>> >> against the same database hosted on our virtual server. --
>> >> Our newest site for the community: CakePHP Video Tutorials 
>> >> http://tv.cakephp.org
>> >> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> >> others with their CakePHP related questions.
>> >>
>> >>
>> >> 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
>> >
>> > --
>> > Our newest site for the community: CakePHP Video Tutorials 
>> > http://tv.cakephp.org Check out the new CakePHP Questions site 
>> > http://ask.cakephp.org and help others with their CakePHP related 
>> > questions.
>> >
>> >
>> > 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
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe from t

Re: Connecting to a remote database via SSH

2011-01-25 Thread Jeremy Burns | Class Outfit
I don't think I am explaining myself clearly. I am connecting to the database 
fine (using Sequel Pro). That is not my problem.

I want to get my local instance of a CakePHP application to connect to a remote 
database via SSH, so need to have the right configuration in database.php. 
That's where I need the guidance.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 26 Jan 2011, at 06:20, Zaky Katalan-Ezra wrote:

> 1. You need port 22 and 3306 to be open on the remote server
> 2. Install mysql workbench
> 3. In the new connection form set the connection method to tcp over ssh.
> 4. If you are using terminal and not GUI use ssh tunnel.
> 
> And you may find more info here: 
> http://forums.mysql.com/read.php?30,249779,249779
> 
> On Wed, Jan 26, 2011 at 7:21 AM, Jeremy Burns | Class Outfit 
>  wrote:
> Thanks - I was hoping that someone could suggest a database.php setting that 
> would make the connection.
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 26 Jan 2011, at 05:01, bdwilton wrote:
> 
> > Not sure if this is exactly what you had in mind, but...
> >
> > If you have a local work server with a local router which you can open up a 
> > port on you can use a SSH tunnel on your local work server to forward that 
> > port to a remote VPN or remote server which has its ports locked down but 
> > accessible to your IP.  This opens up the port through your router to be 
> > accessed externally but through SSH to the remote server.
> >
> > Just look up SSH Tunnel.
> >
> > Brett Wilton
> > http://wiltonsoftware.com
> >
> > On 26/01/2011 8:32 a.m., Jeremy Burns wrote:
> >> Does anyone have any ideas for how to connect to a remote database via 
> >> SSH? It's a development thing so that people working remotely can develop 
> >> against the same database hosted on our virtual server. --
> >> Our newest site for the community: CakePHP Video Tutorials 
> >> http://tv.cakephp.org
> >> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> >> others with their CakePHP related questions.
> >>
> >>
> >> 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
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials 
> > http://tv.cakephp.org Check out the new CakePHP Questions site 
> > http://ask.cakephp.org and help others with their CakePHP related questions.
> >
> >
> > 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
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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
> 
> 
> 
> -- 
> Regards,
> Zaky Katalan-Ezra
> QA Administrator
> www.IGeneriX.com
> Sites.IGeneriX.com
> 054-7762312
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Connecting to a remote database via SSH

2011-01-25 Thread Jeremy Burns | Class Outfit
Thanks - I was hoping that someone could suggest a database.php setting that 
would make the connection.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 26 Jan 2011, at 05:01, bdwilton wrote:

> Not sure if this is exactly what you had in mind, but...
> 
> If you have a local work server with a local router which you can open up a 
> port on you can use a SSH tunnel on your local work server to forward that 
> port to a remote VPN or remote server which has its ports locked down but 
> accessible to your IP.  This opens up the port through your router to be 
> accessed externally but through SSH to the remote server.
> 
> Just look up SSH Tunnel.
> 
> Brett Wilton
> http://wiltonsoftware.com
> 
> On 26/01/2011 8:32 a.m., Jeremy Burns wrote:
>> Does anyone have any ideas for how to connect to a remote database via SSH? 
>> It's a development thing so that people working remotely can develop against 
>> the same database hosted on our virtual server. --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> 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
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org Check out the new CakePHP Questions site 
> http://ask.cakephp.org and help others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Connecting to a remote database via SSH

2011-01-25 Thread Jeremy Burns | Class Outfit
Linux. Apache. MySQL.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 25 Jan 2011, at 20:03, Moises Alberto Lindo Gutarra wrote:

> what RDBMS??? What OS???
> 
> 2011/1/25 Jeremy Burns :
>> Does anyone have any ideas for how to connect to a remote database via SSH?
>> It's a development thing so that people working remotely can develop against
>> the same database hosted on our virtual server.
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>> 
>> 
>> 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
>> 
> 
> 
> 
> -- 
> Atentamente,
> Moisés Alberto Lindo Gutarra
> Asesor - Desarrollador Java / Open Source
> Linux Registered User #431131 - http://counter.li.org/
> Cel: (511) 995081720
> MSN: mli...@tumisolutions.com
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Connecting to a remote database via SSH

2011-01-25 Thread Jeremy Burns
Does anyone have any ideas for how to connect to a remote database via SSH? 
It's a development thing so that people working remotely can develop against 
the same database hosted on our virtual server.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Changing the layout and appearance

2011-01-25 Thread Jeremy Burns | Class Outfit
Start here: http://book.cakephp.org/view/1078/Views.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 25 Jan 2011, at 00:16, Kid wrote:

> Hello, I'm new to cake php but i know a bit bout basic php.. I
> understand the MVC concept i think^^, i need to change the whole
> appearance and layout of a site powered by cakePhp..where can i find
> the file that controls the structure and appearance of the pages and
> how?? Sorry for my noobness.. tq all^^
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: static function in model

2011-01-24 Thread Jeremy Burns | Class Outfit
Use a virtual field: http://book.cakephp.org/view/1608/Virtual-fields

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 24 Jan 2011, at 08:01, cake-learner wrote:

> I want to define the static function so that the user name ( firstname
> + lastname ) can be used everywhere in
> view.
> 
> Class User{
> 
> static function getName( $id ){
>  $userObj = $userObj -> read( 'id', $id );
>  return $userObj[ 'User' ][ 'firstname' ] . ' ' . $userObj[ 'User' ]
> [ 'lastname' ];
> }
> 
> }
> 
> and i just want to use
> 
> User::getName( $id );
> 
> somewhere in view;
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Proper MVC structure in CakePHP

2011-01-23 Thread Jeremy Burns | Class Outfit
I don't know - because in truth I don't really understand what you are trying 
to do - but this *sounds like* a complex solution to something that could be 
fairly simple. You really need to break your data pieces down and understand 
the relationships between them, then create tables around that model. Each 
table has a unique id field and fields that relate each row to its parent. Then 
you associate them in your models and everything becomes easy, integral and 
robust. Using composite key fields sounds like an admin nightmare, not very 
scalable and a fertile area for errors. I would imagine that if the tables 
aren't normalised you are going to get some very large records and then 
performance problems. Something like this:

books => chapters => paragraphs
books => authors

...ought to be your starting place. In your quotePara example, $id is always 
going to be the id of the record holding that paragraph. You can get to that 
from pretty much anywhere if your model associations are right; e.g:

>From the Book controller; $paragraph = 
>$this->Book->Chapter->Paragraph->getParagraph($id);

You can then pass $paragraph into a view and display it.

Coding can be by its very nature repetitive (some of which is replaced by 
components, behaviours and helpers) and is much easier to follow if you do, in 
fact, make good use of the right ids displayed throughout your app. Don't fight 
it.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 24 Jan 2011, at 04:53, websurfshop wrote:

> Thank you for the help on the database normalization, I will give it
> some more thought.  The book id field is actually a composite key that
> contains the book number, chapter number, and paragraph number, which
> can be exploded to decifer.  The entire book(s) will be in the
> database and I wanted to take advantage of mySQL full text search
> function, and at current it didn't make sense to start splitting
> tables for each book even those this is not currently normalized.
> 
> It would be really nice to be able to display a paragraph by simply
> calling;
> 
> echo $this->CustomHelper->quotePara($id);
> 
> without having to write a find query in a model, set the variable in
> the controller, then display the variable in the view everytime I want
> to display a paragraph on the website.  I am kinda new at this for
> sure (comp programming, PHP, cake, etc.)  as it's just a hobby.  Maybe
> there is no such animal.  I was hoping a custom helper/component/
> behavior whatnot would clean up my program making less repeat coding.
> In my custom helper I would also have functions to return the book
> title, chapter number, page number, paragraph number, etc., and format
> and link to view the source page, chapter, book, neighbors, etc.
> 
> Thanks for the help, things are becoming clearer as I think on it.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: See insert statements

2011-01-23 Thread Jeremy Burns | Class Outfit
If the id field is always set by the database (which it is as it's an 
auto-increment) I'd remove all validation from it.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 23 Jan 2011, at 01:07, cricket wrote:

> On Sat, Jan 22, 2011 at 7:22 PM, opike  wrote:
>> Sorry, meant to type "debug($this->validationErrors)"
>> 
>> and incidentally it is showing this now:
>> 
>> Array
>> (
>>[Alert] => Array
>>(
>>[id] => numeric
>>)
>> 
>> )
>> 
>> Does that mean cake is expecting a value to be submitted for the id
>> field? id is set to auto-increment.
> 
> Maybe. Does the Alert model have any validation rules? Specifically,
> for the id. If so, add 'allowEmpty' => true to that array.
> 
> Not sure why there's no message, though.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Hashed password displaying

2011-01-21 Thread Jeremy Burns | Class Outfit
Why bother with fancy logic? It's always going to be an obscure, meaningless 
set length string, so just display something like "" in the view.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 22 Jan 2011, at 00:46, eldorado2768 wrote:

> Okay, that makes sense. Now how do I make it blank in the view? Do I use the 
> set command in the controller?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Model query for controller to view results

2011-01-21 Thread Jeremy Burns | Class Outfit
Your order statement is incorrect. Try this instead:

array('order' => array('monthly_cost ASC'))

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 21 Jan 2011, at 08:34, OldWest wrote:

> I am continuing to get an SQL error, and my query is NOT working???
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check 
> the manual that corresponds to your MySQL server version for the right syntax 
> to use near 'order = ('asc') AND conditions = (1)' at line 1
> 
> Here is my code:
> 
> Plan Controller Method search()
> 
> function search() {
>   $this->Plan->recursive = 2; //*** Modified by Jason: Recursion 
> needs to be corrected with better method. ***//
>   $active = $this->Plan->getActive();
>   $this->set('plans', $this->paginate());
>   } // Trying to get $active to return to my results, but nothing is 
> happening at all except the above error and ALL results (query is not 
> effective).
> 
> Plan Model Method search()
> 
> function getActive() {
>   $conditions = array(
> 'limit' => 10,
> 'order' => array('monthly_cost' => 'asc'),
>   'conditions' => array('PlanDetail.active' => 1) // Gets all active=1 
> plan_details.
> );
>   return $this->find('all', compact('conditions'));
>}
> 
> Anyone know why this is not working?
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


<    4   5   6   7   8   9   10   11   12   13   >