Re: Dynamic swiching of layout in controller

2006-04-04 Thread Samuel DeVore

I usually do something like this

$data = $this-Page-read();
// do stuff with data array

$this-set('data',$data);



On 4/4/06, mikis [EMAIL PROTECTED] wrote:

 Hello, I'd like to switch layouts on the fly, based on record in the
 database. To explain:

 There are two simple classes, Pages and Categories, where each Page
 belongs to Category (and Category $hasMany Pages). Each Category has
 different layout . I've managed to call it from Pages controller using
 this:

 ?php
 class PagesController extends AppController {
   var $name = 'Pages';

   function show ( $id )   {
 $this-set('data', $this-Page-Read());
 $this-layout = $this-_viewVars['data']['Category']['template'];
// where category.template = template1 | template2 | template3...
 and in /views/layouts there are files template1.thtml, template2.thtml,
 template3.thtml...
   }
 }
 ?

 But there must be a more elegant way to access data returned by Read()
 or FindAll() methods?


 


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



Re: How do I create a variable in the view to use in the layout?

2006-04-06 Thread Samuel DeVore
On 4/6/06, brandags [EMAIL PROTECTED] wrote:
@Samuel: Does that mean that if I wanted a special title for my staticpages, I'd need to create an action for them in the pages controller?Or hard code the title into the display() function of the pages
controller?Is just seems that titles other static display variableswould be best if they could be set in the view for each page. What doesthat have to do with logic? Am I the only one that thinks this way?
You can use ?php $this-pageTitle = the title you want; ?in the view file (could be a /pages/item.thtml)then in the layout you use?php echo($title_for_layout); ?
where you want the title

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


Re: how can I change current requested action?

2006-04-09 Thread Samuel DeVore

$this-requestAction() might help here
look in manual

Sam D

On 4/9/06, Alexey Baranovskiy [EMAIL PROTECTED] wrote:

 I need to change requested action.
 For example: User requested this url - www.domain.com/articles/edit/1,
 but he isn't authorised. I need to change action edit to action
 denied? How can I do that?


 


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



Re: Form validation w/out a model?

2006-04-09 Thread Samuel DeVore
I did it like this ?phpclass Contact extends AppModel{ var $name = 'Contact'; var $validate = array('email'=VALID_EMAIL, 'name'=VALID_NOT_EMPTY,'text'=VALID_NOT_EMPTY,'regards'=VALID_NOT_EMPTY);
 var $useTable = false;}?the $useTable means that it doesn't connect to the db and I can use the validation stuff that waythen in the controller rather then testing $this-ModelName-save() I do 
$this-Contact-validates($this-params['data'] )Works for me ;)Sam DOn 4/9/06, guice666 
[EMAIL PROTECTED] wrote:Looked through the tutorials, trying to do it through a form with no
success. Is there a way to run form validation w/out the requirement ofa model?I have a contact form that is not connected to any database model thatI need to run validation against the inputted values before sending it
off. So far the only auto validation I can see is done through themodel level. Since this class doesn't hit the model level, I don't knowhow else to run an auto validation check. So I have to check all values
manually?Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: How I change the layout of the home.thml

2006-04-10 Thread Samuel DeVore
You can take the pages_controller from libs/controller and put a copy in your app/controller directory then from there you can set layout for particular 'pages' based on a set of rules. Or if you make your own app_controller.php in your app you can set the layout there for pages as well
Sam DOn 4/10/06, Wasenbr [EMAIL PROTECTED] wrote:
The question is: how I change the layout of the any view of thePagesController without change the pages_controller.php page ofcake/libs/controller dir?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Help with how to do a query

2006-04-12 Thread Samuel DeVore

I would set DEBUG to 2 in core.php and see if the query is creating an
error and start from there.

Sam D

On 4/12/06, spacedz [EMAIL PROTECTED] wrote:

 I'm designing my site and at the moment all news is posted via the
 phpBB forum; the main site just pulls out the right stuff and replies
 show up as comments.

 The problem is I'm finding it impossible to use Cake for everything and
 then continue to do this using its built in db handling. This is the
 query I'd like to do:

 SELECT DISTINCT phpbb_topics.topic_id, topic_title, post_text FROM
 phpbb_topics INNER JOIN phpbb_posts ON
 (phpbb_posts.topic_id=phpbb_topics.topic_id) INNER JOIN
 phpbb_posts_text ON (phpbb_posts_text.post_id=phpbb_posts.post_id)
 WHERE phpbb_topics.forum_id=17 GROUP BY phpbb_topics.topic_id ORDER BY
 topic_time DESC LIMIT 0,19

 I've got the phpBB db listed in the Cake db file and am assigning it in
 the model, however findBySql() is no longer supported and query() just
 returns true or false. Neither are documented in the API. Is there
 another option?

 How would you suggest running the above query and getting the data set?

 Cheers.


 


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



Re: How to get data from forms?

2006-04-20 Thread Samuel DeVore
look in the $this-params['data'] try using pr(); a shortcut for print_r or you can now use $this-data, if you need the name of the button pushed you can also look in $this-params['form']Sam D
On 4/20/06, Ashley [EMAIL PROTECTED] wrote:
Hi all!I've just been introduced to Cake world! But I have some problems inunderstanding how the framework handles the data from forms. I've donea simple model 'User' (username  password as attributes), and then
I've created a controller with:* an 'index' action that displays a login form* a 'login' action that does the login (not implemented yet ;)I currently have problems because I can't understand how data passing
is handled by the framework! How can I refer to parameters from thelogin form in the login action?This is the index.thtmlh1Login/h1
?php echo $html-formTag('/users/login')?pUsername: ?php echo $html-input('User/username', array('size'= '40'))??php echo $html-tagErrorMsg('User/username', 'Username is
required.') ?/ppPassword:?php echo $html-password ('User/pass', array('size'= '40')); ??php echo $html-tagErrorMsg('Users/pass', 'Password isrequired.') ?/p
p?php echo $html-submit('Login') ?/p/form=How can I refer to the params from here in the login action function?
I'm getting mad, I've read all the manuals and the blog tutorial but Istill can't figure it out .Thank you for your attention, and keep up the great work!:*
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: No scaffolding from fresh install !!

2006-04-25 Thread Samuel DeVore

my guess is that the server doesn't have AllowOverride All set for
your directory
or are you on IIS?

On 4/25/06, Dusty [EMAIL PROTECTED] wrote:

 Hi all,

 I am testing out cakePHP and am having problems getting
 scaffolding to work from a fresh install version
 cake_0.10.9.2378_finalcake_0.10.9.2378_final.

 I have the database and tables set up correctly and I have
 the model and controllers set up correctly.  The only way
 I can get scaffolding to work is turn off mod rewrite
 and turn on pretty Urls in core.php.  Then I can get it to
 work with the link http://cake1.localhost/index.php/users
 but it does not save any of the files in the view to the
 filesystem, they are only generated in the browser.  All the functions
 work (CRUD) but nothing is saved to the web site.  IT will not work
 from the
 url http://cake1.localhost/users like it is supposed to either.
 If I turn on mod rewrite and un comment pretty Urls then scaffolding
 will not work at at all.  According to the examples I have seen this
 should be easy but for some reason its not working for me.  I suspect
 the problem has something to do with either mod rewrite or a path
 misconfiguration.  Can anyone offer any advice.  Has anyone had the
 same problem ??

 --thanx
 --dusty


 


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



Re: No scaffolding from fresh install !!

2006-04-25 Thread Samuel DeVore

Have you tried changing the mod rewrite stuff to something really
simple like a redirect just to see if that part is getting called.  It
does seem that your issue is that the mod rewrite is not working, if
you have access the the server config maybe try turning up the
loggging for mod rewrite and see if you can get any insight
 Or get on the irc channel and ask some of the big brains there

Sam D
On 4/25/06, Dusty [EMAIL PROTECTED] wrote:

 Samuel,

 Yes I do have AllowOverride All in the
 apache httpd..conf.  I know it is not file
 permissions either because I opened the
 right up on the devel server I am using.
 I am not sure where else to start looking.

 --thanx


 


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



Re: observeForm

2006-04-26 Thread Samuel DeVore
you should open a ticket with the fix! https://trac.cakephp.org/ so it can get includedOn 4/26/06, sinyo
 [EMAIL PROTECTED] wrote:
hahaha, finally i can help myself to useAjaxHelper::observeForm :)but i make a little bit change infile/cake/libs/view/helpers/ajax.phpline 411$options['with'] = 'Form.serialize(this.form)';
be:$options['with'] = 'Form.serialize('.$field_id.')';--sinyo

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


Re: Scriptaculous Effects

2006-05-01 Thread Samuel DeVore
Sorry hit send too fast?php echo $ajax-link(Final, /job_materials/release/{$JobMaterial['JobMaterial']['id']},array(update = form-target, url = /bare/job_materials/release/{$JobMaterial['JobMaterial']['id']},'complete'=new 
Effect.Appear('form-target');)); ?here is an example from an old thingso where I have complete, you can also have loading, before, etcOn 5/1/06, 
Samuel DeVore [EMAIL PROTECTED] wrote:
it's an easy taskOn 5/1/06, immure [EMAIL PROTECTED] wrote: Hi bakers, Was just wondering (after searching google for some time) if there was
 an easy way to use the scriptaculous effects with the ajax helper? I want one of my $ajax-links to fade out an old item, and load the new.. is this going to be an easy task, or am I in for the long haul?
 Cheers, Mike (P.S. If this seems frivilous, then at least any answers will show up on google and people won't need to search..) 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: List files in a directory

2006-05-03 Thread Samuel DeVore
you can also look in the http://api.cakephp.org/ at the Folder classyou might find that Folder::ls would be helpfulSam DOn 5/3/06, 
RosSoft [EMAIL PROTECTED] wrote:
check this?php$dirname=ROOT .DS.'vendors' . DS;$dh= opendir($dirname);$files=array();while (false !== ($entry= readdir($dh))){if ( $entry!= '..'  $entry!= '.')
{ $files[]=$entry;}}print_r($files);?

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


Re: List files in a directory

2006-05-03 Thread Samuel DeVore
So at the top of the controller you could douses('folder','file'); // loads the classes for Folder and Filethen in the controller to get an array of readable folders in a path you could do$path = WWW_ROOT.DS.'dev'.DS.'birdlists'.DS.$filename;
$folder = new Folder($path);$ls = $folder-ls();foreach ($ls[1] as $filename) { $file = new File ($path.DS.$filename); if ($file-readable()) { $listForDisplay[$filename] = $path.DS.$filename;
 }}On 5/3/06, Atkati [EMAIL PROTECTED] wrote:
I can't understand how to use the Folder class...Can you tell me how to use it or a place where it is explained ?

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


Re: findAll() when used with order parameter returns nothing

2006-05-03 Thread Samuel DeVore

try upping the debug setting in config/core.php to 2 and see if any
sql errors are reported.

On 5/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 I'm pretty new to CakePHP (just got it yesterday) and I was following
 along with the second blog tutorial
 [http://wiki.cakephp.org/tutorials:blog_tutorial_-_2] and the recent
 posts page wasn't working for me. I was getting a PHP error (not cake)
 that said I used an invalid argument in my foreach() loop. Which goes
 along with the following line from the tutorial:

 foreach ($RecentPosts as $Post):

 which is placed within the recent_posts.thtml view element file. What
 seems to be happening is when the tutorial says to use the findAll()
 method of the Post controller and if an order is specified, my results
 come out blank, which causes the foreach() loop to fail.

 Here are the parameters to use as per the tutorial:

 $data = $Post-findAll(
 null,
 null,
 'modified DESC',
 $number
 );

 Which doesn't return anything, print_r($data) returns blank. However,
 if I null out the order parameter, the page works and displays the
 posts (but they're obviously not ordered).

 $data = $Post-findAll(
 null,
 null,
 null,
 $number
 );

 That works. I've tried playing around with the string and all sorts of
 things keep failing DESC modified modified ASC id DESC id ASC
 and so on. The columns in the database are set up correctly, so I'm not
 sure what's wrong...

 Any one have an idea?


 


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



Re: Extending the blog tutorial to include login?

2006-05-05 Thread Samuel DeVore
I think the plan for the cake bakery tutorial is to include this. https://trac.cakephp.org/wiki/BuildingCakeBakery
On 5/5/06, Carlos Mauricio Samour [EMAIL PROTECTED] wrote:
I would like help in what skills should I learn before building alogin authentication features in my cake apps. Thanks!On 5/5/06, roberts.sean [EMAIL PROTECTED]
 wrote: The blog tutorial was great, but I think it left out a crucial step: securing it from malicious users who want nothing more than to make a series of hahaha lol owned you posts on your blog.The section in
 the manual on ACL was interesting, but it said that you should already have your own user authentication setup.The rdAuth tutorial in the Wiki was confusing at best. Does anyone know of a tutorial that extends the blog tutorial to
 include a minimal amount of security?I've gotten as far as writing a small script to determine whether or not a user's login credentials are any good, but when it comes down to making this persistent among my
 pages I'm pretty lost! If anyone knows of a tutorial like this, or can explain to me how I would go about maintaining a persistent logged in status for a user among different models and controllers I would really appreciate it.
 Thanks! 

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


Re: live preview textile rendering?

2006-05-06 Thread Samuel DeVore
Probably what you need is to add a an ajax-observeField call in the thtml to watch the field for changes and use that to call an action that generates a preview and places the result of the ajax call in the div.
On 5/6/06, Jeroen Janssen [EMAIL PROTECTED] wrote:
Hi,Is there a tutorial that shows howto do something like a live previewof a textile rendering. I would like to have something similar that thetypo (rails blog) does when entering a new article.
Basicly I think it works like the following (but I have no idea yet howto do this in CakePHP):1) a form with a title and a content field2) if someone enters text in title or content, an ajax request is send
to the server with the current entered information3) the server parses the content through textile and combines this withthe title in something that gets send back to the browser4) the browser renders the information from the server in a seperate
divNow, since I already have an element that renders a singletitle/content combination, is this something I can reuse for step 3?Best regards,Jeroen Janssen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Switching associations on and off

2006-05-09 Thread Samuel DeVore
you should look in the api for the bindModel and unbindModel methods for the model, I think it is what you are looking for, it's a little cleaner and the reset after you use them
http://api.cakephp.org/class_model.htmldoesn't seem to be in the manual yet, but there was a page in the wikiSam DOn 5/9/06, BCN Adam
 [EMAIL PROTECTED] wrote:Hullo,
I am basically posting the same question as thirdleaf on 2006-01-01 tosee if there is any more news or information.I have two tables 'foo' and 'bar', which are joined by a HABTMrelationship with the table 'foo_bar'.
Sometimes I would like to use these associations, and sometimes not.At the moment I am putting the following in foo_controller.php (someexamples):$this-Foo-hasAndBelongsToMany = null;
$data = "">to disactivate this particular association, or$this-Foo-hasAndBelongsToMany['Bar']['limit'] = 5;$data = "">to set a special limit first 5 condition.
Is there a better or different way of doing this?Regards,AdamPS:I have been using CakePHP for about a year now and this is myfirst post to the Google group. Congrats and thanks to all who have
been involved in this project. Keep up the good work!

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


Re: Cake Nightly 10_05 problems

2006-05-11 Thread Samuel DeVore
It seems to me that you did not update the contents of your app/core folder? in particular the inflector.php file in core/On 5/11/06, Dusty 
[EMAIL PROTECTED] wrote:Larry,I was wrong, there is still a problem.As I said in my first post
everything works with the stable build.Here is my currenterror.I have not change any code whatsoever in the app directly fromthe stable to the cake_nightly_10_05.1.xxNotice: Undefined variable: uninflectedSingular in
/var/www/html/maxmympg/cake/libs/inflector.php on line 251Notice: Undefined variable: irregularSingular in/var/www/html/maxmympg/cake/libs/inflector.php on line 252Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at/var/www/html/maxmympg/cake/libs/inflector.php:251) in/var/www/html/maxmympg/cake/libs/session.php on line 134Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at/var/www/html/maxmympg/cake/libs/inflector.php:251) in/var/www/html/maxmympg/cake/libs/session.php on line 134Notice: Undefined variable: uninflectedSingular in/var/www/html/maxmympg/cake/libs/inflector.php on line 251
Notice: Undefined variable: irregularSingular in/var/www/html/maxmympg/cake/libs/inflector.php on line 252Any help or advice would be appreciated !!--thanx--dusty
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Database retrieval problem

2006-05-14 Thread Samuel DeVore
I would make sure that in the controller class and in the model you define the $name varlike var $name = 'Tryout';in the model andvar $name = 'Tryouts';in the controller
On 5/14/06, moob [EMAIL PROTECTED] wrote:
Hi,I just installed CakePHP 1.0.1.2708 and followed the blog tutorial toget an idea of what CakePHP is all about. Although installation and theblog tut. went fine, I cannot get any data from the database. I do not
get any errors.After setting the debug level to 3, I see that the variable that shouldcontain the data retrieved from the database is empty. A test variablewhich I created in the controller, $this-set('tryout',This is a
test); can be viewed in the view via 'echo Tryout is .$tryout'. Noproblem here.Connecting via the commandline to the database and performing a queryon it, as the user configured in CakePHP, works.
Is it because this version of CakePHP only works with PHP5 ? (still usePHP4 myself)RegardsMoob

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


Re: Database retrieval problem

2006-05-14 Thread Samuel DeVore
This is noted in the manualin the tutorialhttp://manual.cakephp.org/chapter/18and the sections for controller and model
http://manual.cakephp.org/chapter/6 and http://manual.cakephp.org/chapter/7On 5/14/06, Samuel DeVore
 [EMAIL PROTECTED] wrote:I would make sure that in the controller class and in the model you define the $name var
like var $name = 'Tryout';in the model andvar $name = 'Tryouts';in the controller
On 5/14/06, moob [EMAIL PROTECTED] wrote:

Hi,I just installed CakePHP 1.0.1.2708 and followed the blog tutorial toget an idea of what CakePHP is all about. Although installation and theblog tut. went fine, I cannot get any data from the database. I do not
get any errors.After setting the debug level to 3, I see that the variable that shouldcontain the data retrieved from the database is empty. A test variablewhich I created in the controller, $this-set('tryout',This is a
test); can be viewed in the view via 'echo Tryout is .$tryout'. Noproblem here.Connecting via the commandline to the database and performing a queryon it, as the user configured in CakePHP, works.
Is it because this version of CakePHP only works with PHP5 ? (still usePHP4 myself)RegardsMoob




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


Re: Unable to Load Controller with Ajax task list Tutorial by Graham Bird

2006-05-14 Thread Samuel DeVore
what is the name of the file? is it tasks_controller.php?On 5/14/06, Reggie [EMAIL PROTECTED]
 wrote:I'm trying the Ajax task list tutorial at
http://grahambird.co.uk/cake/tutorials/ajax.php.However, I am getting the following error when trying to load it:Fatal: Unable to load controller TasksControllerFatal: Create Class:?php
class TasksController extends AppController{}?I've copied and pasted the example, and even downloaded the example butstill get the same error. I have 2 programs already working on this
Cake installation so I don't think there are any problems there.I'veposted the controller code below.Thanks in advance for any help?phpclass TasksController extends AppController{
var $name = 'Tasks';//var $helpers = array('Html', '_javascript_', 'Ajax');function index() {$this-set('data', $this-Task-findAll());
}function add() {if (!empty($this-params['data'])) {if ($this-Task-save($this-params['data'])) {$this-set('data', $this-Task-findAll());
$this-render('todo', 'ajax');} else {// do nothing}}}
function done($id) {$this-Task-id = $id;$this-params['data']['Task']['done'] = 1;if ($this-Task-save($this-params['data'])) {
$this-set('data', $this-Task-findAll());$this-render('done', 'ajax');}}function undo($id) {
$this-Task-id = $id;$this-params['data']['Task']['done'] = 0;if ($this-Task-save($this-params['data'])) {
$this-set('data', $this-Task-findAll());$this-render('todo', 'ajax');}}function delete($id) {
//if (isset($this-params['form']['id'])){ // $id = intval(substr($this-params['form']['id'], 5)); // } //end if$this-Task-del($id);
//delete should return same as add$this-set('data', $this-Task-findAll());$this-render('done', 'ajax');}}?

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


Re: hasOne relationship kills findAll()

2006-05-14 Thread Samuel DeVore

in config/core.php try upping the DEBUG define to 2 you can get a dump
of the queries that way

On 5/14/06, tom [EMAIL PROTECTED] wrote:

 Is there a way to debug SQL queries anywhere?


 


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



Re: CakePHP LDAP?

2006-05-15 Thread Samuel DeVore
John i use this (if it is mostly the same as the one you sent me a bit ago), with very few changes on php4On 5/15/06, John David Anderson (_psychic_) 
[EMAIL PROTECTED] wrote:I'm going to post this to the group, in hopes that others might find
it useful as well.This is what I'm using to do my LDAP stuff in my app. This modellives on a PHP5 system, so it might take a little bit of twiddling toget it running on a PHP4 install.It works with LDAP users as well as LDAP groups, and although it is
in sore need of refactoring, I present it here, mostly just to showyou how it might be implemented in Cake:?class LdapUser extends AppModel{ var $useTable = false; var $name = 'LdapUser';
 var $host = 'ldap.example.com'; var $port = 389; var $baseDn = 'dc=example,dc=com'; var $user = 'cn=admin,dc=example,dc=com';
 var $pass = 'secretgoeshere'; var $validate = array( 'givenName' = VALID_NOT_EMPTY, 'sn'= VALID_NOT_EMPTY );
 var $ds; var $inetOrgPersonAttributes = array( 'givenName', 'sn', 'title', 'street', 'l',
 'st', 'postalCode', 'telephoneNumber', 'homePhone', 'mobile', 'mail', 'ou' );
 var $ouAttributes = array( 'postalAddress', 'l', 'st', 'postalCode', 'telephoneNumber', 'facsimileTelephoneNumber'
 ); function __construct() { parent::__construct(); $this-ds = ldap_connect($this-host, $this-port); ldap_set_option($this-ds,
LDAP_OPT_PROTOCOL_VERSION, 3); ldap_bind($this-ds, $this-user, $this-pass); } function __destruct() { ldap_close($this-ds);
 } function auth($uid, $password) { $result = $this-findAll('uid', $uid); if($result[0]) { if (ldap_bind($this-ds, $result[0]['dn'],
$password)) { return true; } else { return false;
 } } } function findAll($attribute = 'uid', $value = '*', $baseDn ='ou=People,dc=example,dc=com') { $r = ldap_search($this-ds, $baseDn, $attribute .
'=' . $value); if ($r) { //if the result contains entries with surnames, //sort by surname: ldap_sort($this-ds, $r, sn);
 return ldap_get_entries($this-ds, $r); } } function findAllMulti($search, $baseDn = 'dc=example,dc=com') { $r = ldap_search($this-ds, $baseDn, $search);
 if ($r) { ldap_sort($this-ds, $r, ou); return ldap_get_entries($this-ds, $r); }
 } function add($data) { $data = ""> $r = ldap_bind($this-ds,'cn=admin,dc=example,dc=com', 'secretgoeshere');
 $cn = 'cn=' . $data['cn'] . ',ou=' . $data['ou'] .',ou=People,dc=example,dc=com'; $r = ldap_add($this-ds, $cn, $data); if (ldap_error($this-ds) != 'Success')
 { $_SESSION['error_message'] = ldap_error($this-ds); return false; } return true; }
 function addGroup($data) { $data = ""> $r = ldap_bind($this-ds,'cn=admin,dc=example,dc=com', 'secretgoeshere'); $cn = 'ou=' . $data['ou'] .
',ou=People,dc=example,dc=com'; $r = ldap_add($this-ds, $cn, $data); if (ldap_error($this-ds) != 'Success') { $_SESSION['error_message'] = ldap_error
($this-ds); return false; } return true; } function modify($oldCn, $data) { $data = ""
 unset($data['objectClass']); unset($data['cn']); $r = ldap_bind($this-ds,'cn=admin,dc=example,dc=com', 'secretgoeshere'); $cn = 'cn=' . $oldCn . ',ou=' . $data['ou'] .
',ou=People,dc=example,dc=com'; $r = ldap_modify($this-ds, $cn, $data); if (ldap_error($this-ds) != 'Success') { $_SESSION['error_message'] = ldap_error
($this-ds); return false; } foreach($this-inetOrgPersonAttributes as $attr) { if (!empty($data[$attr]) === false)
 { $todel[strtolower($attr)] = array(); //Remove elements that were emptyupon submission ldap_mod_del($this-ds, $cn, $todel);
 } } return true; } function modifyOu($oldOu, $data) { $data = ""
 unset($data['objectClass']); unset($data['cn']); $r = ldap_bind($this-ds,'cn=admin,dc=example,dc=com', 'secretgoeshere'); $cn = 'ou=' . $data['ou'] .
',ou=People,dc=example,dc=com'; $r = ldap_modify($this-ds, $cn, $data); if (ldap_error($this-ds) != 'Success') { $_SESSION['error_message'] = ldap_error
($this-ds); return false; } foreach($this-ouAttributes as $attr) { if (!empty($data[$attr]) === false)
 { $todel[strtolower($attr)] = array(); //Remove elements that were emptyupon submission ldap_mod_del($this-ds, $cn, $todel);
 } } return true; } function delete($oldCn) { $r = ldap_bind($this-ds,'cn=admin,dc=example,dc=com', 'secretgoeshere');
 $deadMeat = $this-findAll('cn', $oldCn); $cn = 'cn=' . $deadMeat[0]['cn'][0] . ',ou=' .$deadMeat[0]['ou'][0]. ',ou=People,dc=example,dc=com'; $r = ldap_delete($this-ds, $cn);
 if (ldap_error($this-ds) != 'Success') { $_SESSION['error_message'] = ldap_error($this-ds); return false;
 } return true; } function cleanArray($data) { //Remove empty array values $keys = array_keys($data);
 for($i = 0; $i  count($keys); $i++) { if (!$data[$keys[$i]] || $data[$keys[$i]] ==) { unset($data[$keys[$i]]);
 } } if(!$data['uid']) { unset($data['uid']); } return $data;
 }}?-- John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL 

Re: Cake Migrations available

2006-05-16 Thread Samuel DeVore
Way Cool Joe, you are hereby raised to the level of You Da ManOn 5/16/06, joelmoss [EMAIL PROTECTED]
 wrote:Cake Migrations is now at Version 1.0 and includes full support for:
 - create/drop tables - add/drop columns - insert/delete test data - and raw SQL queriesTake a look at its new home at http://joelmoss.info and the updated
Wiki page at http://wiki.cakephp.org/tutorials:cake_migrations

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


Re: Automatically generating table's?

2006-05-16 Thread Samuel DeVore
would the html helper functions tableHeaders and tableCells work?http://api.cakephp.org/class_html_helper.html#9a724e5b113b0d403e8be2072a2c8c96
and http://api.cakephp.org/class_html_helper.html#e055ff479e3a2c338eaa7587358c113f
On 5/16/06, roberts.sean [EMAIL PROTECTED] wrote:
I'm looking for a quick and elegant way to generate table elements witha set number of columns per row.For example, if I have an array of 30images and I want to generate a table with three images per row.The
way I've done this before working with Cake involves multiple for()conditions and I'd rather not use it if I can get around it.Does Cakehave built in functionality for generating tables?Thanks!

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


Re: bake.php Maximum execution time of 60 seconds exceeded

2006-05-16 Thread Samuel DeVore
Try adding set-time-limit(60); in the main loophttp://us3.php.net/manual/en/function.set-time-limit.phpSet the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the 
php.ini. If seconds is set to zero, no time limit is imposed.When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.
Sam DOn 5/16/06, David Spitzley [EMAIL PROTECTED] wrote:
You can modify the maximum execution time of PHP in the php.ini file, if you have control over that.Otherwise, I believe there is a function you can call in PHP to increase execution times, but I'm not sure how much power it actually has to override the limit in 
php.ini.David [EMAIL PROTECTED] 05/16/06 10:00 AM While happilly bakin' and whistling I came acroos :**PHP Fatal error:Maximum execution time of 60 seconds exceeded in
G:\www\cake\cake\scripts\bake.php on line 1482**I know programming with Cake is fast and I'm really having fun with it,but I can't type that fast !... ;-)the 1482 line tells me :**$result =trim(fgets($this-stdin));**
I guess this is not where I should look at any ideas?Thanks--Bruno/** CAKE 1.0.1.2708** wamp 1.6.3 ** PHP 5.1.4** MySQL 5.0.21 *
*/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Missing Method on bad url

2006-05-16 Thread Samuel DeVore
Set the debug level to 0On 5/16/06, Leandro Ardissone [EMAIL PROTECTED] wrote:
Hi,I want to get a 404 error page when someone tries to access a page thatdoesn't exists in cake.But when I put some else value in the URI I get Missing Method inImagesController instead of an error page or redirect to homepage.
How I can get this error page or redirect page working?Thanks

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


Re: Cake PHP in PHP 5

2006-05-20 Thread Samuel DeVore

CakePHP is designed to work in both 4 and 5

On 5/20/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Is Cake PHP available in version PHP5.0? or it is currently only in
 PHP4.X ?


 


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



Re: CakePHP 1.1.2.2955 Release

2006-05-26 Thread Samuel DeVore
Nate, how do you set up the returned information from the ajax-link to fill the two divs?On 5/26/06, nate 
[EMAIL PROTECTED] wrote:Hey y'all,Just wanted to make a follow-up comment about something that happened
this release.Actually, it's more of a confession: We did it again.We started adding new features.One thing people kept asking about was how to update multiple pageelements in a single Ajax request, and up till now, we had no way of
doing that.Not only that, but doing Ajax updates now takes less viewcode, thanks to AjaxHelper::div( ) and AjaxHelper::divEnd( ).Take alook:// test.thtmlcode?=$ajax-link('Update 2 Div\'s', '/controller/test', array('update' =
array('first', 'second'))); ??=$ajax-div('first'); ?This is the first div, it has the current time:?=strtotime('now'); ??=$ajax-divEnd('first'); ?
?=$ajax-div('second'); ?This is the second div, it shows server variables:? pr($_SERVER); ??=$ajax-divEnd('second'); ?/code
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Gettign a Adodb Session to work in cake

2006-06-06 Thread Samuel DeVore
You might want to jump on the irc channel and see if someone there can give you some help, try looking for nate or phpnut, they mioght be able to help. You might try adding some debugging calls to the adodb libraries you are trying to use and see if you can gain some insight that way. It is possible that there is some namespace problem or connections that are getting grabed somewhere.
Sam DOn 6/6/06, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:

No one who can help me in this case?[EMAIL PROTECTED] wrote: I need my session in cake work with the adodb sessio lib. I get it to
 work in an older cake version, but with the latest cake cake_1.0.1.2708
 it dont work any more. my bootstrap looks like this: ### $ADODB_SESSION_DRIVER = 'mysql'; $ADODB_SESSION_CONNECT = 'localhost'; $ADODB_SESSION_USER = 'user';
 $ADODB_SESSION_PWD = 'pass'; $ADODB_SESSION_DB = 'test'; vendor('adodb/adodb.inc'); vendor('adodb/adodb-session'); ### The Site alwas tells my that it cannot connect to the datase, the
 credentials are 100 percent correct hope anybody hears me crying thanks



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


Re: Problems with DocumentRoot on Mac

2006-06-07 Thread Samuel DeVore
usually what I do is to set up a virtual host that points to my user folder. The usual ~username/ never seems to work. But I have cake running on about 3 different versions of mac os x with no problems, server and client installs
On 6/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Wow, and now http://localhost/posts/view/1 just goes to a blank white
page, no error messages.Is there extra config you need to do to runCake on a Mac?

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


Re: Problems with DocumentRoot on Mac

2006-06-07 Thread Samuel DeVore
Oh the other issue is to make sure that you have AllowOverride All set for the path where the cake install is at.On 6/7/06, Samuel DeVore 
[EMAIL PROTECTED] wrote:usually what I do is to set up a virtual host that points to my user folder. The usual ~username/ never seems to work. But I have cake running on about 3 different versions of mac os x with no problems, server and client installs
On 6/7/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Wow, and now 
http://localhost/posts/view/1 just goes to a blank white
page, no error messages.Is there extra config you need to do to runCake on a Mac?




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


Re: Problems with DocumentRoot on Mac

2006-06-07 Thread Samuel DeVore
If you are around later today, try me on google chat if you want and we can figure it out, then perhaps when we are done we can work on a help page for the next troubled user...Sam D
On 6/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Samuel DeVore wrote: usually what I do is to set up a virtual host that points to my user folder.The usual ~username/ never seems to work.But I have cake running on about 3 different versions of mac os x with no problems, server and
 client installsHi Samuel - I'm not super-skilled at this kind of stuff.Could youprovide more details on what to do?Do you do the virtual host in thehttpd.conf file?Any details you could provide would be super-helpful,
not only to me but to the next newb that runs into these problems onMac.

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


Re: Cake for Intranet development

2006-06-08 Thread Samuel DeVore
It really depends on what you are talking about with modules, probably the cake equivalent to what most people are referring to with modules. Would be the plug in notion. Where one can have mostly self contained functionality that may be shared among multiple 'applications' I believe there are some examples to be found in the 
cakeforge.org site. And there is some documentation in the release notes as well. There is also some information in the manual, oddly enough in the section entitled 'Plugins' 
http://manual.cakephp.org/chapter/21If this was not what you are talking about let us know how you are thinking about modules and we can help steer you to the CakePHP construct.There are also 'Helpers' - common functionality to extend and enhance views
'Components' - common functionality to extend and enhance controllersand coming soon I think'Behaviours' - same thing but with models in mind.Sam DOn 6/8/06, 
Leandro Ardissone [EMAIL PROTECTED] wrote:
great, thanks nate..and what about of upgradability..I mean, the creation of quick-to-install modules to upgrade easily oncethe server is in production.bc I see that the structure of Cake doesn't allow modules in an easy
way.. which is your suggestion in this case? elements maybe?thanks

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


Re: Cake for Intranet development

2006-06-08 Thread Samuel DeVore
I have to apologize it seems that the manual section on plugins is empty, sorrySam DOn 6/8/06, Samuel DeVore 
[EMAIL PROTECTED] wrote:It really depends on what you are talking about with modules, probably the cake equivalent to what most people are referring to with modules. Would be the plug in notion. Where one can have mostly self contained functionality that may be shared among multiple 'applications' I believe there are some examples to be found in the 
cakeforge.org site. And there is some documentation in the release notes as well. There is also some information in the manual, oddly enough in the section entitled 'Plugins' 

http://manual.cakephp.org/chapter/21If this was not what you are talking about let us know how you are thinking about modules and we can help steer you to the CakePHP construct.There are also 'Helpers' - common functionality to extend and enhance views
'Components' - common functionality to extend and enhance controllersand coming soon I think'Behaviours' - same thing but with models in mind.Sam D
On 6/8/06, 
Leandro Ardissone [EMAIL PROTECTED] wrote:

great, thanks nate..and what about of upgradability..I mean, the creation of quick-to-install modules to upgrade easily oncethe server is in production.bc I see that the structure of Cake doesn't allow modules in an easy
way.. which is your suggestion in this case? elements maybe?thanks




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


Re: CakePHP LDAP?

2006-06-14 Thread Samuel DeVore
I don't think it is, it's just habitOn 6/13/06, RosSoft [EMAIL PROTECTED] wrote:
Samuel: Is that necessary in PHP4 ? Can you verify it?Because AppModel extends Model --extends ObjectAnd Object class implements the php4 constructor for compatibility with__construct
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Internal Messaging System

2006-06-14 Thread Samuel DeVore
I have a model that has a belongs to like var $belongsTo = array(  'Owner'   = array('className'='Client','foreignKey'='owner_id'),  'Photographer' = array('className'='Client','foreignKey'='photographer_id'),
  'Billto'  = array('className'='Client','foreignKey'='billto_id'),  'Client'  = array('className'='Client','foreignKey'='client_id'));4 parts all connected to same model works fine for me
On 6/14/06, John Zimmerman [gmail] [EMAIL PROTECTED] wrote:
Is anyone building an application with an internal messaging system?I
am trying to build a basic internal messaging system that sort of
mimicks the basic functionality of email (i.e. send/reply/view) between
two users only. No need to edit, delete, forward, etc.. as I am
addressing this with auto archiving and providing an alternate core
communications system as well. My idea here is only the basics.
I am trying to figure out the models for this since both the
sender and the receiver will both be of model 'User'. The message will
need an id pointing to both users.I have seen example code
where one user is linked to the message using a 'user_id' column and
the other user is linked using a 'fromid' column. How well does this
work?
Any help / hints / ideas reguarding the model relationships
are appreciated. I am still learning the cake way, sorry if I am just
making this too hard.Thanks.





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


Re: $ajaxOptions (updateElement, afterUpdateElement) for autocomplete

2006-06-17 Thread Samuel DeVore
:)On 6/17/06, nate [EMAIL PROTECTED] wrote:
https://trac.cakephp.org/changeset/3119There.Is everybody happy now??

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


Re: {Seeking} Overview for Dummies

2006-06-17 Thread Samuel DeVore
Olivier, We could use http://hem.fyristorg.com/matben/ Coccinella to do this. I would be happy to host the file for a while and then as we come to consensus, I'll clean it up and make a pdf/page out of it.
Sam DI'll post information on the file when I get it up and runningOn 6/17/06, Olivier Percebois-Garve 
[EMAIL PROTECTED] wrote:I think it would be good to have such representation. It took me a long
time to see the big pictureof how cake is functioning, and there is still a lot of unclear thing.The link of Nate is cool but I'm not sure how it help newbies: Look atthe step 3 where the controller is.
honestly you've to know cake to understand that part, to know what amodel is, what a requestaction is, ...It seems to be a good start, but to me, A good graphic representationwould need a bit more details, and should
outline the MVC structure. It should tell what the dispatcher does withthe params,that the model are defined in a similar manner to how we build a dbscheme (LDM).Do you know a online paperboard website ? So we could tell
collectively and graphically how it should look like.OlivvvAD7six wrote: Hi All, I'm looking for a graphical representation of how cake handles a request. I came across
 http://jmp.xybyx.com/img/overview2.png and http://grahambird.co.uk/cake/tutorials/howitworks.php
 both of which are very useful for understanding the basics, but miss some objects. Has anyone already created, or is there a page existing somewhere in the manual that I've yet to find, an image that describes graphically
 all of the various objects used by Cake (or any MVC for that matter) such that none-developers can see how things fit together, in particular everything to do with presentation? As you might guess I'm
 trying to explain to someone (none-technical) I'm working with generally how things work and which files to edit, but after repeating myself 2 or 3 times I think it's time for a picture.
 The difficulty seems to stem from the concept of a dispacher; the 'black magic' of mod_rewrite/cake pretty urls and the URL requested may not directly relate to what is expected (routes; using one edit.thtml
 for add  edit methods etc.). Any help or comments most welcome, Cheers, AD7six 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Where conditions for hasAndBelongsToMany?

2006-06-22 Thread Samuel DeVore
Have you looked in the model chapter of the manual http://manual.cakephp.org/chapter/6 you are looking for the section on adding conditions. For example one thing that I have as a condition is flActive=true
Sam DOn 6/22/06, Matt [EMAIL PROTECTED] wrote:
Hello everyone,Must say I am very impressed with CakePHP but I'm having troublegetting my head around associations, particularly hasAndBelongsToMany.The scenario is this, I've got two tables Users and Teams linked by a
join table. When I return a team using Team-find sometimes I only wantto return a subset of Users - is it possible to set conditions on theassociated models?ThanksMatt
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Where conditions for hasAndBelongsToMany?

2006-06-22 Thread Samuel DeVore
then what you are probably looking for is bindModel and unbindModel look at some of the listings at http://cakephp.org/search?q=bindModel (cakebaker has a nice overview) you can also have conditions in your findAll and find calls
Sam DOn 6/22/06, Matt [EMAIL PROTECTED] wrote:
Hi Samuel,I saw that section but noticed that is for conditions that alwaysapply. What I am looking for is conditions that I can apply sometimes.Matt
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: model associations causing errors.

2006-06-30 Thread Samuel DeVore
Try using array('Article.active'=1) for the condition ('Article.active'=1 would work as well but there are some advantages to using the arrays for conditions)On 6/30/06, 
AD7six [EMAIL PROTECTED] wrote:
Hi Luke,set debug to 2 in your /app/config/core.php file, and you will see thatthe sql query that is generated, and see that there are 2 tablesincluded in the SQL that contain the field active.
Cheers,AD7six
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Notation in the manual

2006-07-05 Thread Samuel DeVore
You know for most of the functions you may be better off looking in the api documentation (http://api.cakephp.org/ ) it's a little more standardized.Sam D
On 7/5/06, LikeSoy [EMAIL PROTECTED] wrote:
I'm sure I'm just missing something (or overthinking it), but I don'tquite understand the style used to explain the syntax for functions. Inthe example below, are 'string' and 'array' supposed to be describing
the variable between them, or is there more to it?* findAll* string $conditions string* array $fields array* etc ...TIA,Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: ways to detect httpRequest or just render 'bare'?

2006-07-05 Thread Samuel DeVore
I would imagine that if one is using other js methods like dojo that there might be a custom header from them as well that could be added to the requestHandler stuff, as a variable or define, that could be added to the code via a enhancement request in the trac/
On 7/5/06, adam davis [EMAIL PROTECTED] wrote:
Hi all,Regarding the immediate problem discussed in this thread (renderingbare)... I'm finding that using the following works$this-autoLayout = false;or$this-layout=ajax;
For anyone else following this beware of the render time print outthat appears by default at the bottom of your pages if your DEBUG0.This will really mess you up if you're trying to return something
other than html or xml (like JSON)The link below has some pointers to ommiting the render time:omit render time?
http://groups.google.com/group/cake-php/browse_thread/thread/dee6de138115dc36/28a23c1188d6a7c7As for the thoughts this has provoked, thanks Nate for the responseand background explanation. It's good to know what informed the design
- helps with working with it.Maybe it's a documentation issue thatcreates the confusion - and these things will become more clear asmore information about CakePHP and how to use it emerges (throughpeople using it and contibuting to the documentation, lists etc.)
For my 2c, while I understand the need for making a choice, and therationale of convention over configuration, dressing up somethingquite specific (Prototype.js) as generic (AjaxHelper or setAjax) is a
little misleading to developers who are entering the cake bakery fromother frameworks or languages. What isn't Ajax these days? Maybethere's a problem with that specific buzzword. That's why I wouldfavour a more specific approach to naming conventions.
Moving forward, I have no fear of diving into the code and alteringthings manually in my JS or PHP on a project by project basis based onrequirements - I think a core framework can only provide a certain
amount of generic usefulness for every possible option before itbecomes too complex and difficult. That's why we like cake!Maybe at the end of these projects I'll have enough generic code toconsolidate into a stable DojoHelper or YuiHelper of sorts. I hope so
- I think CakePHP has great potential and I agree that more choice ofthings like js libs, the better for us all. Nice well rounded cake.all the best,-adOn 05/07/06, nate 
[EMAIL PROTECTED] wrote: Hi there,  I know the proper cake way to set contentis to use the RequestHandler  Component $this-RequestHandler-setAjax(), but Ive discovered that
  that this function tests the value of the HTTP_X_REQUESTED_WITH header,  which is a proprietry value set by thePrototype.js. If you're using an alternative library, I would suggest setting the
 request header manually.  1. Does anyone know if there there any other (standard) ways of  detecting an httpRequest load of content? Other than headers and custom URLs, there is no other way, unless you
 can figure out a way to cleverly embed a flag in some other part of the request anatomy.  2. Otherwise, in Cake, what's the best way to serve pages as bare.  I've tried setting the folowing in my controller
 Try $this-layout = 'ajax'; or $this-autoLayout = false; (in the Controller). - request the url preceded by /bare (works, but not in conjunction  with /admin -seems limited)
 I think that's been fixed recently.Have you tried it both ways? (i.e. /admin/bare and /bare/admin).  How much of CakePHP's code and design is locked into Prototype.js?
 A lot. Cake is based on the idea of convention over configuration.One of those conventions is the use of the Prototype library. When we first started developing this part of the framework, we
 considered several libraries (including Dojo) and ended up going with Prototype for a number of reasons.Our hesitations about the file size were more or less negated by the fact that the readability of the file
 itself means (a) you can remove components for specific situations or applications, and (b) it's uncompressed, which means you can compress it.  For a number of reasons I'm using a different _javascript_ library than
  Prototype.jsfor my httpRequest activity (using the Yahoo! UI lib in  one project and Dojo Toolkit in another, and sometimes it's not  necessary to include an entire library of code, so I have some hand
  rolled variations). Fortunately, most JS libs make customization easy.I imagine it'd also be pretty easy to write the necessary header code into Dojo or Yahoo UI yourself.
  Maybe time for me to write a DojoHelper. yikes. Anyone else using these  libs? I've heard about a few people, but I don't really know how many. You're certainly more than welcome to write your own library and post
 it on CakeForge, so that the rest of Cake's Dojo-and/or-Yahoo-UI-using community can help you continue to develop it.In fact, I would sincerely appreciate any efforts to help expand Cake's support for
 other _javascript_ libraries through 3rd party components and helpers. --- - 

Re: Textmate Cake Bundle [was: cool editors for using with cakephp]

2006-07-06 Thread Samuel DeVore
check out address for subversion is http://macromates.com/svn/Bundles/trunk/Bundles/CAKE.tmbundlecomments and ideas welcome :)Sam D
On 7/6/06, Poncho [EMAIL PROTECTED] wrote:
John David Anderson (_psychic_) wrote: On Jul 6, 2006, at 2:43 PM, Poncho wrote:   I was a long-time user of Dreamweaver (in code-view, mainly for  code-completion and syntax highlighting) until I discovered TextMate
  about a year ago.   I also use the Cake.bundle by sdevore. It totally rocks my world and  saves me so much time with the ability of setting up snippets for  anything I need.
 Where is this bundle, and what does it do? -- JohnHey John,The Cake.bundle is a collection of commands and snippets for TextMatefor CakePHP application development, it's like a plugin. It includes
snippets to create entire controllers/models etc. as well as simpleshortcuts to create links, form elements, if and foreach constructsetc.There are instructions on the Macromates wiki on how to get the bundles
for the SVN repository. Obviously you will need TextMate for this towork.http://macromates.com/wiki/Main/BundlesCheers;Poncho
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: limiting what fields can be saved

2006-07-07 Thread Samuel DeVore
I belive that model::save takes a third parameter of fields to savehttp://api.cakephp.org/class_model.html#ef348bd6a62f8196fe42b2cebafc945f
Sam DOn 7/6/06, Felix Geisendörfer [EMAIL PROTECTED] wrote:



  
  


Hey Chris,

I think you've got a good point there. One solution I could think of is
to do something like this:

class PostsController extends AppController
{
 var $name = 'Posts';
 
 function update()
 {
 $post = $this-__limitFields($this-data['Post'],
array('text', 'title'));
 }
 
 function __limitFields($fields, $allowed_fields)
 {
 foreach ($fields as $field = $val)
 {
 if (!in_array($field, $allowed_fields))
 {
 unset($fields[$field]);
 }
 }
 
 return $fields;
 }
}

(didn't actually try it out, but I think you get the idea.).

But still, this could leave some holes in older apps if they store
critical data in tables that can be modified like this.

Best Regards,
Felix Geisendörfer

--
http://www.thinkingphp.org
http://www.fg-webdesign.de



Chris Renner schrieb:

  It just occurred to me that I've left a serious security hole in my recent cake apps. By blindly using $this-params['data'] in my save, I'm leaving a hole for users to change whatever fields they want to. I 
want to remind people about the potential for this, and see if the group has a more elegant way of solving it.Say for example I have a User model. Users need to be able to update their email address, etc., but I don't want them changing, say, the 
security_level field. So far, I've just used an edit form that contained inputs for email address, etc. but not for security_level. But (having just done it), it's easy for an html-savvy user to add an input name=data[User][security_level] / and change it along with 
the rest of the data. Because my controller simply contains $this-User-save($this-params['data']) any field that's present in the form will be saved, including security_level.Now, this fix for this can be easy: in my action, unset those fields I 
don't want to be writable. But it seems like there must be better way to do it... based on user roles in the before_filter perhaps? Or even in the model? What's the philosophy here? Should controllers have 
unfettered access to all fields of a model, or should access be limited from the model?  









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


Re: limiting what fields can be saved

2006-07-07 Thread Samuel DeVore
in your model file you could create your own save function that has a default $whitelist that then gets passed to the parent::save()Sam DOn 7/7/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
While, I feel a little less sheepish for not having noticed that ifthese guys didn't either. I'm going to have to print out the api for mybedtime reading :-)I'm still not sure I like that solution best... when my user model
contains 40-some fields, I'd rather not be passing arrays of that sizearound, when I could just blacklist the few fields I don't wantwritable... I'll be thinking about the beforeValidate and limitFieldsoptions.
Thanks for the input, guys.chris

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


Re: Bug in $html-dateTimeOptionTag

2006-07-07 Thread Samuel DeVore
there is a ticket with a patches at https://trac.cakephp.org/ticket/927On 7/7/06, Spinnal
 [EMAIL PROTECTED] wrote:I think that exists a bug in the funcion $html-dateTimeOptionTag(),
when I try to show a combo box usign this funtion and passing the valuethat I want to be selected by the function I always obtain a combo boxwithoutthe date value that I pass to the funcion selected.
I think that the error is in the lines 01195 to 01197 ofcake\libs\view\helpers\html.php file.01195 if (strpos($selected, ' ') === false) {01196 $selected = '-00-00 ' .
$selected;01197 }01198 $date = explode('-', $selected);01199 $days = explode(' ', $date[2]);0120001201 $day = $days[0];
01202 $month = $date[1];01203 $year = $date[0];...The IF in the line 01195 always evaluates to false when we pass onlya date value, if we pass a string containting '2006-04-04 when we reach
this part of the code the if block change the value of my string to'-00-00 2006-04-04' after that point when we try to use theexplodes they aren´t going to work because the string is nowcorrupted.
In the cake version 1.x.x.2819 the code in the lines 01195 to 01197doesn't exist that code appears in the cake version 1.1.5.3148. If wecomment from the line 01195 to 01197 the function seems to work fine.
What do you think about this, is this a bug?Sorry about my english I'm not a native speaker..

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


Re: file_get_contents()

2006-07-11 Thread Samuel DeVore
I have found that in some cases my php from the command line is completely different from php as interpreted in the browser.Sam DOn 7/11/06, nate
 [EMAIL PROTECTED] wrote:Yeah, that's really odd.The only thing that comes to mind is an
errant ini_set, but it doesn't look like Cake is setting anything thatwould do that.All I could suggest is to try doing the read fromdifferent parts within the framework, i.e. app/webroot/index.php,bootstrap.php
, etc.See if you can narrow it down to a particular line or file.

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


Re: How do I limit HABTM results with find function?

2006-07-12 Thread Samuel DeVore
try array('Logo.company_id'=1,'Product.id'=2) On 7/12/06, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:I have a HABTM relationship between Products and Logos. When I use
something like this:$this-set('data', $this-Product-find(id = 2, null, null, 1));The result is the following:Array([Product] = Array([id] = 2
[name] = Chase and Ken T-Shirt[description] = Blandit autet irillam integer ...[price] = 7.95[quantity] =[active] = 1
[featured] = 0[cart] = 1[brand_id] = 0[created] =[modified] =)[Logo] = Array([0] = Array
([id] = 3[name] = Screenprinted Gentex Logo[location] = Back[price] = 0.75[company_id] = 1
)[1] = Array([id] = 4[name] = Screenprinted Serious Cams Logo[location] = Breast
[price] = 0.50[company_id] = 2)))However, when we end up having a bunch of logos, this result will beenormous. How do I have the same result but limit the logos to having a
company_id of 1. I tried the following:$this-set('data', $this-Product-find(id = 2 AND company_id = 1,null, null, 1));$this-set('data', $this-Product-find(id = 2 AND 
logo.company_id =1, null, null, 1));But neither seemed to work; the error says field company_id notfound. What to do?Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Correct procedure for db config switching?

2006-07-22 Thread Samuel DeVore

I do it in my /config/databases.php file.

so in the class definition I have a constructor (all my stuff is php4
so I do it this way)

function DATABASE_CONFIG () {
if ($_SERVER['SERVER_NAME'] == 'dns.of.demo.machine') {
$this-default = $this-dev;
}
}

Though I think that using the __constructor() that cake uses
everywhere else for php4 and 5 uniformity should work as well.

Sam D

On 7/22/06, Ixulai [EMAIL PROTECTED] wrote:

 Ok, the app I'm developing requires a way to dynamically create 
 switch database configs at runtime. At present I am using a hack to
 create new datasources at runtime. (SVN copy has
 ConnectionManager::create for this purpose but for some reason
 1.1.6.3264 doesn't have this, despite it being added in 3195? Relevant
 ticket to show the method I'm using;
 https://trac.cakephp.org/ticket/1068 )

 To switch database configs I am altering useDbConfig in my instantiated
 models. However, I have recently been informed by nate that useDbConfig
 was never meant to be modifed at runtime. (
 https://trac.cakephp.org/ticket/1184 )

 Does anyone know if there is a 'correct' procedure for switching to a
 database config that can only be determined at runtime?

 I guess it's not a big issue for most, but if there isn't a correct
 procedure then perhaps there should be? Now that at least the SVN copy
 of ConnectionManager is capable of creating dynamic connections and
 all.

 Thanks for any help :-)


 


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



Re: Correct procedure for db config switching?

2006-07-22 Thread Samuel DeVore
i's funny I just looked at an actual site of mine and I do ;) need to double check them all, thanks for the reminer...On 7/22/06, Gustavo Carreno
 [EMAIL PROTECTED] wrote:On 7/23/06, Samuel DeVore 
[EMAIL PROTECTED] wrote: Though I think that using the __constructor() that cake uses everywhere else for php4 and 5 uniformity should work as well.One should use both ways to define constructor and drop the code on
the __construct, calling it from the PHP4 way:function ClassName() { $this-__construct();}function __construct() { //put all your constructor code here }This way if you migrate to php5 only, it won't break.
--Gustavo Carreno--- If you know Red Hat you know Red Hat,If you know Slackware you know Linux 

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


Re: LEFT JOIN missing in SELECT statement

2006-07-23 Thread Samuel DeVore
you should look at the bindModel stuffcake baker as a little bit about it here http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/
Sam DOn 7/23/06, francky06l [EMAIL PROTECTED] wrote:
Thanks,The problem is that the condition changes depending of the user role(in my case), so I can't stick it into the model relation. I can dothis using the bindModel on the fly, but even so I can;t succeed.
Basically I will have to write the SQL query ..I will try to find better way ... but apparently not possible using theCake query method.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: shared views

2006-07-26 Thread Samuel DeVore

$this-render(null,$layout);

might work

http://api.cakephp.org/class_controller.html#c89d96ba75d5acfafaee61476a575353

On 7/26/06, admataz [EMAIL PROTECTED] wrote:

 Does anyone know if there's a way to share the same view between
 different controllers and controller actions? Or a good reason not to
 have common views?

 Some of my controller actions output generic structured data. I would
 like to assign a view that is shared across my app, and not bound to a
 specific controller.

 But if I omit the view file for a specific controller action Cake
 throws a missing view error, so I find I'm creating multiple copies
 of the same file just to keep it quiet

 -ad


 


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



Re: Re: shared views

2006-07-26 Thread Samuel DeVore

sorry

$this-render(null, null, $file);



On 7/26/06, Samuel DeVore [EMAIL PROTECTED] wrote:
 $this-render(null,$layout);

 might work

 http://api.cakephp.org/class_controller.html#c89d96ba75d5acfafaee61476a575353

 On 7/26/06, admataz [EMAIL PROTECTED] wrote:
 
  Does anyone know if there's a way to share the same view between
  different controllers and controller actions? Or a good reason not to
  have common views?
 
  Some of my controller actions output generic structured data. I would
  like to assign a view that is shared across my app, and not bound to a
  specific controller.
 
  But if I omit the view file for a specific controller action Cake
  throws a missing view error, so I find I'm creating multiple copies
  of the same file just to keep it quiet
 
  -ad
 
 
   
 


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



Re: Search Engine Optimization

2006-07-27 Thread Samuel DeVore

no

On 7/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 We're bidding on a website redesign and are heavily pitching the use of
 CakePHP.  The client is very concerned about URLs like:

 www.site.com/page

 instead of

 www.site.com/page.html

 Are CakePHP URLs any more difficult for search engines to index than
 the standard page.html form?


 


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



Re: Calling Cake from within another web app.

2006-07-30 Thread Samuel DeVore
did you try searchinghttp://www.google.com/search?q=cakephp+and+drupalstart=0ie=utf-8oe=utf-8client=firefoxrls=org.mozilla:en-US:unofficial
On 7/29/06, Kuma_Pageworks [EMAIL PROTECTED] wrote:
So this project that I'm working on has basically become a CMS.Soinstead of building an entirely new CMS from the ground up, I wasthinking that I would just hack an open-source one and add newfunctionality with Cake.My question is: Can you call Cake from inside
another app, like a CMS (Drupal, for example)?It seems to me it wouldjust be a matter of getting the URLs right when passing informationback and forth between the two.Views would be called inside the CMS
wrapper, and you'd keep the functionality of Cake.Thoughts?

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


Re: hierarchical controllers

2006-07-31 Thread Samuel DeVore

There is an admin routing feature you might want to look at

http://manual.cakephp.org/chapter/4  in section 4

It's a different way to do what you might be thinking about.  And no I
do not believe that there is builtin support for hierarchical
controllers

Sam D

On 7/31/06, Neves [EMAIL PROTECTED] wrote:

 Hi,

 Is possible to have hierarchical controllers like:
 /admin/blog/edit/1 where admin is a folder with others controllers
 related do the admin of the site.


 


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



Re: image - link should be simple right

2006-08-01 Thread Samuel DeVore

You should try making the 5th parameter false  so that it doesn't
escape the title (or the link text) in your case the image tag

Sam D

ps the api is your guide  http://api.cakephp.org/  ;)

and welcome from the grumpy old man who leave short useless answers
scattered all over the place

link ($title, $url=null, $htmlAttributes=null, $confirmMessage=false,
$escapeTitle=true, $return=false)

On 8/1/06, kestrelid [EMAIL PROTECTED] wrote:

 New to cakePHP so forgive me a potentially stupid question.

 Creating an image link should be simple, right! I have gone through the
 manual I don't know how many times. Looked through code snippets, etc.
 yet I still get bogus output rather than my chosen picture as a link!

 An image link as I understand it should be something like this
 ?php echo $html-link( $html-image(edit.png,
 array('alt'='edit')),/users/edit/{$user['User']['id']}); ?

 For output, I am getting a working link but it is this actual text that
 you have to click to activate the link!
 img src=/cakePHP/img/edit.png alt=edit /

 rather than the image at
 www.kestrelid.com/cakePHP/app/webroot/img/edit.png


 


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



Re: Re: image - link should be simple right

2006-08-01 Thread Samuel DeVore

If this old dog can learn this new CakePHP tricks thing  then any one can.

On 8/1/06, kestrelid [EMAIL PROTECTED] wrote:

 Sorted. If the quality of this response is the future in cakePHP I have
 to look forward to, the future is bright.

 thanks Samuel


 


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



Re: Will Sanitize-cleanArray protect against XSS attacks?

2006-08-01 Thread Samuel DeVore
I think to make the assumption that because no one either feels confident enough to answer the question of whether or not cleanArray or the CakePHP framework in generally protects against XSS attacks, no one understands the vulnerabilities is fairly shallow. 
I think given the variety and varying levels of sophistication of XSS attacks (as well as other attacks on a site in this day and age) to assume that one verb or a framework can protect you from them is 'crazy'. Only you can know how your application is vulnerable and what can be done with it.
Can cleanArray help? yes. Can it foil all efforts? don't be silly. Does the framework reduce a sites vulnerablity? yes. Is it perfect? no.That is why there is the SecurityComponent, the cleanArray, and other functions. It is a battle we all must wage and continue to learn and share methods and practices to solve. cleanArray would only address a small fraction of the possible ways to 'break' into your app.
Humbly Sam DOn 8/1/06, Eric Farraro [EMAIL PROTECTED] wrote:
Surely someone must know a bit about XSS vulnerabilities!:)

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


Re: flash() not working

2006-08-01 Thread Samuel DeVore

remember that the automatic redirect only works with a DEBUG set to 0
in the config/core.php

for other debug levels you have to manually click on the link

Sam D

On 8/1/06, anir [EMAIL PROTECTED] wrote:

 Hi all,

 I am new to cakephp. In my controllers after adding a record, I am
 trying to use flash() to display a confirmation mesage and redirect to
 my home page. But the problem is although it is showing the message in
 the next page but it is far from redirecting it to the index page. It
 is showing the message and stands there.

 The line is:

 $this-flash('Your note has been added.','/notes/',3);

 I was initially trying with :

 $this-flash('Your note has been added.','/notes/');

 But both are not working. I have tested this on both IE and firefox.

 I am working in windows xp with apache. I have configured apache for
 mod_rewrite and it is working properly.

 Thanking you all in advance.

 - Anir


 


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



Re: Re: Model undefined?

2006-08-02 Thread Samuel DeVore

You might look at setting up some custom pluralizations in the the
apps config/inflections.php file.  It could be that the inflections
are not working out right.  The model and controllers are pretty
dependant on that

On 8/2/06, Mattijs [EMAIL PROTECTED] wrote:

 As an addition: leaving out the $uses makes the app ask for 'Nieuw' as
 modelname, it seems that when calling generateFieldNames, the
 controller forces singularization to find the modelclass and ignores
 the $uses... this would also explain why my agenda controller which is
 in fact identical (except for the names) does work; the singularization
 of 'Agenda' results in Agenda for both Dutch and English.


 


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



Re: Re: Websites vs. Web Applications

2006-08-03 Thread Samuel DeVore

heck I even did a essentially static website with all the content
stored as markdown styled text and just rendered into a site on the
fly.  The client then edits the text files that are synced with the
server

http://www.glicksmanlaw.com/

Sam D

On 8/3/06, webbo11 [EMAIL PROTECTED] wrote:

 I suppose i meant just a website.  Say, that a client comes to me
 needing a website developed.  A 10 - 15 page website with dynamic
 content a few forms, etc.  Would it be better to use procedural
 programming or a cms such as drupal, or does cakephp work well serving
 websites.


 


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



Re: Special characters from the model and str_replace()

2006-08-04 Thread Samuel DeVore
So now I have to admint I haven't been reading this thread at all, and I have no experience with this particular problem. But when I was helping someone track down some problems with jpGraph and cake. we were having problems with encoding of the resulting image. It turned out that a couple of the files had BOM settings that were differenet then what we were trying to output and it was getting cakephp/ php and apache all confused. After stripping BOMs from all the files we had better luck
Sam DOn 8/4/06, anarchitect [EMAIL PROTECTED] wrote:
Now the phenomenon gets clearer, i am still in clueless state, though.Getting data in a regular fashion from models to the views via the$this-set('var', $this-Post-findAll(null,null,'Post.created
 DESC'));seems to work.But if i want to display stuff within a view from other models encodingseems to get treated differently. The two cases that i am stumblingabout right now are components/elements and associated models - in my
case a tag model via hasAndBelongsToMany. Umlaut-characters are shownscrewed up.Does anybody has any insight where the difference might lie? Thanksagain.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Providing arguments to element from view

2006-08-04 Thread Samuel DeVore
According to the api http://api.cakephp.org/class_view.html#54f7a2fbe1215f970dff3132730ab1f1renderElement takes two parameters
you could try this$params['user_id'] = $user_id;echo $this-renderElement('user_box', $params);and in the element look for it(hint it will be $user_id ;)Sma D
On 8/4/06, half_brick [EMAIL PROTECTED] wrote:
Hi,I'm trying to pass some arguments into an element from a view.Basically, I'm rendering comments in a view and want to pass the useridof the comment to the element/component so that for every comment the
userinformation and avatar is shown.Currently im trying to pass in the userid in the renderElement call.But I can't seem to get it back out in the startup method of thecomponent.My code is as follows
in the view I call: echo $this-renderElement('user_box', $user_id, $params);and in the userbox I've tried so many different ways to get hold ofthat $user_id parameter.If someone could tell me how to get it, my problems would be solved.
Cheers
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Providing arguments to element from view

2006-08-04 Thread Samuel DeVore
In cake speak a component is a class used to contain common code for many controllers, I'm not sure this is what you are talking abouthttp://manual.cakephp.org/chapter/9
 - components Is is possible you are thinking of a need for $this-requestAction ('/controller/action/',$params)referenced in the section on controllers? 
http://manual.cakephp.org/chapter/7Sam DOn 8/4/06, half_brick [EMAIL PROTECTED] wrote:
Cheers,I actually got that working just after I posted.What would be even more useful, and what I probably should have asked
to start with is how do you provide parameters from the view through tothe component?At the moment I have access to the parameters at the view, but I'drather pass the user id down to the component, get the component to get
the relevant data on the user and then render the view.Is that different call than renderElement?

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


Re: Views for e-mails

2006-08-10 Thread Samuel DeVore
Like http://www.thinkingphp.org/2006/08/05/a-solution-for-e-mail-sending-in-cakephp/or 
http://wiki.cakephp.org/tutorials:sending_emailThere are some others at http://cakephp.org/search?q=emailSam D
On 8/10/06, Gonçalo Marrafa [EMAIL PROTECTED] wrote:
Hi.Is it possible to have views that are not for display? I want my system tosend e-mails on certain events and i would like to have multipletemplates, one for each of those events. I would like to be able to use
them as a regular view. Kinda like:function foo(){... some code ...$this-set('to', '[EMAIL PROTECTED]');$this-set('name', 'Some Name');
$this-set('message', 'Hello world!');}And, instead of displaying a page, an e-mail would be sent.Is this to far off? Can something like this be done?--Gonçalo Marrafa 
[EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: How add condition for associated model in findAll()

2006-08-15 Thread Samuel DeVore
some examples can be found at http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/Sam Dps it a great feature, but if you find yourself using it all the time you might want to think about adding conditions to the model files them self and undoing the conditions when you do not need them (I found a recent case where I was using bindModel all the time to customize something the same way each time except for rare cases, so I added the condtion to the model and in the rare cases used bind model, and bang less code :) got to love removing code
On 8/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
use bindModel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Framework panel discussion in Boston

2006-08-15 Thread Samuel DeVore

other frameworks...  there are other frameworks, dang it should of
looked at those... ;)

good luck and knock their socks off

sam d

On 8/15/06, nate [EMAIL PROTECTED] wrote:

 Hi all,

 If you're in the area, come check me out at BostonPHP:
 http://cake.insertdesignhere.com/posts/view/6

 I'll be presenting CakePHP along side some other frameworks.


 


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



Re: Re: Outputting Code on a Website

2006-08-16 Thread Samuel DeVore

gwoo beat me,  I must be an old fart

On 8/16/06, Samuel DeVore [EMAIL PROTECTED] wrote:
 of course there is the cakebin  http://cakephp.org/pastes  which is in
 cakeforge in rdos section I think. (uses Geshi which can be used as a
 vendor)  my guess is that there is something in that mythical project
 known as the bakery...

 there are some other php only display dealios that I am sure could be
 used as a vendor.  my guess is that since you are talking about
 display, you should be thinking helper not component ;)
 HTH

 Sam D

 On 8/16/06, John Zimmerman [gmail] [EMAIL PROTECTED] wrote:
  Here is what I want to do.  I have only done a little research, but just
  want to know if anyone has any recommendations.
 
  I want to output the contents of a php file to a webpage so that it will
 
  Display the complete unprocessed code within a box inside my layout
  I would like it to format and do syntax highlighting as well.
  Useable via a component or vendor call in Cake.Basically I just want to
  display php code within a web page.
 
  Something like php.net does with code examples would probably work.
 
  Any ideas are appreciated.
 
  -John
 

 


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



Re: Cannot use Model only for Validation (no table behind) $useTable = false;

2006-08-17 Thread Samuel DeVore
You're right I looked in my own code where I use models for validation only (and for doing email) and I have $useTable = false;perhaps you should paste some source in the bin
http://cakephp.org/pastes/add from your controller and show what you are doing and someone more awake then I might be able to help you. I use the model stuff for validation in a number of places so it could be something simple...
On 8/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
if i use $useTable = null; it throws me this error: No Database tablefor model Sms (expected sms), create it first.

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


Re: Routine Page Tasks

2006-08-17 Thread Samuel DeVore
look up beforeFilter in the manualOn 8/17/06, Simplerules [EMAIL PROTECTED] wrote:
I want to do an routine check of permissions on everypage/visit/execution, where would the best place to put the code be?
Its only a function call, a function set in app_controller, but whereshould I put the call so it executes on every single load?

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


Re: can actions return a value without doing anything with a view

2006-08-17 Thread Samuel DeVore
you might look at the component that nate did for autoCompletehttp://cakeforge.org/snippet/detail.php?type=snippetid=70Sam D
On 8/17/06, codecowboy [EMAIL PROTECTED] wrote:
This seems pretty heavy wieght.I wouldn't want the server to gothrough all of the extra logic of rendering an empty view just tosimulate a function returning a value.Is there another way using cakeor is cake just not meant for ajax enabled applications?

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


Re: Cannot use Model only for Validation (no table behind) $useTable = false;

2006-08-18 Thread Samuel DeVore
See I do use $this-ModelName-validates, but do not use $uses anymore, it just caused needless headaches. If you have access to IRC I would try to jump on and be ready to post source and let the bigger heads help you out. If you post some source in the cakebin 
http://cake.php.org/pastes/add I'm sure many people would be better able to help you.Sam DOn 8/17/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
That is the thin, i to nothin like $this-Model-validates, i only use$uses = array ('..', '..', 'Sms');I think its in the model initialization that causes the startup query
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Re: Filtering Data

2006-08-19 Thread Samuel DeVore

Oh I use it too, I just try to avoid it because I don't want to create
too many dependancies to a particular DB engine, it is far too easy
for me to put mysql specific syntax in there then I loose the
portability that a database abstraction layer buys me.


Now if I was very instinctive about using pure 'sql' I wouldn't worry
too much about it...

IMHO,
   Sam D
On 8/19/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 sam D,

 really you want to avoid the custom sql (using -query) as much as
 possible

 Why? That method seems to work fine. I use query().

 Please elaborate.

 Ralph


 


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



Re: Re: Pagination for hasMany assocation

2006-08-20 Thread Samuel DeVore

You, my good sir, are a tease  ;)
On 8/20/06, nate [EMAIL PROTECTED] wrote:

 Pagination is being added to the core in Cake 1.2.  Using 1.2 you can
 set up basic pagination on models or associated models by doing the
 following in your controller:

 var $paginate = array('limit' = 20, 'order' = ...); // Anything you
 can pass to Model::findAll can be set here

 That's to set the defaults, which can be overridden in POST or URL
 parameters.  You can retrieve the records using the paginate( ) method
 in your actions, as follows:

 $this-paginate('ImageVersion', $this-params); // Assuming
 $this-params contains named arguments like 'page', etc.

 Sorry, there isn't any documentation on this yet, and the API isn't
 even finalized.  I will be working on this, as well as a helper to
 render pagination links in the coming week.


 


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



Re: 's' vs. 'ies' plural for table names

2006-08-21 Thread Samuel DeVore
usually when I am starting a site that might have funky plurals I make a page that calls the Inflector class with the various calls for the words to see what cake thinks the plurals will be, if they are not what I expect, I either add them in the config/inflectors.php or change my thinking ;)
On 8/21/06, nate [EMAIL PROTECTED] wrote:
Our inflector is pretty darn good, and can properly inflect mostEnglish words without any extra hinting.

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


Re: Date Format output

2006-08-21 Thread Samuel DeVore

have you looked at the php date function?  http://php.net/date  or you
can do what I did and make a custom helper function that allows one to
custom format dates.  like

function niceShort($date_string, $format='l j F Y', $return = false)  {
$timestamp = $this-Time-toUnix($date_string);
return($this-output(date($format,$timestamp),$return));
//code here
} // END function

this is 'my' version of the niceShort helper that is in the Time
helper  (notice I use some functions from that helper.  I found that I
was doing this enough that I extended the function for my own use.

 This should give you a starting point ;)

Sam D  (the resident old fart)


On 8/21/06, c_doug [EMAIL PROTECTED] wrote:

 Can someone give me an idea of how to output a date in a certain
 format? In this case I am trying to only output the month in the view.

 Can I add a simple function to:

 $a['Post']['created']

 to make it output just a month or various date formats?

 I have searched but haven't been able to apply what I have found.


 


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



Re: Re: Date Format output

2006-08-21 Thread Samuel DeVore

you need to convert the date string to a unix timestamp before you can
use it in date()  you can use the Time helper function toUnix to
accomplish this or look at
http://us3.php.net/manual/en/function.strtotime.php for the string to
time function.

the unix timestamp is probably your sticker on this

date('mask' $this-Time-toUnix($a['Post']['created']))

should get you closer  (it's all the helper function is doing)

On 8/21/06, c_doug [EMAIL PROTECTED] wrote:

 Thanks, I'll have to try that once I get a little more advanced.

 I am trying to apply different variations of PHP date functions to it.

 I am hoping to put a simple function around the 'created' variable
 above. Something like:
 date('mask', created).


 


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



Re: Conditions Reference

2006-08-21 Thread Samuel DeVore

$this-Model-findAll(array('field' = '= value'))
On 8/21/06, Mikee Freedom [EMAIL PROTECTED] wrote:

 Hey all,

 A quick query.

 I prefer to include conditions as an array but was curious how to set
 conditions other than:

 field = 'value'

 i.e. Model-findAll(array('field' = 'value'))

 Specifically I am trying to grab all records in the last month. But it
 would be good to know if there was a quick reference that listed a few
 examples.

 Anyone know?

 I think someone mentioned something about it here in the groups a
 short while back but I can't seem to find it.

 Thanks again,
 Mike

 


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



Re: Re: Conditions Reference

2006-08-21 Thread Samuel DeVore

no worries ;)  open a ticket on the documentation, it should be in
there, but  couldn't find it either ;)

On 8/21/06, Mikee Freedom [EMAIL PROTECTED] wrote:

 a that simple.

 thanks mate

 On 22/08/06, Samuel DeVore [EMAIL PROTECTED] wrote:
 
  $this-Model-findAll(array('field' = '= value'))
  On 8/21/06, Mikee Freedom [EMAIL PROTECTED] wrote:
  
   Hey all,
  
   A quick query.
  
   I prefer to include conditions as an array but was curious how to set
   conditions other than:
  
   field = 'value'
  
   i.e. Model-findAll(array('field' = 'value'))
  
   Specifically I am trying to grab all records in the last month. But it
   would be good to know if there was a quick reference that listed a few
   examples.
  
   Anyone know?
  
   I think someone mentioned something about it here in the groups a
   short while back but I can't seem to find it.
  
   Thanks again,
   Mike
  
   
  
 
  
 

 


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



Re: dateTimeOptionTag fields

2006-08-22 Thread Samuel DeVore

ok here's your home work  read the http://api.cakephp.org/  (hint you
need to do this in the controller so that is a good place to start,
you are looking to do something with 'fields' so look for that.

have fun fishing

On 8/22/06, Geoff [EMAIL PROTECTED] wrote:

 I was wondering if there is any functionality somewhere to handle the
 way dateTimeOptionTag formats dates, i.e. with _day _month after the
 field name, or do i need to change this into a date field manually?

 cheers!


 


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



Re: Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread Samuel DeVore

So I usually have a .thtml page in my views/pages that looks like


http://cakephp.org/pastes/show/ebb93d95243037fcca3d73ae04c69b72

This lets me test my assumptions about how things are going to work.

Sam D

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



Re: Re: 's' vs. 'ies' plural for table names

2006-08-22 Thread Samuel DeVore

I really need to start a page of the 'old fart's oven o' baking hints'

On 8/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 thanks mate :)


 


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



Re: Re: Date Format output

2006-08-23 Thread Samuel DeVore

make a new helper for yourself that uses the above  (in hindsight I
should of called mine dateWithMask )

in the definition of the helper use $helper = array('Time); then you
can use the existing time helper

I would strongly recommend against changing the existing time helper!



On 8/23/06, c_doug [EMAIL PROTECTED] wrote:

 Can the time helper apply a mask in the view (for example MM/DD/)?

 If not, is the best way to do it to modify the time helper itself in
 the helpers directory?


 


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



Re: Date Format output

2006-08-23 Thread Samuel DeVore
here is my general rule of thumb, if I do something more then twice in views, rather then do it a third time I add it to one of my common helpers, if there is something close already in an existing helper, I try to leverage that work. Every once in a while I revisit and try to refactor my helpers. I have a set of helpers that I share among many projects (they are external checkout of my svn so they are all kept in sync, then there are project specific helpers which I do not keep synced. (I have the same thing for components, and am sure that when 
1.2 roles around I'll have them for behaviors)Sam DOn 8/23/06, c_doug [EMAIL PROTECTED]
 wrote:Right, that's what I was sort of thinking. I think getting more into
helpers is going to interesting. Thanks, again.

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


Re: Date Format in Query

2006-08-24 Thread Samuel DeVore

you should look at the documentation for the database you are using.
in mysql one might do  distinct month(Post.created)   but
reading some documentation would really save yourself some ridicule in
the long run.  If you rely on this list as your crutch people are
going to start getting cranky.  This is really a question that can be
very database specific.

HTH,
   A old fart who is starting to get cranky

On 8/24/06, c_doug [EMAIL PROTECTED] wrote:

 I am trying to make a Archives (by month) section in a blog. How can I
 format a date for use in a query? Example so far:

 $cmonth = date_format(Post.created, 'F');
 $data = $Post-query('SELECT DISTINCT `' .$cmonth. '` FROM posts');

 I was trying to Select Distinct by Month but this only outputs $cmonth
 as a string. Is there an easier, better or more standard way?


 


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



Re: Giving a Form a Name

2006-08-24 Thread Samuel DeVore

yes

that is what the htmloptions parameter is for (use an array)

http://api.cakephp.org/class_html_helper.html#8978c3bdf729602b37160d0a22b8b6ac

On 8/24/06, Simplerules [EMAIL PROTECTED] wrote:

 Is it possible to assign a name tag to a form generated using the
 helper?


 


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



Re: Re: State List

2006-08-24 Thread Samuel DeVore

It would be better to make a page somewhere and link to it and save
the list the traffic.  If people have snippets or small help
instructions that they need a place to host them and are CakePHP
related and are not cakeforge snippet quality and not worthy of the
vapor bakery.  I might be willing to give them a home.

Please contact me OFF LIST about it.

Sam D

On 8/24/06, Brian French [EMAIL PROTECTED] wrote:

 Sorry about that.
 I did it so anyone googling (sry google) for the actual sql for states
 and countries, they would come across it.

 Chris Hartjes wrote:
  That's a cool resource...but next time I wouldn't blast the list with
  all that SQL. ;)
 
 

 


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



Re: sorting recursive find()'s and findall()'s

2006-08-24 Thread Samuel DeVore

you can use http://cakephp.org/search?q=bindModel bindModel to set
associated ordering on demand  (hint look for cakebaker's link)

On 8/24/06, jez [EMAIL PROTECTED] wrote:

 Hi there,
 I was wondering if there's a way to sort on a foreign field when I use
 recursion in my find()'s

 Thanks,
 Jez.


 


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



Re: Re: Date Format in Query

2006-08-24 Thread Samuel DeVore

sorry c_doug, I was trying to be a little lite and facetious and it
failed, I was really trying to point out that your issue was one of
mysql vocabulary and db 'stuff' and not really related to Cake per
say, not that this is not a place to ask those kinds of questions but
also to perhaps guide you to better resources that as a person new to
the environment you might not of been aware of.  Like you said we do
not always know where to look.\.

The being 'cranky' part was related to the self reference of 'the old
fart' again an attempt to be a little silly that failed, after all I
am an old fart and my sense of humor does not jive all the time with
young whipper snappers (again an attempt to be lite)  all the
commentary should be taken or not taken with a grain of salt.

please feel free to ask questions and start threads, and please also
feel free to tell me to 'shut the heck up, you old fart'  as I do
often deserve it  ;)

Sam D (the cranky old fart ;)

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



Re: Re: save data from ONE form to TWO models

2006-08-24 Thread Samuel DeVore

Also if the models are related you can do

if ($this-Answers-User-save(array('User'=$userData) {
 $user_id =$this-Answers-User-lastInsertId();
 $this-params['data']['otherModelData']['userr_id'] = $user_id;
 // now do your save of other stuff



not tested or what ever but gives you the idea, you may want to save
yourself the overhead of $this-requestAction

Sam D

still cranky and still and old fart  ;)
On 8/24/06, Pablo Viojo [EMAIL PROTECTED] wrote:
 Check the object that /users/saveUser is returning, I think it's not only
 an id but a more complex structure.

 Regards,

 --
 Pablo Viojo
 [EMAIL PROTECTED]
  http://pviojo.net



 On 8/24/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  hi, here is my problem: i need to get user_id before saving the answers
  of this user, but after i call $userID =
  $this-requestAction(/users/saveUser), i found that the
 next saving
  action just doesn't work, what shall i do please?
 
 
  my models and controllers:
 
 http://cakephp.org/pastes/show/8be29a861266efcf9943c3d5180fcf98
 
 
 
 
 
 
   
 


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



Re: Re: Checkbox Problem

2006-08-24 Thread Samuel DeVore

you should file a bug in htts://trac.cakephp.org against that (if
there isn't one already) so John can fix it ;)

On 8/24/06, Simplerules [EMAIL PROTECTED] wrote:

 I guess the CakePHP manual is out of date:
 checkbox
 string $fieldName
 array $htmlAttributes
 boolean $return = false


 


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



Re: Error in the Cake Blog tutorial.

2006-08-24 Thread Samuel DeVore

very often this is an indication that your app/config files are not in
sync with your cake core files
see this thread
http://groups.google.com/group/cake-php/browse_thread/thread/6465f8d6ec5b7462/e31177cc5332340a?lnk=gstq=Warning%3A+Invalid+argument+supplied+for+foreach()rnum=4#e31177cc5332340a

On 8/24/06, mrbog [EMAIL PROTECTED] wrote:

 I just installed the latest cakephp release and tried doing the cake
 blog tutorial.  This one:

 http://manual.cakephp.org/chapter/20

 Here is the error I got:

 Warning: Invalid argument supplied for foreach() in
 /www/cakefun/cake/libs/controller/controller.php on line 604

 Warning: Invalid argument supplied for foreach() in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1140

 Notice: Uninitialized string offset: 0 in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1147

 Notice: Uninitialized string offset: 0 in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1149

 Notice: Uninitialized string offset: 0 in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1152

 Notice: Uninitialized string offset: 0 in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1157

 Notice: Uninitialized string offset: 0 in
 /www/cakefun/cake/libs/model/datasources/dbo_source.php on line 1160

 Warning: session_start() [function.session-start]: Cannot send session
 cookie - headers already sent by (output started at
 /www/cakefun/cake/libs/controller/controller.php:604) in
 /www/cakefun/cake/libs/session.php on line 131

 Warning: session_start() [function.session-start]: Cannot send session
 cache limiter - headers already sent (output started at
 /www/cakefun/cake/libs/controller/controller.php:604) in
 /www/cakefun/cake/libs/session.php on line 131

 After that, on the page, I get:

 CakePHP Rapid Development
 List Posts
 Actions

 New Post

 I tried adding a new post, but there are no fields in the form.  I
 click new and go back to this page and get the same errors and no new
 posts.

 I have php 5.1.2. My mysql is 5.0.20 and both are working fine for
 other (non cake) php sites on my server.


 


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



Re: Script to make old projects ready for cake

2006-08-24 Thread Samuel DeVore

No I have not, but I will gladly use yours.  You know to help you test it ;)

On 8/24/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Does anyone have some sort of script or utiltiy that you could use to
 make an old project ready for cake?

 could be php, or a series of mysql queries on itself...

 i think about for example: go through each table in a certain database
 and change every unix timestamp in mysql datetime, or go through each
 table and replace each occurrence of id with _id, stuff like that
 ;)

 if nobody has something like that i will probably write it myself, but
 first i want to check ;)


 


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



Re: Ajax in Cake

2006-08-25 Thread Samuel DeVore

http://grahambird.co.uk/cake/tutorials/ajax.php

On 8/25/06, carlosrg [EMAIL PROTECTED] wrote:

 Hi

 Anybody knows how to use ajax in cake???

 Yes I'm a newbie and i have no idea how to do it. Would you be so kind
 as explain me how i can do it? Or where can i find a good tutorial?

 Thanks a lot!!!


 


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



Re: Re: Error in the Cake Blog tutorial.

2006-08-25 Thread Samuel DeVore

Alright a couple of questions...

Are you one php5 or 4?
If 4 make sure that you have $name set in models and controllers  like
var $name = 'Post';  // in your model files
var $name = 'Posts';  // in controller files
Did you double check all of your pluralizations
refer to models always as singular CamelCase
refer to contollers always as plural CamelCase
What is your debug level set to in /config/core.php
   If it is 1 try 2 and this should get it to spit out some of the sql
information, it might be an error there that we will see that can help
us.  could be a connection problem or table naming issue that might
help track down the problem




On 8/25/06, mrbog [EMAIL PROTECTED] wrote:

 That is not my problem. I'm not overwriting another cake install. I'm
 not using the non-release version.  This is a clean install of the most
 recent cake release.


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

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



Re: using functions in elements

2006-08-25 Thread Samuel DeVore

sounds like a job for a helper
http://manual.cakephp.org/chapter/helpers  (look at the bottom for
info about creating your own)

On 8/25/06, cyberlogi [EMAIL PROTECTED] wrote:

 I have a recursive function that i'd like to use to optimize printing
 data from a multidimensional array. If i put the function in my view or
 element, then cake tells me that the function doesn't exist. Where
 should i put this function?


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

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



Re: Re: $this-flash() Problem

2006-08-26 Thread Samuel DeVore

Which brings to mind one of my favorite acronyms
PEBKAC

http://en.wikipedia.org/wiki/PEBKAC

;)  glad you found your problem


On 8/26/06, Jason Lee [EMAIL PROTECTED] wrote:

 OK.  Mystery solved.  The root cause was a hole in my understanding of
 the API, and a stupid typo.  In AppController, I overrode render() to
 set some variables in the view for each request.  After digging
 through the API source, I was reminded of beforeRender() which does
 what I was trying to do in overriding render().  Once I changed the
 method to that, things started working again.  At that point, I
 realized that in my render() method, when I called the method on the
 parent class, I failed to pass along the three parameters.

 So.   User error.  Thanks to all that helped. :)

 --
 jason lee
 http://www.steeplesoft.com
 http://blogs.steeplesoft.com
 http://littlezoper.livejournal.com

 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

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



  1   2   3   4   5   6   7   >