Re: Alternating Row Colors

2006-08-21 Thread John Zimmerman [gmail]
dangit, dangit, dangit..I need to research the helpers more.Thanks for the snippet, I will go back and recode the appropriate sections of my code.On 8/20/06, sicapitan [EMAIL PROTECTED] wrote: AD7 is right, tablecells does this automatically, and you can set theclaternating

Re: Cross Application Sesssion

2006-08-21 Thread Mandy Singh
:) nate - i had already tried that. basically, i use the same db as used by rdBloggery. but my application runs in /app/ and the blog in /rdBloggery/ even wheni was storing sessions in the db, i was not able to auto log the person into rdBloggery if he already logged on in my application in

Re: Cross Application Sesssion

2006-08-21 Thread Mandy Singh
i m thinking of reading the chapter on plugins and see if i can move rdBloggery under /app/plugins though... On 8/21/06, Mandy Singh [EMAIL PROTECTED] wrote: :) nate - i had already tried that. basically, i use the same db as used by rdBloggery. but my application runs in /app/ and the blog

Re: User Bar Logic

2006-08-21 Thread AD7six
Simplerules wrote: No matter what I do it won't work here is the code: //Get User Data; $Profile = $this-Session-read('User'); if(isset($Profile['Username'])) { $this-set('logged_in', TRUE); $this-set('username', $Profile['Username']);

Re: Pagination for hasMany assocation

2006-08-21 Thread AD7six
Hi All, nate wrote: var $paginate = array('limit' = 20, 'order' = ...); // Anything you can pass to Model::findAll can be set here Is it going to be possible to specify which relationships are included in the main model query in 1.2, or to specify constraints for subsequent queries (I´m

Re: Cross Application Sesssion

2006-08-21 Thread AD7six
Hi Mandy, Plugins will 'suffer' the same problem as a seperate app, I wrote a short blog on the topic and how to work around it. It's possible that the same approach would work for multiple apps, haven´t tried that. http://www.noswad.me.uk/blogs/view/28 Cheers, AD7six PS. I´d welcome comments

Re: url and routing

2006-08-21 Thread teemow
it would be great to have some kind of outgoing dispatcher method. so that controller-redirect and all the helpers translate the urls. then we could have one place to define the translation of the urls and one to map the english urls to controller methods. if you follow the concept of degradable

Help me with my logic please

2006-08-21 Thread [EMAIL PROTECTED]
Hello fellow bakers! first of all I'd like to tell you that I am an experienced php developer for years, firstly with plain procedural way, last year OOP and now I started baking with cakePHP, so I am really new to MVC concept. I decided that my first baked application would be a classifieds

Req ITRec/CitrixEngg/DBA/J2EEDev/.NetDev/DelphiProg/COBOLProf/GraphicDsgn/EE/ICE/CivilEngg/SALAdmin/CreditCardProf.......

2006-08-21 Thread freshers/experienced
Hi Dear Members, FOLLOWING R THE JOBS OF THIS WEEK: Job Title Job Posted By IT Recruiter keriosolutions.inc Req-0304 -Microsoft / Citrix System Engineer keriosolutions.inc Req-0285 - SQL / Oracle DBA keriosolutions.inc

othAuth: logging in as other user + warning when permissions not sufficient

2006-08-21 Thread [EMAIL PROTECTED]
Hey guys, i just installed othauth, injected the logic in app_controller, created some users, groups, incremented $gid a bit and set $strict_gid_check to false in the component configuration (yes i know this is not a clean method, i will fix this later and pass the right stuff to the login

Re: Return field from second joined table

2006-08-21 Thread Chris Hartjes
Isn't that info available in $data['Category']? Given the relationships you've established I think it would be there. On 8/21/06, ShepherdWeb [EMAIL PROTECTED] wrote: Color and Product are hasAndBelongsToMany to each other Product belongsTo Category Category hasMany Product I'm using

Re: Saving with hasMany

2006-08-21 Thread Rolo D. Monkey
Perhaps I need to be more specific. I am importing the data from a .csv file, so I am building the data structure myself, and the information from the Manual does not explain how to create a data structure for multiple hasMany records. So far I have managed to save Member records, and I had no

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

2006-08-21 Thread John David Anderson (_psychic_)
On Aug 21, 2006, at 9:21 AM, Zoltan wrote: A bit of a newbies question here, but what is the correct way to handle tables like 'city', should I name it 'cities' or 'citys'? Have you tried it? Should be 'cities'. -- John --~--~-~--~~~---~--~~ You

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

2006-08-21 Thread Zoltan
Yes, I tried it and it seemed to work at first, then got some errors about missing controllers. This was about a week ago, but going from memory I used something like: class City extends AppModel { var $name = 'City'; } and class CitiesController extends AppController {..} Does this look

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

2006-08-21 Thread John David Anderson (_psychic_)
On Aug 21, 2006, at 9:33 AM, Zoltan wrote: Yes, I tried it and it seemed to work at first, then got some errors about missing controllers. This was about a week ago, but going from memory I used something like: class City extends AppModel { var $name = 'City'; } and class

Re: Intercepting dispatcher's routes

2006-08-21 Thread jez
Thanks nate, lots of help. 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

Re: Template Extension and Smarty.

2006-08-21 Thread Brian French
Is there a way to set it in the config for the app? (i use dreamweaver and want to keep the code highlighting, etc.) mouth wrote: ad 1) create file app/views/test.php with content: ?php require_once 'cake'.DS.'libs'.DS.'view'.DS.'view.php'; class TestView extends View { var $ext =

Re: Template Extension and Smarty.

2006-08-21 Thread mouth
Brian French wrote: Is there a way to set it in the config for the app? Just make file app/app_controller.php with this content: ?php class AppController extends Controller { var $view = 'test'; } ? (i use dreamweaver and want to keep the code highlighting, etc.) I don't understand what

Re: Template Extension and Smarty.

2006-08-21 Thread Brian French
Dreamweaver has highlighting and other bells and whistles built into it which i like. they are based on the extension of the file you are editing. if im editing an html file, it highlights the html as well as if i was editing a php or asp, etc. file. Dreamweaver doesn't recognize the 'thtml'

Join Table in Conditions of a findAll

2006-08-21 Thread [EMAIL PROTECTED]
I have a database schema with categories and products that are joined with categories_products table. This makes it so a product can be assigned to multiple categories. I would like to find all of the products that belong to a category. I've tried:

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

Let user submit multiple records

2006-08-21 Thread mutabor
Hello. I have a model called 'Room'. I need to let user submit as many rooms at once as he wants by placing javascript 'Add room' button. Each time user press this button it pastes one more set of fields to let user enter another room information. And in the end there is submit button which

Re: Let user submit multiple records

2006-08-21 Thread Mikee Freedom
Morning Mutabor, I did a similar thing with Config values. I printed all of my Config values on a single page and allowed the user to edit them at one time. When creating the form I employed non-standard CakePHP form input naming conventions and then interpreted these at the controller level.

Re: Let user submit multiple records

2006-08-21 Thread mutabor
Hello Mike. Thank you very much for the quick reply. This is definitely a nice and elegant way to handle it. I think I should use it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this

Cookies

2006-08-21 Thread Simplerules
I am using this to set cookies: setcookie($Name, $Value, time()+$Length) and it works, except the cookies are not accessible in CAKEPHP. The cookies (unlike the CAKEPHP cookie) are set to cake_1.1.7.3363/ while CAKEPHP is set to cake_1.1.7.3363 ; When I do a print_r($_COOKIE) I only find the

Re: Let user submit multiple records

2006-08-21 Thread Mikee Freedom
no worries. if you run in to trouble you might also have to look at using: $this-Room-create(); this method prepares your model for insertion each time. otherwise once you use the model to save data it sets the id of that model and then each subsequent save will be an update instead of an

Re: Join Table in Conditions of a findAll

2006-08-21 Thread ShepherdWeb
@Jimmy - Check out this WIKI entry: http://wiki.cakephp.org/docs:method:read I hope this helps! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Return field from second joined table

2006-08-21 Thread ShepherdWeb
Nope. It's not there. --~--~-~--~~~---~--~~ 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]

Raw Query

2006-08-21 Thread Simplerules
How do I do a raw SQL query? I need to access a table called 'Users', which belongs to UsersController, in a component Logins - is there a way to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: Raw Query

2006-08-21 Thread John David Anderson (_psychic_)
On Aug 21, 2006, at 4:48 PM, Simplerules wrote: How do I do a raw SQL query? If at all possible, I would use model functions, but you can also always use the query() and execute() functions of the model as well. I need to access a table called 'Users', which belongs to UsersController,

Re: Raw Query

2006-08-21 Thread Simplerules
Yes, it has a Model. 'Users' is a fully working area, but I need to access some data from the table Users in this component. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group,

Re: Raw Query

2006-08-21 Thread John David Anderson (_psychic_)
On Aug 21, 2006, at 4:55 PM, Simplerules wrote: Yes, it has a Model. 'Users' is a fully working area, but I need to access some data from the table Users in this component. Just to clarify, are you using Cake vocabulary here? Is your question that you want to know how to access and use

Re: Join Table in Conditions of a findAll

2006-08-21 Thread ShepherdWeb
I'm working on a similar scenario right now. I haven't found a solution yet. Maybe some seasoned Cake veterans will chime in on this --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Raw Query

2006-08-21 Thread Simplerules
Yes. --~--~-~--~~~---~--~~ 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,

Re: Help me with my logic please

2006-08-21 Thread ShepherdWeb
You'll end up using $this-requestAction() for logic that spans multiple models. --~--~-~--~~~---~--~~ 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

View subdirectories names ... problem

2006-08-21 Thread purepear
Hi, my problem: I have a controller called - ProductCatsController with an action - admin_index I have a /views/productcats/admin_index.thtml file But the this url /admin/product_cats/ says Missing View in the title.. and some Notice: Undefined variable: javascript in

Re: View subdirectories names ... problem

2006-08-21 Thread purepear
Is there a way to see what is the View file (and its path) that cakePHP is trying to render in this action ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: View subdirectories names ... problem

2006-08-21 Thread DJ Spark
the problem seems to be you are using some helpers , and you didn't include the HTML helper, which contains the function $html-link() just add the html helper to your controller. tell us if it works :) spark! On 8/21/06, purepear [EMAIL PROTECTED] wrote: Hi, my problem: I have a

Re: Return field from second joined table

2006-08-21 Thread ShepherdWeb
I found that I can use find() instead of read(), and set recursive = 2 to return category.title, however, this returns way more data than I need and drastically affects performance. Not a usable solution. --~--~-~--~~~---~--~~ You received this message because

Error in the Cake Blog tutorial.

2006-08-21 Thread mrbog
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

Re: Join Table in Conditions of a findAll

2006-08-21 Thread DJ Spark
from the cakephp manual, quoted below, you can see how adding a few parameters to the findAll function you can limit the number of rows retrieved: example: $this-User-findAll('',null, '', 20, 2); this gets the second page of results, containing 20 items each. If you use a variable $page, for

Re: Return field from second joined table

2006-08-21 Thread ShepherdWeb
Here's my solution. It's not the most elegant in the world, but it gets the job done. If anyone has a suggestion for a better way, please chime in. $categoryData = $this-requestAction('/categories/select/'); $this-Product-Color-id = $color_id;

Re: Raw Query

2006-08-21 Thread Simplerules
So how would I use a function in the model User, from a seperate component? :) --~--~-~--~~~---~--~~ 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

Date Format output

2006-08-21 Thread c_doug
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

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 =

Re: Date Format output

2006-08-21 Thread c_doug
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).

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

Re: Date Format output

2006-08-21 Thread Mikee Freedom
don't forget the Time helper http://manual.cakephp.org/chapter/helpers http://api.cakephp.org/class_time_helper.html On 22/08/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

How to test for the current model?

2006-08-21 Thread Bernard Grosperrin
I need some help with something which looks like the cat chasing it's tail, to me, but I am a beginner! I have a component which I call from the default.thtml view, as I want it in a sidebar, and that is defined there. But in fact, I would like that component displayed/active only when the

Re: How to test for the current model?

2006-08-21 Thread Mikee Freedom
hey dood, i don't know if this would be the best method but you can access the controller from your views and layouts via: $this-controller so you can check for the controller name if ($this-controller-name == 'Blahs') { display } or for the modelClass if ($this-controller-modelClass ==

Conditions Reference

2006-08-21 Thread Mikee Freedom
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

hasMany and custom SQL

2006-08-21 Thread Sonic Baker
Hi there, It seems that Models associated via $hasMany are not done so via JOIN's. Rather, they are called as a separate query with the id of the calling model. Why is this? This results in some strange behavior when certain conditions in the $fields array are defined. e.g. Product

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

Re: Let user submit multiple records

2006-08-21 Thread Vanchuck
While we're talking implementations, I thought I'd chime in with how I solved this problem). My implementation was for editing Translations (I may post about my i18n implementation in another topic soon enough). One example specifically is for a user's first and last name (if I'm posting a

Re: Conditions Reference

2006-08-21 Thread Mikee Freedom
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

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