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: Need Ajax Help

2011-01-23 Thread Ryan Schmidt

On Jan 24, 2011, at 00:39, andy_the ultimate baker wrote:

> i am trying to delete item using ajax,

Ok, what have you tried so far?

-- 
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


Need Ajax Help

2011-01-23 Thread andy_the ultimate baker
hi,
i m new with ajax.
i am trying to delete item using ajax,

can any one help me regarding ajax, this would be the great help for
me

thank u
andy

-- 
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 websurfshop
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


Re: Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread Zaky Katalan-Ezra
Never used myself but check this.
cakedc search plugin

-- 
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 statement as to appear replaced in views

2011-01-23 Thread Sam Sherlock
make your nav display links dependent on the action.

On 24/01/2011, chris...@yahoo.com  wrote:
> No cricket,... no,.. no,... there is no java issue that I have.
> All I want is to make a statement to hide "Create Resume" link when
> resume is created, and show links to "Edit Resume" and "Delete
> Resume" .
>
> Please,... anyone help...
>
> Thanks
> Chris
>
>
> On Jan 23, 4:21 pm, cricket  wrote:
>> On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com 
>> wrote:
>> > Hi guys,
>>
>> > I wanna to make a statement in ../views/resume/view.ctp
>>
>> > I have a table named: resume
>>
>> >  id     int(11)         UNSIGNED        No              auto_increment
>> >  user_id        int(11)                 Yes     NULL
>> >  name   varchar(120)    latin1_swedish_ci               No
>> >  content        text    latin1_swedish_ci               No
>>
>> > and in view... when resume is created, link to "Create Resume" will be
>> > replaced with "Edit Resume" and "Delete Resume"
>>
>> > How do I do that...?
>>
>> > What I have is manage to do is just a links:
>>
>> > 
>> >  link(ucfirst(__('create Resume', true)), '/resumes/
>> > create', array('class' => 'album'), false, false, false) ?>
>>
>> >     link(__('edit Resume', true), '/resumes/
>> > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false,
>> > false) ?>
>>
>> >     link(__('delete Resume', true), '/resumes/
>> > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false,
>> > false) ?>
>> > 
>>
>> This is a javascript issue; nothing to do with CakePHP.
>
> --
> 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
>


-- 
 - S

+44 (0)7908 069 219

-- 
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 statement as to appear replaced in views

2011-01-23 Thread Sam Sherlock
make your display link dependent on the action.

On 24/01/2011, chris...@yahoo.com  wrote:
> No cricket,... no,.. no,... there is no java issue that I have.
> All I want is to make a statement to hide "Create Resume" link when
> resume is created, and show links to "Edit Resume" and "Delete
> Resume" .
>
> Please,... anyone help...
>
> Thanks
> Chris
>
>
> On Jan 23, 4:21 pm, cricket  wrote:
>> On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com 
>> wrote:
>> > Hi guys,
>>
>> > I wanna to make a statement in ../views/resume/view.ctp
>>
>> > I have a table named: resume
>>
>> >  id     int(11)         UNSIGNED        No              auto_increment
>> >  user_id        int(11)                 Yes     NULL
>> >  name   varchar(120)    latin1_swedish_ci               No
>> >  content        text    latin1_swedish_ci               No
>>
>> > and in view... when resume is created, link to "Create Resume" will be
>> > replaced with "Edit Resume" and "Delete Resume"
>>
>> > How do I do that...?
>>
>> > What I have is manage to do is just a links:
>>
>> > 
>> >  link(ucfirst(__('create Resume', true)), '/resumes/
>> > create', array('class' => 'album'), false, false, false) ?>
>>
>> >     link(__('edit Resume', true), '/resumes/
>> > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false,
>> > false) ?>
>>
>> >     link(__('delete Resume', true), '/resumes/
>> > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false,
>> > false) ?>
>> > 
>>
>> This is a javascript issue; nothing to do with CakePHP.
>
> --
> 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
>


-- 
 - S

+44 (0)7908 069 219

-- 
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 statement as to appear replaced in views

2011-01-23 Thread chris...@yahoo.com
No cricket,... no,.. no,... there is no java issue that I have.
All I want is to make a statement to hide "Create Resume" link when
resume is created, and show links to "Edit Resume" and "Delete
Resume" .

Please,... anyone help...

Thanks
Chris


On Jan 23, 4:21 pm, cricket  wrote:
> On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com  
> wrote:
> > Hi guys,
>
> > I wanna to make a statement in ../views/resume/view.ctp
>
> > I have a table named: resume
>
> >  id     int(11)         UNSIGNED        No              auto_increment
> >  user_id        int(11)                 Yes     NULL
> >  name   varchar(120)    latin1_swedish_ci               No
> >  content        text    latin1_swedish_ci               No
>
> > and in view... when resume is created, link to "Create Resume" will be
> > replaced with "Edit Resume" and "Delete Resume"
>
> > How do I do that...?
>
> > What I have is manage to do is just a links:
>
> > 
> >  link(ucfirst(__('create Resume', true)), '/resumes/
> > create', array('class' => 'album'), false, false, false) ?>
>
> >     link(__('edit Resume', true), '/resumes/
> > edit/' . $resume['Resume']['id'], array('class' => 'edit'), false,
> > false) ?>
>
> >     link(__('delete Resume', true), '/resumes/
> > delete/' . $resume['Resume']['id'], array('class' => 'delete'), false,
> > false) ?>
> > 
>
> This is a javascript issue; nothing to do with CakePHP.

-- 
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 function for Controller :: how do I call it in the Controller?

2011-01-23 Thread Amit Badkas
Hi,

I already knew what you need and I can provide you the code but I think you
should refer http://book.cakephp.org/view/1231/Pagination and learn by
yourself how to use conditions, limit, order etc. for pagination.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Jan 21, 2011 at 11:19 PM, OldWest  wrote:

> I cannot resolve how to call a model function into a controller. I've been
> through too much documentation to count. Maybe I am wrong in what I am
> trying to do altogether? Continue to get MySQL errors.
>
> *Plan :: Model:*
>
> function getActive()
> {
> $findParameters = array(
> 'limit' => 10,
> 'order' => array('Plan.monthly_cost' => 'asc'),
> 'conditions' => array('PlanDetail.active' => 1) // Gets all
> active=1 plan_details.
> );
> return $this->find('all', $findParameters);
> }
>
> *Plan :: Controller:*
> *
> *
> 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(*$active*));
>  }
>
> *Notice* (8) 
> : Array 
> to string conversion [*ROOT*
>
> *Warning* (512) 
> : *SQL 
> Error:* 1054: Unknown column 'Plan' in 'where clause'
>
>
>  --
> 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.comFor
>  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: Integration with SAP

2011-01-23 Thread John Maxim
Hi Bapajan,

I asked the same question to integrate with SAS, one of the Cake team
developers has answered that it won't be anytime soon that this will
be developed, a "plugin". So I think it should be the same for SAP.
Even when they make it, then it won't be free because it's like a big
thing. I'm not sure of the others you mentioned.

Best,
John Maxim

On Jan 22, 3:03 pm, Bapajan  wrote:
> Hi,
> I intend to use CakePHP for our internal application development to
> address the following. I would be grateful to hear your advise /
> feedback / guidance on the same.
>
> - extract information from SAP and display the same to a group of
> users only. Is there any known SAP connector which works with CakePHP?
>
> - Is there any ticketing / helpdesk extension available for CakePHP?
> Or else is it possible to integrate other systems like OSTicket or
> eticketsupport? Please advise.
>
> Thank your time.
> Regards

-- 
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: Allow empty selection for relationship id (NULL)

2011-01-23 Thread Ryan Schmidt
Thanks, that works great, specifically:

echo $this->Form->input('some_id', array('empty' => ''));

But I wonder why the bake templates don't set that up properly for me, and how 
I could modify the bake templates to do so.


On Jan 19, 2011, at 07:41, sanjib dhar wrote:

> use array('options'=>$abc,'empty'=>true);
> 
> 
> On Wed, Jan 19, 2011 at 1:21 PM, Ryan Schmidt wrote:
>> 
> 
>> What should I do to allow NULL selections for some of my relationships?




-- 
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: .htaccess for https site

2011-01-23 Thread Ryan Schmidt
It sounds like what he's trying to do (or at least, what the snippet of rewrite 
rule he posted is supposed to do) is require the site be accessed only via 
https; if the site is accessed via http it would redirect to the corresponding 
https URL.


On Jan 23, 2011, at 17:58, Andras Kende wrote:

> The default .htaccess works fine for https site
> 
> What re ou trying to do ?



-- 
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 statement as to appear replaced in views

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 5:59 PM, chris...@yahoo.com  wrote:
> Hi guys,
>
> I wanna to make a statement in ../views/resume/view.ctp
>
> I have a table named: resume
>
>  id     int(11)         UNSIGNED        No              auto_increment
>  user_id        int(11)                 Yes     NULL
>  name   varchar(120)    latin1_swedish_ci               No
>  content        text    latin1_swedish_ci               No
>
> and in view... when resume is created, link to "Create Resume" will be
> replaced with "Edit Resume" and "Delete Resume"
>
> How do I do that...?
>
> What I have is manage to do is just a links:
>
> 
>  link(ucfirst(__('create Resume', true)), '/resumes/
> create', array('class' => 'album'), false, false, false) ?>
>
>     link(__('edit Resume', true), '/resumes/
> edit/' . $resume['Resume']['id'], array('class' => 'edit'), false,
> false) ?>
>
>     link(__('delete Resume', true), '/resumes/
> delete/' . $resume['Resume']['id'], array('class' => 'delete'), false,
> false) ?>
> 

This is a javascript issue; nothing to do with CakePHP.

-- 
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: ACL how controll more type of action?

2011-01-23 Thread Petr Vytlačil
I understand ACL logic and what is ACO etc...
But I thing this solution is stupid. Why I should setting premissions
(update,delete,save,add) for action deleteItems of some Controller.
Its sure I want only check if i can call deleteItems for this i dont
need check if i has premission for update, delete, etc. for this
action. .-)

Understand me?

Better solution:
I has controller Entries and methos deleteEntry, addEntry.
User role ADMIN has setting permission for ACO: Entries::deleteEntry
and Entries::addEntry

In app controller i check premission: $this->Acl->check(this-
>userRole, 'Entries::addEntry');
This is more simple and i dont need controll if users can read, save,
delete, add this action.



On Jan 12, 9:24 am, Andi  wrote:
> Hi,
>
> I think that you didn't understand the complex ACL logik. But it is
> really complex.
>
> The "actions" update, delete, save, add are the actions for the ACO.
> So the first question is: what is an ACO? It is an Access Control
> Object. Read here more about the 
> logic:http://book.cakephp.org/view/465/Understanding-How-ACL-Works
> So a typical ACO for CakePHP is a method of a controller.
> Example:
> Controller for Usergroups
> Methods:
> * add
> * delete
> * index
> * list
> * mygroups
> * admin
> * view
> Every Method is an ACO and for every ACO you can set the permissions
> update, delete, save, add.
>
> More Information about setting the 
> permissions:http://book.cakephp.org/view/648/Setting-up-permissions
>
> On 9 Jan., 22:18,PetrVytlaèil  wrote:
>
> > Hi in ACL you can controll only action (update, delete, save, add) It
> > is bad because app can has more other metod is any solutuion how
> > control access for other methor for example:
>
> > Controller Users
> > Function list(){
> >    ..
>
> > }
>
> > THX

-- 
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: ACL how controll more type of action?

2011-01-23 Thread Petr Vytlačil
I understand ACL logic and what is ACO etc...
But I thing this solution is stupid. Why I should setting premissions
(update,delete,save,add) for action deleteItems of some Controller.
Its sure I want only check if i can call deleteItems for this i dont
need check if i has premission for update, delete, etc. for this
action. .-)

Understand me?

Better solution:
I has controller Entries and methos deleteEntry, addEntry.
User role ADMIN has setting permission for ACO: Entries::deleteEntry
and Entries::addEntry

In app controller i check premission: $this->Acl->check(this-
>userRole, 'Entries::addEntry');
This is more simple and i dont need controll if users can read, save,
delete, add this action.



On Jan 12, 9:24 am, Andi  wrote:
> Hi,
>
> I think that you didn't understand the complex ACL logik. But it is
> really complex.
>
> The "actions" update, delete, save, add are the actions for the ACO.
> So the first question is: what is an ACO? It is an Access Control
> Object. Read here more about the 
> logic:http://book.cakephp.org/view/465/Understanding-How-ACL-Works
> So a typical ACO for CakePHP is a method of a controller.
> Example:
> Controller for Usergroups
> Methods:
> * add
> * delete
> * index
> * list
> * mygroups
> * admin
> * view
> Every Method is an ACO and for every ACO you can set the permissions
> update, delete, save, add.
>
> More Information about setting the 
> permissions:http://book.cakephp.org/view/648/Setting-up-permissions
>
> On 9 Jan., 22:18,PetrVytlaèil  wrote:
>
> > Hi in ACL you can controll only action (update, delete, save, add) It
> > is bad because app can has more other metod is any solutuion how
> > control access for other methor for example:
>
> > Controller Users
> > Function list(){
> >    ..
>
> > }
>
> > THX

-- 
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: .htaccess for https site

2011-01-23 Thread Andras Kende
The default .htaccess works fine for https site

What re ou trying to do ?

Andras Kende
http://www.kende.com

On Jan 23, 2011, at 3:22 PM, heh wrote:

> Hi,
> Noob user here.
> Can anyone guide me to an example of .htaccess setting for htts site?
> this is the default that cake have provided
> 
>  RewriteRule^$ app/webroot/[L]
>   RewriteRule(.*) app/webroot/$1 [L]
> 
> search some site and tgis group and find this recomendation
> 
> 
>  RewriteCond %{SERVER_PORT} !^80$
>   RewriteRule^$ https://localhost/sticker/app/webroot/[L]
>   RewriteRule(.*) https://localhost/sticker/app/webroot/$1 [L]
> 
> but the rewrite seems not working.
> 
> 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


php statement as to appear replaced in views

2011-01-23 Thread chris...@yahoo.com
Hi guys,

I wanna to make a statement in ../views/resume/view.ctp

I have a table named: resume

 id int(11) UNSIGNEDNo  auto_increment
 user_idint(11) Yes NULL
 name   varchar(120)latin1_swedish_ci   No
 contenttextlatin1_swedish_ci   No

and in view... when resume is created, link to "Create Resume" will be
replaced with "Edit Resume" and "Delete Resume"

How do I do that...?

What I have is manage to do is just a links:


  link(ucfirst(__('create Resume', true)), '/resumes/
create', array('class' => 'album'), false, false, false) ?>

 link(__('edit Resume', true), '/resumes/
edit/' . $resume['Resume']['id'], array('class' => 'edit'), false,
false) ?>

 link(__('delete Resume', true), '/resumes/
delete/' . $resume['Resume']['id'], array('class' => 'delete'), false,
false) ?>



Mucho Thanks in advance ... !!!
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


CakePHP + i18n + MongoDB

2011-01-23 Thread Salines
CakePHP + i18n + MongoDB

I want to hear your experience. Example code?

How to set up? 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


.htaccess for https site

2011-01-23 Thread heh
Hi,
Noob user here.
Can anyone guide me to an example of .htaccess setting for htts site?
 this is the default that cake have provided

  RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]

search some site and tgis group and find this recomendation


  RewriteCond %{SERVER_PORT} !^80$
   RewriteRule^$ https://localhost/sticker/app/webroot/[L]
   RewriteRule(.*) https://localhost/sticker/app/webroot/$1 [L]

but the rewrite seems not working.

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


Re: Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 12:58 PM, opike  wrote:
> I have a view that will potentially be displaying thousands of records
> and I want to add search/filtering controls to the top of the index
> view. I'm working with cake 1.3.7 and I did some preliminary research
> and it doesn't appear that 1.3.7 provides this type of functionality
> out of the box. A couple of questions:
>
> 1) Will version 2.0 include any enhancements in this area?
>
> 2) Are there any plugins or add on components that can be obtained
> that will add this functionality?
>
> 3) If I have to build it from scratch, I'm thinking that I will have
> to:
>  a) Add the necessary controls to index.ctp (duh)
>  b) add logic to the index() function in the controllers php to to
> filter the data (based off of the inputs from step a ) that ends up
> being passed to index.ctp.

You could do it with AJAX calls. Maybe add a $filters param to index

function index($filters = null)

$filters could then be checked for 'limit', 'search' keys, etc. which
would be passed depending on which filter request was made.

-- 
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 cricket
On Sun, Jan 23, 2011 at 3:00 PM, Jon Bennett  wrote:
>> Just be sure to use 'recursive' so as not to fetch all quotes when
>> doing a find('all') on book (ie. on the index page) when you only want
>> to list the book titiles, and quotes are unnecessary.
>
> A better idea would be to use the 'Containable' behaviour, as this
> allows you to get just the data you need.

Yes, that's what I'd do. I just wanted to to be more precise about the reason.

-- 
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: Plain SQL query in Pagination

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 11:16 AM, mmamedov  wrote:
> OK. This is getting weird.
> Now it works for custom query, but it doesn't work when I need default
> pagination for other actions of the same controller.
>
> The problem is however, with the overriding paginate() and
> paginateCount() - Cake 1.3 manual and the source code of both, are
> different.
>
> In Cake manual, http://book.cakephp.org/view/1237/Custom-Query-Pagination,
> it says:
>       function paginate($conditions, $fields, $order, $limit, $page =
> 1, $recursive = null, $extra = array()) { ... }
> But in the source code I see:
>       function paginate($object = null, $scope = array(), $whitelist
> = array()) { ...}
>
> So which one is it? And I also seem unable to find paginateCount()
> definition in source code (At least that's what Netbean's Find is
> uinable to find)

You're looking at the wrong class. Controller has a paginate() method,
but Model::paginate() will be called if it exists. Sorry, it's not
precise to say that you're overriding the method in the model. Better
to say that you're including it. Look at Controller::paginate again.
http://api.cakephp.org/view_source/controller/#line-1052

Line 1181 is where $scope gets folded into $conditions. Line 1197 is
where it checks if your model has a paginateCount() and calls it if
so. Line 1215 is where Model::paginate() is looked for.



> BTW, this is how I defined them in my model:
>
>     function paginate($conditions=null, $fields=null, $order=null,
> $limit=null, $page = 1, $recursive = null, $extra = array()) {
>             if (isset($conditions['sql']))
>             {
>                 $recursive = -1;
>                 $query = $conditions['sql'];
>                 unset($conditions['sql']);
>                $query .= ' LIMIT '.($page-1)*$limit.','.$limit;
>
>                 return $this->query($query);
>             }
>             else{
>                 return parent::paginate($conditions, $fields, $order,
> $limit, $page,$recursive, $extra);
>             }
>
>        }
>        function paginateCount($conditions = null, $recursive = 0,
> $extra = array()) {
>            if (isset($conditions['sql']))
>            {
>                $sql = $this->mmPaginateCount; //I assign this from
> controller, i need it this way.
>                $results = $this->query($sql);
>                return $results[0][0]['c'];
>            }
>            else{
>               return  parent::paginateCount($conditions, $recursive,
> $extra);
>            }
>
>        }
>
> And this is how I settup custom plain sql from controller before
> calling $this->paginate();
>
> $this->paginate=array(
>    'limit'=>Configure::read('Page.PostCount') //my appwide limit for
> posts
>    ,'conditions'=>array(
>           'sql' =>"my custom query"));
>
>
> Any thoughts?

If you're defining $paginate as a class var (outside of the action)
you could instead just change certain keys in $this->paginate, rather
than re-defining the entire array. Like limit, for example.

Also, the conditions could be defined within Model::paginate. If you
need to pass certain values you could do so in the $scope array in the
controller. As in your example:

$scope = array('union' => array('Friend.user_id' => 99));

$data = $this->paginate('hatever', $scope);

In the model:

if (exists($scope['union']))
{
$conditions = array_merge($conditions, $scope['union']);

This allows you to pass several params within one. You could even do
this in the controller:

$scope = array(
'union' => array(
'conditions' => array(
'Friend.user_id' => 99
),
'limit' => 10,
'order' => array(
'Friend.last_name' => 'ASC'
)
)
);

And then sort it out as necessary inside the model.

The 'union' key is arbitrary. It could be 'foo' or whatever.

-- 
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 Jon Bennett
> Just be sure to use 'recursive' so as not to fetch all quotes when
> doing a find('all') on book (ie. on the index page) when you only want
> to list the book titiles, and quotes are unnecessary.

A better idea would be to use the 'Containable' behaviour, as this
allows you to get just the data you need.

-- 
jon bennett - www.jben.net - blog.jben.net

-- 
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


Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread opike
I have a view that will potentially be displaying thousands of records
and I want to add search/filtering controls to the top of the index
view. I'm working with cake 1.3.7 and I did some preliminary research
and it doesn't appear that 1.3.7 provides this type of functionality
out of the box. A couple of questions:

1) Will version 2.0 include any enhancements in this area?

2) Are there any plugins or add on components that can be obtained
that will add this functionality?

3) If I have to build it from scratch, I'm thinking that I will have
to:
  a) Add the necessary controls to index.ctp (duh)
  b) add logic to the index() function in the controllers php to to
filter the data (based off of the inputs from step a ) that ends up
being passed to index.ctp.


Any comments or guidance is much appreciated...

-- 
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: Plain SQL query in Pagination

2011-01-23 Thread mmamedov
OK. This is getting weird.
Now it works for custom query, but it doesn't work when I need default
pagination for other actions of the same controller.

The problem is however, with the overriding paginate() and
paginateCount() - Cake 1.3 manual and the source code of both, are
different.

In Cake manual, http://book.cakephp.org/view/1237/Custom-Query-Pagination,
it says:
   function paginate($conditions, $fields, $order, $limit, $page =
1, $recursive = null, $extra = array()) { ... }
But in the source code I see:
   function paginate($object = null, $scope = array(), $whitelist
= array()) { ...}

So which one is it? And I also seem unable to find paginateCount()
definition in source code (At least that's what Netbean's Find is
uinable to find)

BTW, this is how I defined them in my model:

 function paginate($conditions=null, $fields=null, $order=null,
$limit=null, $page = 1, $recursive = null, $extra = array()) {
 if (isset($conditions['sql']))
 {
 $recursive = -1;
 $query = $conditions['sql'];
 unset($conditions['sql']);
$query .= ' LIMIT '.($page-1)*$limit.','.$limit;

 return $this->query($query);
 }
 else{
 return parent::paginate($conditions, $fields, $order,
$limit, $page,$recursive, $extra);
 }

}
function paginateCount($conditions = null, $recursive = 0,
$extra = array()) {
if (isset($conditions['sql']))
{
$sql = $this->mmPaginateCount; //I assign this from
controller, i need it this way.
$results = $this->query($sql);
return $results[0][0]['c'];
}
else{
   return  parent::paginateCount($conditions, $recursive,
$extra);
}

}

And this is how I settup custom plain sql from controller before
calling $this->paginate();

$this->paginate=array(
'limit'=>Configure::read('Page.PostCount') //my appwide limit for
posts
,'conditions'=>array(
   'sql' =>"my custom query"));


Any thoughts?

On Jan 23, 7:54 am, cricket  wrote:
> On Sat, Jan 22, 2011 at 11:52 PM, mmamedov  wrote:
> > OK I did it.
>
> Just to clarify one thing: In my example, the value of the array
> that's passed for $scope is irrelevant. The important thing is to
> check if the 'union' key is set in $conditions. But, if you need to
> pass any data keep in mind that the array value can be another array
> (possibly with many keys). So,
>
> $this->paginate('User', array('union' => array('foo' => 'bar')));

-- 
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


Complex Search

2011-01-23 Thread Steve

I have a database with the following tables.

book -  Holds id, title, description, publisher ...
author - Holds id, name
books_author - Holds id, book_id, author_id

So a many-to-many relationship on the book and author as one book can
have many authors and one author can have many books.

To search for books with a text field, I have the following function in
the Book model

/**
 * Build conditions to search books for a string of text.
 * @param string $search
 * @return array of books that contain the searched for text in their
database definition.
*/
function searchConditions( $search ) {
  $like = '%' . $search . '%';
  $conditions = array (
"OR" => array (
  "Book.isbn LIKE" => $like,
  "Book.ean LIKE" => $like, 
  "Book.name LIKE" => $like,
  "Book.description LIKE" => $like,
  "Book.publisher LIKE" => $like
)
  );
  return $conditions;
}

My BookContoller class calls this in the following manner :

/**
  Display books to user optionally filtered by search text. The text
  will have been stored in $this->search by the search() function.
*/
function index() {
  $this->Book->recursive = 1;
  if($this->search) {
$this->paginate = array(
  'limit' => 12,
  'order' => array('Book.created' => 'desc'),
  'conditions' => $this->Book->searchConditions($this->search));
  } else {
$this->paginate = array(
  'limit' => 12,
  'order' => array('Book.created' => 'desc'));
  }
  $this->set('books', $this->paginate('Book'));
}


Now...

How do I adapt the search to include the names of the books authors ?



-- 
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: Ordering by associated dates

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 4:56 AM, Toby G  wrote:
> Morning all,
>
> I'm a little stumped this morning, on how to sort a model's records
> based on the max value of it's associated (has many) dates.  Initially
> I used a find & then a sort, however I now need to paginate the
> results, so I need to be able to order the results as part of the
> paginated find.

If ModelA hasMany ModelB, and ModelB has some date column, how could
you possibly sort ModelA by those dates? That could only work if it
was a hasOne association.

ModelA (2 records)
id => 1
id => 2

ModelB (4 records):
id => 1
model_a_id => 1
date => '2010-01-01'

id => 2
model_a_id => 1
date => '2010-09-01'

id => 3
model_a_id => 2
date => '2010-06-01'

id => 4
model_a_id => 2
date => '2010-02-01'

Trying to order ModelA here by ModelB's date column couldn't work
because it would have to be done on an arbitrary ModelB record for
each ModelA record.

Or do you mean that you want to order ModelB by date within each
individual ModelA record?

ModelA => array(
0 => array(
id => 1
ModelB => array(
0 => array(
id => 1,
model_a_id => 1,
date => '2010-01-01'
),
1 => array(
id => 2,
model_a_id => 1,
date => '2010-09-01'
)
)
),
1 => array(
id => 2
ModelB => array(
0 => array(
id => 3,
model_a_id => 2,
date => '2010-02-01'
),
1 => array(
id => 4,
model_a_id => 2,
date => '2010-06-01'
)
)
)
);

Or maybe I haven't had enough coffee yet.

-- 
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: Whois with Cake?

2011-01-23 Thread Dave Maharaj
Right on. Thanks!

Gives me something to start with.

Dave

-Original Message-
From: Dr. Tarique Sani [mailto:tariques...@gmail.com] 
Sent: Sunday, January 23, 2011 7:10 AM
To: cake-php@googlegroups.com
Subject: Re: Whois with Cake?

There are a whole lot of free PHP scripts and classes which do a whois
lookup - just integrate one of those

You can start here
http://www.hotscripts.com/category/php/scripts-programs/networking-tools/who
is/

HTH
Tarique

On Sun, Jan 23, 2011 at 2:46 PM, Dave Maharaj  wrote:
> Does anyone know of or if there is a API or site that can take a query of
a
> domain name and return the administrative email for that domain?
>
>
>
> For example when you buy an SSL certificate online you type in the site
url
> and they return you a list of emails top one being the email associated
with
> the domain as admin contact / tech contact. I am looking for something
> similar and free.
>
>
>
> Thanks anyone
>
>
>
> 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
>



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
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: Proper MVC structure in CakePHP

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 5:09 AM, Zaky Katalan-Ezra  wrote:
> Why do you need to save the paragraphs in the database at all?
> You are going to have a huge database.
> 1.If you are building a search engine consider a different design like
> saving words and the words line/position reference in each book.
> 2.Cache results for each word search or something like this.

It's not about search. The paragraphs need to be displayed individually.

I'd create a single table, books:

id
title
subtitle
author_id (if there's an authors table)

Then another table, quotes

id
book_id
chapter
paragraph_num (if necessary)
content

Assuming you're not storing *every* paragraph of each book, you could
then do a find on a particular book and have each quote included in
the data. The Quote model can be ordered by chapter and paragraph_num.
Only use a helper to do the display formatting, if at all. You could
have a method that takes as params the data, the chapter number, and
paragraph number, grabs the appropriate quote, and echoes the
marked-up content.

Just be sure to use 'recursive' so as not to fetch all quotes when
doing a find('all') on book (ie. on the index page) when you only want
to list the book titiles, and quotes are unnecessary.

-- 
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: Problem with copeied folder

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 8:39 AM, Gopinath T.M  wrote:
> its contain view,model an persistent...which one i have to delete.?

It's fine to do them all. Just keep the directories themselves.

-- 
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: Plain SQL query in Pagination

2011-01-23 Thread cricket
On Sat, Jan 22, 2011 at 11:52 PM, mmamedov  wrote:
> OK I did it.

Just to clarify one thing: In my example, the value of the array
that's passed for $scope is irrelevant. The important thing is to
check if the 'union' key is set in $conditions. But, if you need to
pass any data keep in mind that the array value can be another array
(possibly with many keys). So,

$this->paginate('User', array('union' => array('foo' => 'bar')));

-- 
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: Problem with copeied folder

2011-01-23 Thread Gopinath T.M
its contain view,model an persistent...which one i have to delete.?

On Sun, Jan 23, 2011 at 7:06 PM, Steve  wrote:

> The Cached files are in the /tmp/cache directory of your
> application.
>
> On Sun, 2011-01-23 at 18:57 +0530, Gopinath T.M wrote:
> > how do i clear cache on cakephp?
> >
> > On Sun, Jan 23, 2011 at 11:52 AM, Dr. Loboto 
> > wrote:
> > You must clear caches on copying.
> >
> >
> > On 22 янв, 13:07, "Gopinath T.M" 
> > wrote:
> > > i am working cakephp application.
> > >
> > > that folder name(application foldername) - sample
> > >
> > > This is orginal url of application
> > -http://prog.appps.com/sample
> > >
> > > i like to maintain this application also another url
> > -http://prog.appps.com/sample1
> > >
> > > i just simply copy the sample to sample1...
> > >
> > > Actually, here my problem is whatever i make change on
> > sample folder
> > > it also reflecting in sample1.
> > >
> > > So i should happened like 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.comFor
> >  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.comFor
> >  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.comFor
>  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


Re: Problem with copeied folder

2011-01-23 Thread Steve
The Cached files are in the /tmp/cache directory of your
application. 

On Sun, 2011-01-23 at 18:57 +0530, Gopinath T.M wrote:
> how do i clear cache on cakephp?
> 
> On Sun, Jan 23, 2011 at 11:52 AM, Dr. Loboto 
> wrote:
> You must clear caches on copying.
> 
> 
> On 22 янв, 13:07, "Gopinath T.M" 
> wrote:
> > i am working cakephp application.
> >
> > that folder name(application foldername) - sample
> >
> > This is orginal url of application
> -http://prog.appps.com/sample
> >
> > i like to maintain this application also another url
> -http://prog.appps.com/sample1
> >
> > i just simply copy the sample to sample1...
> >
> > Actually, here my problem is whatever i make change on
> sample folder
> > it also reflecting in sample1.
> >
> > So i should happened like 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
> 
> 
> 
> 
> -- 
> 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: Problem with copeied folder

2011-01-23 Thread Gopinath T.M
how do i clear cache on cakephp?

On Sun, Jan 23, 2011 at 11:52 AM, Dr. Loboto  wrote:

> You must clear caches on copying.
>
> On 22 янв, 13:07, "Gopinath T.M"  wrote:
> > i am working cakephp application.
> >
> > that folder name(application foldername) - sample
> >
> > This is orginal url of application -http://prog.appps.com/sample
> >
> > i like to maintain this application also another url -
> http://prog.appps.com/sample1
> >
> > i just simply copy the sample to sample1...
> >
> > Actually, here my problem is whatever i make change on sample folder
> > it also reflecting in sample1.
> >
> > So i should happened like 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.comFor
>  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


Re: Whois with Cake?

2011-01-23 Thread Dr. Tarique Sani
There are a whole lot of free PHP scripts and classes which do a whois
lookup - just integrate one of those

You can start here
http://www.hotscripts.com/category/php/scripts-programs/networking-tools/whois/

HTH
Tarique

On Sun, Jan 23, 2011 at 2:46 PM, Dave Maharaj  wrote:
> Does anyone know of or if there is a API or site that can take a query of a
> domain name and return the administrative email for that domain?
>
>
>
> For example when you buy an SSL certificate online you type in the site url
> and they return you a list of emails top one being the email associated with
> the domain as admin contact / tech contact. I am looking for something
> similar and free.
>
>
>
> Thanks anyone
>
>
>
> 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
>



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
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


Re: how to change

2011-01-23 Thread Ryan Schmidt
On Jan 23, 2011, at 04:09, Ahmed - CakePHP wrote:

> I want to change the  page of a website
> Here
> 
> but I don't know from where exactly

Well, the title tag is usually to be found in the layout. If setting up a new 
CakePHP 1.3 web site, you would generally have your layout file at 
APP/views/layouts/default.ctp. Look for the title tag there. Or, if there isn't 
a default.ctp there, see if there are any other layouts in that directory that 
might have the title tag you're looking for.


-- 
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: Querying the database in a view

2011-01-23 Thread Steve
I completely agree with what clearflysystems says... even the Js (Ajax)
helper does not break this convention since it usually collects its data
to display from a controller action.

The Model/View/Controller pattern is a very well documented pattern
which attempts to separate data, control and display functionality. If
code does not stick to this design then there seems little point in
using an MVC framework in the first place.

On Sat, 2011-01-22 at 07:19 -0800, clearflysyst...@googlemail.com wrote:
> But what about when it breaks and you or someone else has to fix it
> and you can't remember what you did and where?
> 
> Conventions are there for a reason, frameworks are designed to help
> you code efficiently but only work efficiently when you follow those
> conventions.
> 
> Helpers are View Helper Classes for manipulating the Display of data
> passed to them from the Controller.
> 
> All you need is something like this in your controller:
> $this->set('myoptions', $this->MyModel->find('list') );
> http://book.cakephp.org/view/1022/find-list
> 
> Then in your View
> echo $this->Html->input('SelectboxName', array('options' =>
> $myoptions) );
> 
> 
> 
> On Jan 21, 7:35 pm, Unflexible  wrote:
> > 2011/1/21 AD7six :
> >
> > > On Jan 21, 12:35 am, Unflexible  wrote:
> > > Hideous.
> >
> > Sure, but it works
> 


-- 
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 change

2011-01-23 Thread Tilen Majerle
if i understand you good, then you want to change on every page the title?

if so, then do this in controller:

function somemethod()
{
$this->set('title_for_layout', 'YourTitle');
}


then in a layout



--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/1/23 Ahmed - CakePHP 

>
> Hello,
>
> I want to change the  page of a website
> Here
>
> but I don't know from where exactly
>
> It is not my website. It my friend's website.
> Someone developed the website for him two years ago and now he asked
> me to change the title name.
> I tried to check the /View and /Elements but I don't know where is it
> and how to change it
>
>
> Can you please tell me how can I change it
>
>
>
> Thank you
>
> --
> 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.comFor
>  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: making an online exam module

2011-01-23 Thread Zaky Katalan-Ezra
Take a look at http://www.limesurvey.org/
Versio 2.0 is in beta LimeSurvey
2.0-betaand
its cakephp based

-- 
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


how to change

2011-01-23 Thread Ahmed - CakePHP

Hello,

I want to change the  page of a website
Here

but I don't know from where exactly

It is not my website. It my friend's website.
Someone developed the website for him two years ago and now he asked
me to change the title name.
I tried to check the /View and /Elements but I don't know where is it
and how to change it


Can you please tell me how can I change it



Thank you

-- 
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 Zaky Katalan-Ezra
Why do you need to save the paragraphs in the database at all?
You are going to have a huge database.
1.If you are building a search engine consider a different design like
saving words and the words line/position reference in each book.
2.Cache results for each word search or something like 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


Re: Getting recursive user data via Auth

2011-01-23 Thread Yaron
Yep, that's awesome! thanks!

On Jan 23, 11:39 am, Azril Nazli  wrote:
> Wicked cool :D
>
> cricket wrote:
> > On Sat, Jan 22, 2011 at 3:53 PM, Yaron  wrote:
> > > Hi,
> > > Suppose I a users table, a groups table, and every user belongs to a
> > > group. I'd like via the app_controller to get the group's name, in
> > > order to set it in the view.
> > > I've used the following code in app_controller.php:
> > > function beforeRender(){
> > >        $this->loadModel('Group');
> > >        $group = $this->Group->find('id = ' . 
> > > $this->Auth->user('group_id'));
> > >        $this->set('groupName', $group['Group']['name']);
> > > }
>
> > > This code works great, but is there another way than using the
> > > loadModel method? thanks.
>
> > You can grab the name from within login() and store it in the session.
> > Assuming you have $this->Auth->autoRedirect = false in
> > AppController::beforeFilter() ...
>
> > public function login()
> > {
> >    if ($user = $this->Auth->user())
> >    {
> >            $this->User->Group->id = $this->Auth->user('group_id');
>
> >            $this->Session->write(
> >                    'Auth.User.group_name',
> >                    $this->User->Group->field('name')
> >            );
>
> >            $this->redirect($this->Auth->redirect());
> >    }
> > }
>
> > Then you can get the name from within a controller:
> > $this->Auth->user('group_name');
>
> > ... or view:
> > $this->Session->read('Auth.User.group_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


Ordering by associated dates

2011-01-23 Thread Toby G
Morning all,

I'm a little stumped this morning, on how to sort a model's records
based on the max value of it's associated (has many) dates.  Initially
I used a find & then a sort, however I now need to paginate the
results, so I need to be able to order the results as part of the
paginated find.

Anyone offer any clues on this one?  I know it's probably possible
using a custom SELECT statement, but my SQL is a little rusty at the
moment.

Thanks for any help,

T

-- 
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 recursive user data via Auth

2011-01-23 Thread Azril Nazli

Wicked cool :D
cricket wrote:
> On Sat, Jan 22, 2011 at 3:53 PM, Yaron  wrote:
> > Hi,
> > Suppose I a users table, a groups table, and every user belongs to a
> > group. I'd like via the app_controller to get the group's name, in
> > order to set it in the view.
> > I've used the following code in app_controller.php:
> > function beforeRender(){
> >        $this->loadModel('Group');
> >        $group = $this->Group->find('id = ' . $this->Auth->user('group_id'));
> >        $this->set('groupName', $group['Group']['name']);
> > }
> >
> > This code works great, but is there another way than using the
> > loadModel method? thanks.
>
> You can grab the name from within login() and store it in the session.
> Assuming you have $this->Auth->autoRedirect = false in
> AppController::beforeFilter() ...
>
> public function login()
> {
>   if ($user = $this->Auth->user())
>   {
>   $this->User->Group->id = $this->Auth->user('group_id');
>
>   $this->Session->write(
>   'Auth.User.group_name',
>   $this->User->Group->field('name')
>   );
>
>   $this->redirect($this->Auth->redirect());
>   }
> }
>
> Then you can get the name from within a controller:
> $this->Auth->user('group_name');
>
> ... or view:
> $this->Session->read('Auth.User.group_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


Whois with Cake?

2011-01-23 Thread Dave Maharaj
Does anyone know of or if there is a API or site that can take a query of a
domain name and return the administrative email for that domain?

 

For example when you buy an SSL certificate online you type in the site url
and they return you a list of emails top one being the email associated with
the domain as admin contact / tech contact. I am looking for something
similar and free.

 

Thanks anyone 

 

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