Re: How to upload image? Please give me a example,thanks!

2006-08-16 Thread John Zimmerman [gmail]
After you make the changes you can post back with code and/or errors if you are still having problems.If you paste your code into a bin at http://cakephp.org/pastes/add we can look at your code easier and apply changes.Just post back with your problem and a link to your bin.On 8/15/06, georgeL

Re: How to upload image? Please give me a example,thanks!

2006-08-16 Thread JitZhang
$this-params['form']['file'] it 's what mean? save($this-params['form']['data']['Product']['imgna­me']['tmp_name'], $this-params['form']['data']['Product']['imgname']['name'], $directory=img/, $overwrite=false) ; is right? but $this-params['form']['data']['Product']['imgna­me']['tmp_name']

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

2006-08-16 Thread Michal Bilcik
Nazdar, 15. 8. 2006, Samuel DeVore napisal: some examples can be found at http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/ Sam D Thanks, it works: $this-WaypointType-bindModel(array('hasMany' = array('Waypoint' =array('foreignKey' = 'waypoint_type_id',

Re: MySQL Dump and Restore with Cake

2006-08-16 Thread teemow
there is a script for database migrations: http://wiki.cakephp.org/tutorials:cake_migrations i started adding some command line options to run the migrations automatically in a deploy script and to migrate test and default database. so you can theoretically do the same thing in your tests. but i

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

2006-08-16 Thread Jon Bennett
In different situations in my application I need use different conditions in model assocciations and every time i must use bindModel or there is another way how to do it ? you could create multiple associations in your models (you can link the 2 same models using different names as many times

Help Grasping HABTM...

2006-08-16 Thread j o e l
Hello, All. I hope you don't mind my posting another HABTM issue here. I've been trying to get this to work, and I'm sure I'm just missing something basic. I've been a little confused reading the manual, the google groups, etc. If you don't mind, I'll just post what I'm trying to do and then my

Help in Associations

2006-08-16 Thread Mandy
Hello Everyone, I am trying to create an application where I have currently 2 tables - a) users (id/username/password/email/name/created/modified) b) profiles (lots of blah) The association would be user hasOne profile and profile belongTo user. Now, when I am signing the user up, my

Create Hyperlinked Images within a Auto Cascading Table PHP

2006-08-16 Thread Flickle
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written

Create Hyperlinked Images within a Auto Cascading Table PHP

2006-08-16 Thread Flickle
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written

Create Hyperlinked Images within a Auto Cascading Table PHP

2006-08-16 Thread Flickle
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written

Create Hyperlinked Images within a Auto Cascading Table PHP

2006-08-16 Thread Flickle
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables they show images i need these images to hyperlink to other HTML pages... Note these tables are written

How to operate relational database in cakephp

2006-08-16 Thread [EMAIL PROTECTED]
hi,guys: I am new in Cake. so can any one please tell me how to solve the issue below: There are two tables : Clients and Sites,one client has many sites(client_id is the foreign key in table Site).Now I want to create a thtml page in which users can add Client's information PLUS

Re: API documentation needs stylesheet change

2006-08-16 Thread [EMAIL PROTECTED]
Wow! Fast work, gwoo and John. That is most helpful. You guys rock. Thank you. Best regards, Ralph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Routing question

2006-08-16 Thread Jon Bennett
Hi, I have a few controllers, Pages (custom),News,Reports etc and on the front end I'd like to loose the method names from my URLs, eg: www.mydomain.com/news/category/category_name becomes www.mydomain.com/news/category_name and www.mydomain.com/news/article/article_name becomes

Re: Dynamic Navigation Menu

2006-08-16 Thread codecowboy
Second part of my question = 'There is an extra problem, each link in every menu requires arguments (like /user/view/32)'. Our site is going to allow registered users to build profiles. These profiles will be muilt-paged. We are using a navigation menu to take people to different pages inside

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

2006-08-16 Thread [EMAIL PROTECTED]
HI everybody, I want to use a model only for my validation logic! So i set my model up with $useTable = false, but then cake generates a startup query on my database. How can i fix that problem? My CakeVersion is CakePHP 1.1.7.3363 The SQL Log says: 3 startup 1064: You have an error in

Need dynamic database config

2006-08-16 Thread [EMAIL PROTECTED]
I need a dynamic db config. I have to pick the name of the database i want to connect from my session data. In The irc channel someone told my that i have to put this in an before filter method: var $beforeFilter = array ('_selectDatabase'); and in my method: function _selectDatabase ()

$html-checkbox() and database field enum('true','false')

2006-08-16 Thread [EMAIL PROTECTED]
I have a database table with a field of type enum('true','false') to represent boolean data. I'd like to use HtmlHelper's checkbox function to edit values for this field. This seems to work fine if the user checks the checkbox, but leaves the db field blank if the user doesn't check the

Re: API documentation needs stylesheet change

2006-08-16 Thread purepear
Much better now ! 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

Re: $html-checkbox() and database field enum('true','false')

2006-08-16 Thread Brian French
As i understand how the forms and the $_POST/$_GET variables work:If it's a checkbox and it's not checked, it doesnt show up in the $_POST/$_GET (could be wrong, didnt test)You may want to consider either checking if it exists and if it doesnt, then set the value, or you could use a radio button

Re: Routing question

2006-08-16 Thread nate
The who_we_are part vanishes from the URL because you specified it as a static element within your route. This route: $Route-connect ('/who_we_are/', array('controller' = 'pages', 'action' = 'index','who_we_are')); matches your first URL (/who_we_are/) because you have who_we_are and nothing

Re: How to operate relational database in cakephp

2006-08-16 Thread Chris Hartjes
Um, I think this is a question that goes beyond CakePHP. This is basic how to create a page that has a form that you can submit. In this case, I'd build the page just like it was another PHP page and use the built-in HTML and form helpers to point the form submit to your controller/action

Re: Routing question

2006-08-16 Thread nate
The who_we_are part vanishes from the URL because you specified it as a static element within your route. This route: $Route-connect ('/who_we_are/', array('controller' = 'pages', 'action' = 'index','who_we_are')); matches your first URL (/who_we_are/) because you have who_we_are and nothing

Notice: Only variable references .. in adodb-mysql.inc.php on line 75

2006-08-16 Thread Voodoo
I have CakePHP in production and having some problem 1. It is shared hosting and no access to httpd.conf Access to only /home/myusername /home/myusername/public_html 2. Setup /home/myusername/app /home/myusername/cake /home/myusername/vendors (- has adodb)

Re: AJAX Update div not working

2006-08-16 Thread josh southern
I figured out all the problems. Being new to this whole Prototype thing, I had downloaded the latest version of Prototype from the Prototype website (version 1.4), then downloaded Scriptaculous. I just noticed that the Scriptaculous download contains the *actual* latest version of the Prototype

Re: Routing question

2006-08-16 Thread Jon Bennett
This route, on the other hand: $Route-connect ('/who_we_are/*', array('controller' = 'pages', 'action' = 'index', 'who_we_are')); still matches /who_we_are/, but it also matches anything after it. The problem is, the two routes are effectively the same. All you're doing by passing

Re: AJAX Update div not working

2006-08-16 Thread nate
Thanks for the update Josh, that's actually really helpful. I had heard a few reports of things crashing (actually, the week after I wrote the Ajax div stuff, Apple released a new version of Safari that crashed on it occasionally :-/). Glad you sorted it out.

Re: Routing question

2006-08-16 Thread Jon Bennett
ahh, got ya, haev found a workaround, which seems to work fine, what do you think? function index () { (!empty($args[0])) ? $category = $args[0]: $category = null; (!empty($args[1])) ? $handle = $args[1]: $handle = null; (!empty($args[2])) ? $subHandle = $args[2]:

Re: Routing question

2006-08-16 Thread nate
The other thing you could do is accept the parameters explicitly, as in: function index($category = null, $page = null) { // ... } Makes handling the var switching a little easier IMO. --~--~-~--~~~---~--~~ You received this message because you are

Re: Inheritance on models

2006-08-16 Thread bwaters
Is anyone else dong inheritance with models. Is this a good approach? --~--~-~--~~~---~--~~ 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

Re: More than one way to skin a concatenate... (generateList)

2006-08-16 Thread Mini Mouse
[EMAIL PROTECTED] wrote: Mini, That's a great suggestion. I'm also using sql views (not to be confused with Cake views!) to make things easier in my project. Incidentally, I wonder if the use of Postgres could reduce the number of steps in that solution by means of triggers. I suspect a

Re: Deployment

2006-08-16 Thread bwaters
I use sitecopy with a custom shell script to do an automatic update. On my todo list is to implement phing to get an ant style build and deploy http://phing.info/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: How to upload image? Please give me a example,thanks!

2006-08-16 Thread Mikee Freedom
ah i was curious about that. i converted it in to an object and used it as a component from my controller, but it would make more sense to be able to have access to the file handling functions from my file model. so, if i convert it back to a model and put it in my /app/models/ then i can

Optimizing cake projects

2006-08-16 Thread bwaters
I'm almost through with our project and it's time to do some performance optimizations. I wanted to start a thread to report my progress and share tips/hints. Here is my plan. Setup a semi realistic test - I'm using microsoft web stress tool - it's free and I use windows to develop (fedora to

Re: How to upload image? Please give me a example,thanks!

2006-08-16 Thread bwaters
In a model you can do a $var = new Filehandler; to load another module. Just don't put it in the constructor or you'll run into problems (http://groups.google.com/group/cake-php/browse_thread/thread/6d5c9a0cc142c453/8ceb79c8ed116a9e) Is there a better way to do this with the class registry

Re: Help Grasping HABTM...

2006-08-16 Thread j o e l
Thanks, Chris. I'll try looking at some Ruby stuff, also. I've poured over the manual so many times, as well as doing searches on this group listing, and checked out the wiki. I'm just not seeing what I've done wrong. If anyone sees my mistake, I'm more than willing to learn from it. I just

Re: AJAX Update div not working

2006-08-16 Thread sicapitan
I get safari crashing on me when I'm logging in. I'm not sure how to fix it really :) Everything else works fine, even IE! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group,

Re: Routing question

2006-08-16 Thread Jon Bennett
The other thing you could do is accept the parameters explicitly, as in: function index($category = null, $page = null) { // ... } Makes handling the var switching a little easier IMO. I would still need to split the url from the params though, as I need the route for certain pages,

Re: Tree structures

2006-08-16 Thread John David Anderson (_psychic_)
On Aug 16, 2006, at 1:55 PM, Wilm wrote: Hello, First I'd like to thank the developers on the CakePHP project. It's a great framework and it made things a lot easier. I got my new news system up and running in no time and my boss was real happy with it. The old news system was a big mess

Re: Make AJAX call from onLoad event

2006-08-16 Thread [EMAIL PROTECTED]
My answer ?php echo $ajax-Javascript-event('window','load', $ajax-remoteFunction(array('update'= 'menu', 'loading'=

Trying CakePHP for the first time and get error

2006-08-16 Thread [EMAIL PROTECTED]
I get the following warnings after I unzip cake into my htdocs Apache directory and then launch cake from my localhost. I'm using XAMPP and my Apache has started successfully. I must have some directory settings not set correct somewhere. Warning: opendir(C:\Program

Re: API documentation needs stylesheet change

2006-08-16 Thread John Zimmerman [gmail]
All I did was file the ticket.I don't do any actual work :-)Thanks gwoo/nate.On 8/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Wow! Fast work, gwoo and John. That is most helpful. You guys rock.Thank you.Best regards,Ralph --~--~-~--~~~---~--~~ You received

Re: How to associate models without tables?

2006-08-16 Thread John Zimmerman [gmail]
You can setup a database table that is basically an index into your file system.This might be helpful if you want to store metadata about the files as well. Gallery does this for images too.So your table would have and id, name, description, location, etc, and a path field. The path field is where

Polymorphism in Cake Models

2006-08-16 Thread [EMAIL PROTECTED]
Does anyone know if Cake supports polymorphism? If so, is there a good place for me to read up on it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Outputting Code on a Website

2006-08-16 Thread gwoo
Check out cakebin. http://cakeforge.org/projects/rdos --~--~-~--~~~---~--~~ 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,

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

Re: Outputting Code on a Website

2006-08-16 Thread Chris Lamb
Hi On Wed, 16 Aug 2006 15:19:59 -0700 John Zimmerman [gmail] [EMAIL PROTECTED] wrote: Basically I just want to display php code within a web page. GeSHIi[0] seems to be the de-facto library for doing this. Chris [0] http://qbnz.com/highlighter/ -- Chris Lamb, Cambs, UK

can actions return a value without doing anything with a view

2006-08-16 Thread codecowboy
Hi, I want to make an ajax call to to a controller action that simply returns data that is retrieved from the database. I don't want the action to render a view or anything extra ex. pseudo code: 1 var temp 2 ...onclick - make ajax call 3 store value returned from ajax call in temp 4 print

Help for a New User... Please!

2006-08-16 Thread Llama Llama Llama
I'm sure there is someone on here who can help me. I am just getting my feet wet with CakePHP, and I've hit several roadblocks. I know all of them have to do with mod_rewrite, but I don't know how to fix them. One of the big problems is that my server won't allow mod_rewrite to be accessed

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

2006-08-16 Thread John David Anderson (_psychic_)
On Aug 16, 2006, at 4:36 PM, codecowboy wrote: Hi, I want to make an ajax call to to a controller action that simply returns data that is retrieved from the database. I don't want the action to render a view or anything extra ex. pseudo code: 1 var temp 2 ...onclick - make ajax

Re: Help for a New User... Please!

2006-08-16 Thread John David Anderson (_psychic_)
On Aug 16, 2006, at 4:39 PM, Llama Llama Llama wrote: I'm sure there is someone on here who can help me. I am just getting my feet wet with CakePHP, and I've hit several roadblocks. I know all of them have to do with mod_rewrite, but I don't know how to fix them. One of the big problems

Re: AJAX Update div not working

2006-08-16 Thread [EMAIL PROTECTED]
josh southern wrote: For IE - that ended up being a problem with my Norton Internet Security Popup Blocker. If I disable that (or add the site I'm working on to the white list), everything works perfect in IE as well. That's really disturbing to me. I'm working a very large app that relies

Re: Optimizing cake projects

2006-08-16 Thread gwoo
@bwaters APC has worked well for me, seemed faster than all the others persistModel is a beauty and largely mitigates any need for view caching one thing to look at if you have a lot of associations is using unbindModel to remove any associations that will not be used for the particular

Re: API documentation needs stylesheet change

2006-08-16 Thread gwoo
Ralph thanks for sparking the fire and submitting some styles. John the ticket was needed, thanks for adding it. The time needed to fix it was trivial, the reason to fix it was not. Bake on. --~--~-~--~~~---~--~~ You received this message because you are

Re: Outputting Code on a Website

2006-08-16 Thread John Zimmerman [gmail]
It looks like CakeBin is using GeSHli (which looks like what I was looking for).Thanks for the replies.On 8/16/06, Chris Lamb [EMAIL PROTECTED] wrote:HiOn Wed, 16 Aug 2006 15:19:59 -0700 John Zimmerman [gmail] [EMAIL PROTECTED] wrote: Basically I just want to display php code within a web

Re: How to associate models without tables?

2006-08-16 Thread [EMAIL PROTECTED]
Good Idea. The flexiblity of not having to have a database table for every model would nice though. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: How to associate models without tables?

2006-08-16 Thread John Zimmerman [gmail]
The flexibility of not having a table would only be short term however.When it comes time to add features or expand your application you might be finding yourself needing to add the table anyway.It is a little more work upfront, but in the long run it can save you some headache. On 8/16/06, [EMAIL

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

2006-08-16 Thread codecowboy
So does that mean that the original view which makes the ajax call has access to variables that the returned view has access to? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post

Re: Getting Cake to work without access to the apache config file

2006-08-16 Thread [EMAIL PROTECTED]
What I'm trying to to is use a url like mysite.com/users instead of mysite.com/cake/index.php/users and instead of mysite.com/cake/users --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

how do you get beforeRender to work?

2006-08-16 Thread cyberlogi
i've added this function to my appController. as far as i know this should be called automatically by every controller on my site, however, none of them do. what am i doing wrong? -thanks function beforeFilter() { echo WTF; $this-set('userID', 0);

Re: how do you get beforeRender to work?

2006-08-16 Thread cyberlogi
i've tried added $beforeFilter = array('beforeFilter'); and it still does nothing --~--~-~--~~~---~--~~ 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

Re: How to operate relational database in cakephp

2006-08-16 Thread Don DeCosta
Chris Hartjes wrote: Um, I think this is a question that goes beyond CakePHP. This is basic how to create a page that has a form that you can submit. I have the same question and I think it is a CakePHP question. I've got a view up that shows me a Client and lists its Sites and I've got a

Re: Polymorphism in Cake Models

2006-08-16 Thread John David Anderson (_psychic_)
On Aug 16, 2006, at 6:23 PM, nate wrote: Are you new to PHP? Cake is written in PHP, and PHP does not support polymorphism. So no, Cake does not support polymorphism. You might be able to get by using some nice PHP5 functions, though: class_implements() class_parents() is_subclass_of()

Re: how do you get beforeRender to work?

2006-08-16 Thread cyberlogi
Nevermind, something elsewhere wasn't loading right and it was preventing my beforeFilter action from occuring. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: need to use find() on complex relationship

2006-08-16 Thread chris
Thanks for your input - it has been helpful :). --~--~-~--~~~---~--~~ 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

Re: Getting Cake to work without access to the apache config file

2006-08-16 Thread chris
You could just use your public_html directory as the app root. --~--~-~--~~~---~--~~ 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

Re: Getting Cake to work without access to the apache config file

2006-08-16 Thread chris
And probably tweak the settings in index.php. See this section in the manual: http://manual.cakephp.org/chapter/installing. Chech out the Advanced Setup: Alternative Installation Options section. --~--~-~--~~~---~--~~ You received this message because you are

How to/where to set ADODB config instructions + utilise adodb methods.

2006-08-16 Thread modfather
Does anybody know where in cake you set adodb instructions such as $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC. Also, how do you utilise adodb methods such as execute to retrieve database records and how do these methods interact with the cake standard model methods such as findAll etc. Thanks in

Re: Polymorphism in Cake Models

2006-08-16 Thread [EMAIL PROTECTED]
Thanks John. I am pretty new to PHP. Been programming in it for about 6 months and just found Cake. I'm absolutely loving it. I appreciate the help. I'll try using the functions you suggested. Brian --~--~-~--~~~---~--~~ You received this message because