Re: $number->precission not working in controller

2007-04-19 Thread Dr. Tarique Sani
On 4/20/07, Joshua McFarren <[EMAIL PROTECTED]> wrote: > Still... does anyone have a suggestion for a way to make sure totaldue > is rendered in two decimal places? Huh! printf("%01.2f", $totaldue) doesn't work? T -- = PHP for E-Biz:

Re: $number->precission not working in controller

2007-04-19 Thread Jeremy David Pointer
Look at phps sprintf function? Joshua McFarren wrote: >Ok, ok, I looked again at the manual and helpers are mean to provide >functions that are commonly needed in views etc. So I guess this was >stupid not easy. Also I misspelled precision in the subject AND my >corner cases are not fully checke

Re: Cake app not running, index.php offered for download

2007-04-19 Thread Daniel Kvasnicka jr.
Hey Poncho, I'm sure the server can handle PHP somehow. I've replaced /app/webroot/ index.php with another 'index.php' with only phpinfo() in it and I got the output without problems...so there is something in Cake that's not behaving :( Unfortunately, I have no chance to see apache2.conf/ httpd.c

Cookies

2007-04-19 Thread strykstaguy
Anyone familiar with RosSoft's Cookie Component ? I am trying to use it with CakePHP 1.1.14.4797. The error I am getting is Notice: Undefined property: CookieComponent::$crypt in E:\Program Files \xampp\htdocs\dts\app\controllers\components\cookie.php on line 97 Fatal error: Call to a member fu

Re: $number->precission not working in controller

2007-04-19 Thread Joshua McFarren
Ok, ok, I looked again at the manual and helpers are mean to provide functions that are commonly needed in views etc. So I guess this was stupid not easy. Also I misspelled precision in the subject AND my corner cases are not fully checked ($,100,000.0) with that regex! Still... does anyone have

$number->precission not working in controller

2007-04-19 Thread Joshua McFarren
This is probably an easy answer but I give up. Why doesn't the number helper work in my controller when it works fine in my views? class InvoicesController extends AppController { var $name = 'Invoices'; var $helpers = array('Html', 'Form', 'Javascript', 'Ajax', 'Number');

Re: Passing data from controller to view

2007-04-19 Thread Geoff Ford
How are you accessing the data in the view. It is ussually accessed like To ouptut the name field of the customer table. On Apr 20, 12:22 pm, ben <[EMAIL PROTECTED]> wrote: > Hi, > > I have a newbie question. > > In my controller, when I do a set() like, > > $customers = $this->Customer->fi

submitting Ajax->form with javascript freezes browser

2007-04-19 Thread [EMAIL PROTECTED]
I have an ajax form that i want to submit using javascript. I created a input button that onclick submits my form. When i use this method (button test1) firefox freezes/crashes. If i click the normal submit button, everything works as expected. Why cant i submit the ajax form via javascript? Is t

Re: Unbinding Behaviors

2007-04-19 Thread Dr. Tarique Sani
On 4/19/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > Am I insane or you are always looking to change method names? ;) > You are insane! T -- = PHP for E-Biz: http://sanisoft.com Cheesecake-Photoblog needs you!: http://cheesecak

Re: Your client and cakePHP

2007-04-19 Thread Chris Lamb
beetlecube wrote: > Have you received complaints from the client, when they have tried to > add a page on their own, ? like: "This cakephp stuff is complicated, > and I just want to add another page that accesses the database, and I > didn't know you have to create three different files for it. I

Passing data from controller to view

2007-04-19 Thread ben
Hi, I have a newbie question. In my controller, when I do a set() like, $customers = $this->Customer->findAll(); $this->set('customers', $customers); I cannot access $customers in my view. I get an error saying undefined variable. However when I set it in the data, I can access it fine. $this

RE: Silly HTTPS quesiton...

2007-04-19 Thread Paul Webster
7;d like to send a user to a HTTPS url for a secure connection. All subsequent links around the site need to maintain this. How is this accomplished in cake? __ NOD32 2205 (20070419) Information __ This message was checked by NOD32

RE: Silly HTTPS quesiton...

2007-04-19 Thread Mariano Iglesias
I did this some months ago: http://groups.google.com/group/cake-php/browse_thread/thread/f603fbcad492144 f But in your case if you are redirecting them to HTTPS then Cake will keep that since its links do not include http:// portion. -MI

Manipulation of conditions - question for Cake development team

2007-04-19 Thread Langdon Stevenson
I have a situation where I would like to achieve the following query: SELECT [fields] FROM [Model] WHERE CONCAT([Model.field], 'some value') IN ([List of Values]) Given the way that specifying an array of conditions works currently in Cake I cannot achieve this output. Instead I write out the

Documentation for HABTM deleteQuery syntax is where, exactly?

2007-04-19 Thread [EMAIL PROTECTED]
http://www1.thedilly.com/pics/this-is-why-this-method-sucks.png Google wont let me reply to topics, so here's a new one with my own problem. I can't find documentation on how to use the deleteQuery under the HABTM relationship defined in the model. Where is the syntax for this? --~--~-~

migration of website

2007-04-19 Thread laptop
hey guys, i want to port my current website over to cakephp and add some nify features along the way, however Im not fully inside the cake paradigm yet and so want to do things the best way, the first wall I have hit is.. 1. I have two different types of users, they are relative the same however

Silly HTTPS quesiton...

2007-04-19 Thread [EMAIL PROTECTED]
Upon login, I'd like to send a user to a HTTPS url for a secure connection. All subsequent links around the site need to maintain this. How is this accomplished in cake? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Re: Manual invalidate in 1.2

2007-04-19 Thread GreyCells
Rather than fighting the framework, why not use two non database fields in your form - new_passwd and confirm_passwd. Validate these fields if they are set in validates() - raising validation errors ($this->invalidate('new_passwd', 'error_msg')) if they don't match/ too short/weak etc. Then (agai

Re: Correct component usage?

2007-04-19 Thread Poncho
Agreed, Jcs is correct, data-related tasks should be taken care of in the model. In this case, you could re-use the getArea method in your model like so: function getArea($id) { $this->id = $id; switch ($this->data['type']) {

Re: Correct component usage?

2007-04-19 Thread jcsiegrist
I think the property calculations belong into the model. Maybe an even better place would the new 1.2 behaviors. Either way you calculate the properties within the callbacks afterFind, or if you decide to store the calculation results in the db after all you can just call your calculation routine

Re: Correct component usage?

2007-04-19 Thread Poncho
Hey Brian, At the moment, there is no standard way to send parameters to your component on instantiation, but Cake 1.2 will very soon introduce the "initialize" method in the component, so it's a safe bet to use that. Here is a quick shape component I threw together. controller =& $controller;

Re: Cake app not running, index.php offered for download

2007-04-19 Thread Poncho
Hey Daniel, Are you sure the Apache Server is configured to catch .php files and use them in DirectoryIndex? It sounds like you need to add something like the following to a .htaccess file: LoadModule php4_modulelibexec/httpd/libphp4.so AddModule mod_php4.c AddType application/x-htt

Display multiple levels with adjacency list model

2007-04-19 Thread Poncho
Hey guys, This may be a stupid question, but I've looked around the internet and Googled with no results. I want to show a complete hierarchy of the Pages model. I want it to be displayed using s with 'root', 'parent', 'child' & 'grandchild' css classes set. I have tried using Cake's built-in fi

Manual invalidate in 1.2

2007-04-19 Thread hepper
If some could explain hove to invalidate a field manual in the controller in 1.2. In 1.1 you could invalidate a field and then call save without parameters, then set wouldn't be called and the invalidated fields didn't get erased as nate explains here http://groups.google.com/group/cake-php/browse

Correct component usage?

2007-04-19 Thread bej78729
I am trying to get my head wrapped around using components. I've got a table of rectangles. A typical record would be an id, width, and height: id : 2x4 b: 1.5 h: 3.5 I've got the typical setup: M: Rectangle C: RectanglesController V: index, add, edit, view I would like to calculate other prope

Re: scaffold in admin

2007-04-19 Thread hydra12
I'm not sure if I understand exactly what you want, but here goes: if you want to scaffold your admin_ views but not any of your other views, I don't think you can (officially). When you scaffold a controller, it scaffolds everything (I think). What you can do is use bake to create your basic co

Cake app not running, index.php offered for download

2007-04-19 Thread Daniel Kvasnicka jr.
I've installed a Cake app to a client's server and I'm getting a blank screen with mod_rewrite and index.php offered for download without mod_rewrite. The server is using PHP 4.4.2/Apache (http://www.rosamusic.cz/ info.php). On my local Apache and on a test server the app was working like a charm

RE: setAction - reading the parameters

2007-04-19 Thread Mariano Iglesias
unction manage_employees() { $args = func_get_args(); $delete_employee = $args[0]; } Is there a better way to access the passed parameter in the action manage_employees above - other than $args[0]? Thanks, Quang __ Información de NOD32, revisión 2205 (20070419) _

setAction - reading the parameters

2007-04-19 Thread [EMAIL PROTECTED]
Hi all, When using setAction to redirect to another controller action, the parameters are passed such that they can be retrieved via func_get_args(). Looks like this: // the delete action should be redirected to the manage action function delete($id = null) { $this->setAction('ma

scaffold in admin

2007-04-19 Thread LLoBu
I´m using CAKE_ADMIN to protect admin scaffold. I don´t know how to use in, for example: class Travels_Controller extends AppController { function index(){ // show all travels } function show_one($id){ // controller to show one travel } function admin_travels(){ // here i

Bad link without mod rewrite

2007-04-19 Thread sickrandir
I'm running a site with the latest stable version of cake 1.1 . I disabled mod rewrite by uncommenting: define ('BASE_URL', env('SCRIPT_NAME')); in core.php and deleting all the .htaccess file. Everything seems to work except for the link inserted in the posts of the home page. The first time you

Re: How to user model in components

2007-04-19 Thread Genius_kld
Thank U! I found solution! url is useful; On 19 апр, 19:49, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > I am in no way endorsing this as a good way to go (I say this so Nate > will not bite my head off) but look at this > >

Re: How to user model in components

2007-04-19 Thread Samuel DeVore
I am in no way endorsing this as a good way to go (I say this so Nate will not bite my head off) but look at this On 4/19/07, Genius_kld <[EMAIL PROTECTED]> wrote: > > On 19 апр, 19:15, "Samuel DeVore" <[EM

Re: How to user model in components

2007-04-19 Thread Genius_kld
On 19 апр, 19:15, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > Did you search the google group for some help? See if there is any help here > > > nothing useful found; this realisation works: function startup(&$controller)

Re: How to user model in components

2007-04-19 Thread Samuel DeVore
Did you search the google group for some help? See if there is any help here On 4/19/07, Genius_kld <[EMAIL PROTECTED]> wrote: > > how to USE > > sorry > > > > > -- (the old fart) the advice is free, the lack of crankiness

Re: How to user model in components

2007-04-19 Thread Genius_kld
how to USE sorry --~--~-~--~~~---~--~~ 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

RE: Unbinding Behaviors

2007-04-19 Thread Mariano Iglesias
Touché. -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -Mensaje original- De:

How to user model in components

2007-04-19 Thread Genius_kld
hi! How can I use model 'User' in my Authorize component? var $uses = array('User'); doesn't work so, $this->User->find(...) in component makes error: Call to a member function findCount() on a non-object in... what is wrong? --~--~-~--~~~---~--~~ You received

Re: Unbinding Behaviors

2007-04-19 Thread Samuel DeVore
On 4/19/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > Am I insane or you are always looking to change method names? ;) > Do we only get to pick one? -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot http://

RE: Unbinding Behaviors

2007-04-19 Thread Mariano Iglesias
Am I insane or you are always looking to change method names? ;) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www

Re: validate with SwfUpload

2007-04-19 Thread eKiTeL
thanks Tarique! --~--~-~--~~~---~--~~ 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 mo

Re: findAll for hasOne - belongsTo

2007-04-19 Thread [EMAIL PROTECTED]
$this->Rubric->hasMany['Post']['limit'] = 1; then $this->Rubric->findAll('id=1','','',1); (with limit = 1 and for Rubric & for associated posts ;-) Sorry for all, and thanls Madman for comments (in icq) On 19 апр, 17:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have to table: > > Ribri

Re: Unbinding Behaviors

2007-04-19 Thread Dr. Tarique Sani
On 4/19/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > It doesn't sound bad to implement an unbindBehavior(), bindBehavior(), what > do you think gwoo? Whats with this obscure naming? how about actAs() and dontActAs() ;) T -- = PHP

Re: Error while uploading files

2007-04-19 Thread Samuel DeVore
http://us2.php.net/manual/en/features.file-upload.errors.php don't forget that the php in CakePHP is for PHP and many answers can also be found at http://php.net wink wink On 4/19/07, Davide <[EMAIL PROTECTED]> wrote: > > I've developed a simple file upload. Everything in development and > test

Error while uploading files

2007-04-19 Thread Davide
I've developed a simple file upload. Everything in development and test environment goes fine but not in production environment. The procedure is the simple move_uploaded_file() plus some operations on database. It failed to upload and In logs I got the following 2007-04-19 16:12:35 [UploadsCont

findAll for hasOne - belongsTo

2007-04-19 Thread [EMAIL PROTECTED]
I have to table: Ribrics & Post Post belongsTo Rubric and, of couse Rubric = hasMany Post. So. When I ask: $data = $this->Rubric->findAll('id = 1','','',1); I get 2 query: First with LIMIT = 1 SELECT `Rubric`.`id`, `Rubric`.`title` FROM `rubrics` AS `Rubric` WHERE id = 1 LIMIT 1 And secon

RE: Unbinding Behaviors

2007-04-19 Thread Mariano Iglesias
Yeah, but he'll also have to touch Model::behaviors as you can see here: foreach ($this->actsAs as $behavior => $config) { $className = $behavior . 'Behavior'; //... $this->behaviors[$behavior] =& new $className; } Since model core code will always deal with this array an

Re: Want to learn Cake PHP

2007-04-19 Thread Dr. Tarique Sani
On 4/19/07, Rumana <[EMAIL PROTECTED]> wrote: > > There is lots of tutorial for cake php, but for beginners there is no > easy manual. can anyone help to learn cake php? plz help me. > Lets begin with some questions How much of a beginner you are to PHP? Which tutorials did you try and where did

Re: Want to learn Cake PHP

2007-04-19 Thread Daniel Hofstetter
Try the blog tutorial from the manual: http://manual.cakephp.org/appendix/blog_tutorial . It is for beginners. Good luck :) -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Want to learn Cake PHP

2007-04-19 Thread Rumana
There is lots of tutorial for cake php, but for beginners there is no easy manual. can anyone help to learn cake php? plz help me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this gr

Re: Global css navigation menu from DB

2007-04-19 Thread double07
Hi Andrew, I tried what you suggested, unfortunately I still get the error mentioned above. Cheers. On Apr 18, 10:22 pm, Andrew McCafferty <[EMAIL PROTECTED]> wrote: > Firstly, the $name of AppController isn't "Nodes" so remove that > line... > > Try replacing it with: > > var $uses = array('No

Re: Cake has lost its Way!

2007-04-19 Thread jazz_snob
I am having a similar problem, maybe you have some insight? Installed cake in http://192.168.0.3/~tom/cake/cake by adding RewriteBase /~tom/cake/cake to .htaccess in /home/tom/public_html/cake/ cake. When i access http://192.168.0.3/~tom/cake/cake/users/register i get 404 error. This noob appre

Re: Unbinding Behaviors

2007-04-19 Thread AD7six
On 19 abr, 01:14, cperler <[EMAIL PROTECTED]> wrote: > Hello, > > Might anyone know of a way to unbind a behavior from a model? > > Thank you, > > Craig Hi Craig, Could you explain why you would want to? AFAIK there is no inbuilt mechanism to remove a behavior that has already been added to a

Re: allowEmpty in validate

2007-04-19 Thread GreyCells
This makes it nice an easy to filter (i.e. remove) empty fields Nate, but it would be great to see Cake help developers maintain proper database state. i.e.: - change #2092 from allowBlank to allowNull - in save() set any empty (as in they are set to an empty string) fields to null, so the datab

Re: sanitizing data with beforeValidate

2007-04-19 Thread ianh
http://pastebin.co.uk/13204 Usage: Place method in your app_model and call with the beforeValidate callback also placed in your app_model function beforeValidate() { $this->__sanitize($this->data); return true; } In every model of your app include the var $allowedChars = array()

Re: allowEmpty in validate

2007-04-19 Thread GreyCells
You should care about empty strings. An empty string is not null, so SELECT ... WHERE col IS NULL; will return a different record set to SELECT ... WHERE col = ''; It will also effectively invalidates any NOT NULL constraints on your database - an empty string is not null. ~GreyCells On Apr 18,