Re: Simple question about $this-set

2006-09-13 Thread Bert Van den Brande
That's exactly what I ended up doing actually :) On 9/13/06, John Zimmerman [EMAIL PROTECTED] wrote: Depending on your situation it might make sense to make the variable in question a class variable of your controller. Your reusable methods could then check and set the variable as necessary.

Re: Messaging service

2006-09-13 Thread Martin Schapendonk
On 9/13/06, John Zimmerman [EMAIL PROTECTED] wrote: The other way to do it would be to create a cronjobs_controller.php that would have table called cronjobs full of tasks that needed to be executed and their corresponding schedules. You could then setup a page to access in your controller

Displaying full name in (almost) every view

2006-09-13 Thread Martin Schapendonk
Hi all, I'm trying to get a feeling on CakePHP best practices. I'd like to show each logged in user his/her full name on every page. So, there must be something like a User-model of the loggedin user available to every view, right? What would be the best way to accomplish this? I was thinking

Re: Model association issue

2006-09-13 Thread AD7six
Hi Brian, You can´t create 2 associations with the same name. You can't say a user HasOne Venue and User HABTM Venue - if you don´t give you associations unique names the data for both will get mixed together (with confusing results as you have seen). Let me clarify what that means before you

Re: Scaffolding with pagination on view

2006-09-13 Thread AD7six
Hi Daniel, In 1.2 that might be possible (depending on what is up the cakePhp sleve wrt pagination) but until then, creating a paginated view is very easy see: http://wiki.cakephp.org/tutorials:pagination Cheers, AD7six --~--~-~--~~~---~--~~ You received this

Re: Displaying full name in (almost) every view

2006-09-13 Thread AD7six
Why not, when the user logs in, store the full name in the session (along with any other details you need from the user such as their id, aro equivalent, group/role etc.) and then in your view/layout/element query the session and if there is a Name: display it? HTH, AD7six

view : link to pdf

2006-09-13 Thread Dom
Hi, How to create a link to a pdf ? I try this : $html-image('image.gif'),/files/.$doc['path'],array('title' = $doc['path'],'target'= '_new'), false, false) But ... the link don't work http://URL/files/example.pdf (error message = missing controller) Regards, Dom.

Re: view : link to pdf

2006-09-13 Thread Bert Van den Brande
If the file http://URL/files/example.pdf does not actually exists, then Cake will try to resolve the url as an controller/action combination ... that's probably the reason that you get a missing controller message On 9/13/06, Dom [EMAIL PROTECTED] wrote: Hi, How to create a link to a pdf ?

Re: Working with stuff in the /app/vendors directory

2006-09-13 Thread AD7six
Chris Hartjes wrote: Now, I've added the following code into the thml template I want the graph to appear in: vendor('charts'); echo InsertChart($html-image('charts.swf'), charts_library, $html-url('/graphs/users')); charts_library is supposed to represent the location

Re: selecting fields in related models

2006-09-13 Thread mathaios
Thank you very much for your valuable help, I will then investigate 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

Re: IE displays unsecure Objects alerts in my cake apps

2006-09-13 Thread AD7six
One of your js files seems to be the cause. It seems likely to be due to empty/incomplete (i)frames. http://support.microsoft.com/?kbid=184960 http://support.microsoft.com/default.aspx?scid=kb;en-us;261188 HTH, AD7six --~--~-~--~~~---~--~~ You received this

Re: view : link to pdf

2006-09-13 Thread Dom
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

Re: Save function executes before it should

2006-09-13 Thread zipman
The queries executed are the below 1 SELECT `CreditPackage`.`credits` FROM `credit_packages` AS `CreditPackage` WHERE id=1 LIMIT 1 1 1 0 2 SELECT `Customer`.`credits`, `Customer`.`firm` FROM `customers` AS `Customer` WHERE id=1 LIMIT 1 1 1

Re: Save function executes before it should

2006-09-13 Thread AD7six
What does //some rendering calls follow do..? Do you have any requestAction calls or redirect in there (as Nate asked). You could use the log function instead of the echo, and if your log states: Package_credits: 1 Old_credits: 0 New_credits: 1 Package_credits: 1 Old_credits: 1 New_credits: 2.

Re: Save function executes before it should

2006-09-13 Thread AD7six
PPS. You don´t need to refer to the current credits to increment the value. $new_credits = credits + $credits; // a string Would do the same thing, and in this way if you find you get double increments you can be 100% certain that the reason is because the sql is being executed twice.

I need an help on a selectTag and some records

2006-09-13 Thread [EMAIL PROTECTED]
Hi all. So, let's explain the situation: I have a record called 'Review' and it can be of different projects; the projects are listed into a selectTag with a multiple tag (so it's a list than a dropdown menu). Now, I want that if I select 4 projects, it inserts 4 new rows each one with the

Re: Populate $html-radio from database?

2006-09-13 Thread AD7six
Hi green-mamba, Dont know about the radio function but: green-mamba wrote: In my controller: $this-set('marketingsourceArray', $this-Marketingsource-generateList(null,null,null,'id','marketing_ref')); Try this first: $array = $this-Marketingsource-generateList();

helper and model in every page

2006-09-13 Thread Ámon Tamás
Hello, I like to put a menu to every page on my site. The menu in the category modeland I have a Helper function for menu. I try smothing like this: class AppController extends Controller { var $helpers = array('Menu'); var $uses = array('Category'); function beforeRender() {

Re: Populate $html-radio from database?

2006-09-13 Thread green-mamba
Thanks for the feedback - in the end I managed to get it working with using: $this-set('marketingsourceArray', $this-Marketingsource-generateList(null,null,null,'{n}.Marketingsource.id','{n}.Marketingsource.marketing_ref')); In my defence, however, I should say that I copied

$javascript-link question

2006-09-13 Thread TWIOF
Hi, I have a the following code in my default.thtml layout: echo $javascript-link('scriptaculous.js?load=effects') it works on my index page but doesn't on deeper pages. I Get the following error: Notice: Undefined variable: javascript in C:\apache2triad I have also tried:

Re: $javascript-link question

2006-09-13 Thread Samuel DeVore
In all likelyhood your controllers do not have the var $helpers = array('Javascript','Ajax'); On 9/13/06, TWIOF [EMAIL PROTECTED] wrote: Hi, I have a the following code in my default.thtml layout: echo $javascript-link('scriptaculous.js?load=effects') it works on my index page but doesn't

Re: $javascript-link question

2006-09-13 Thread TWIOF
Perfect! 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

Re: Scaffolding with pagination on view

2006-09-13 Thread nate
Scaffolding is for *prototyping* applications, not *building* them. Scaffold has a minimum feature set for a reason. If you want to implement pagination, you can generate the scaffolded view and implement it yourself. --~--~-~--~~~---~--~~ You received this

Re: Session-Write() problems

2006-09-13 Thread Cheeze
I'm just throwing up suggestions here. Maybe the session folder is not set in your php.ini file? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Scaffolding with pagination on view

2006-09-13 Thread [EMAIL PROTECTED]
Others frameworks do pagination on scaffolded view, but I want use cakephp... --~--~-~--~~~---~--~~ 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: IE displays unsecure Objects alerts in my cake apps

2006-09-13 Thread nate
Could also be due to the fact that you're using IE. Not using IE should clear the problem right up ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Scaffolding with pagination on view

2006-09-13 Thread nate
Open an Enhancement ticket at https://trac.cakephp.org/ --~--~-~--~~~---~--~~ 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,

date format

2006-09-13 Thread M
Hello, seems that mysql store dates in the following format: -mm-dd. How can I easily :) do, to let my application users to insert data in a field in the following format: dd-mm-??? Thanks, Michele --~--~-~--~~~---~--~~ You received this message

Re: date format

2006-09-13 Thread John David Anderson (_psychic_)
On Sep 13, 2006, at 9:49 AM, M wrote: Hello, seems that mysql store dates in the following format: -mm-dd. How can I easily :) do, to let my application users to insert data in a field in the following format: dd-mm-??? http://us2.php.net/strtotime http://us2.php.net/date

Re: date format

2006-09-13 Thread Samuel DeVore
you might look at some of the date parsing tools in php, like http://php.net/strtotime but to be honest, I tend to either split out the fields for entry or use pull downs... Sam D On 9/13/06, M [EMAIL PROTECTED] wrote: Hello, seems that mysql store dates in the following format: -mm-dd.

arrays: same data, same views, but other structure

2006-09-13 Thread [EMAIL PROTECTED]
Hey guys, take for expample these 3 models: news ,replies and user (news hasmany replies, replies belongsto news, user hasmany replies, replies belongsto user) if i do a $this-Reply-findAll(); and pr() the result, i get something like this:

Re: Model association issue

2006-09-13 Thread Brian French
Thank you! That fixed my problem perfectly! AD7six wrote: Hi Brian, You can´t create 2 associations with the same name. You can't say a user HasOne Venue and User HABTM Venue - if you don´t give you associations unique names the data for both will get mixed together (with confusing results

Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
Hi, I'm sure many people have had the same issue I'm experiencing. I'm working on a project where I need to get data from more than 30 models/controllers from a controller action. I have been using the $this-requestAction('/airports/getAirportList/' .

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
You could consider setting the recursive variable of models and controllers that you don't need them to retrieve their full out associations. The associations can take up most of the time. What is taking up most of your time is not the actual requestaction itself, but all the SQL queries. Turn

Re: Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
I also need to be able to call other controller methods such as save($data) without the requestAction abuse performance inconveniences. I read the article at: http://www.thinkingphp.org/2006/06/24/welcome-to-the-dark-side-of-plugins-in-cakephp/ I think that is kind of a good approach but not

Re: arrays: same data, same views, but other structure

2006-09-13 Thread [EMAIL PROTECTED]
Sounds like you just need to be careful of how you pass data into the ReplyElement you have created. For the first you pass just the $data itself. For the second where you have multiple replies you are going to have to use a loop. foreach ($data['Reply'] as $row) {

Re: Session-Write() problems

2006-09-13 Thread [EMAIL PROTECTED]
with the CAKE_SESSION_SAVE set to cake you are telling it to save sessions using CakePHP. So, maybe you don't have permissions set to the tmp/sessions directory?? I would try chaning it to php and see if that works. Although it looks like your sessions are getting created fine. It looks like

Re: Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
Hi Troy. I set DEBUG 2 and these are my results of 1 sample request: SQL Queries Time: 17 queries took 17 ms Total request processing time: 1.8491s I think 1.8 seconds is a long time considering that the SQL queries only take 17 ms and I'm the only user of my Dev server. I will be looking

Re: helper and model in every page

2006-09-13 Thread [EMAIL PROTECTED]
Why not instead use some code like this. function __construct( ) { if (!in_array('Category', $this-uses)) { $this-uses[] = 'Category'; } parent::__construct(); } I think the problem might be that the Category is getting double defined, or not defined

Re: Displaying full name in (almost) every view

2006-09-13 Thread [EMAIL PROTECTED]
I agree I think the best practice is to set pertinent Session variables at the time when they login. Otherwise, you are going to bog down with excessive SQL requests to get that information again and again for every view. --~--~-~--~~~---~--~~ You received this

Re: Messaging service

2006-09-13 Thread Brian Wisti
I don't see the benefit of the extra roundtrip via the webserver? Isn't it more clear to have a cronjob execute a script directly instead of redirecting it through the webserver and an extra controller? Moreover, your ISP could impose limits on maximum execution time. Batch processing may

Re: arrays: same data, same views, but other structure

2006-09-13 Thread [EMAIL PROTECTED]
okay i like that. it's not super-clean like i hoped it would be, but it certainly does the job really well and simple. I don't really understand how you come up witht he code you wrote, especially the row thing, anyway, you bumped me in the right direction, and now i just use this for the 2nd

Re: Re: date format

2006-09-13 Thread Samuel DeVore
Also saw this cool javascript date entry tool today. http://datebocks.inimit.com/ Sam D On 9/13/06, Samuel DeVore [EMAIL PROTECTED] wrote: you might look at some of the date parsing tools in php, like http://php.net/strtotime but to be honest, I tend to either split out the fields for

Radio List Helper

2006-09-13 Thread bbuchs
Hi all. Took my first attempt at building a custom helper. It outputs a series of radio buttons in a UL list, with each radio having an associated LABEL. code function radio($fieldName, $options, $inbetween = null, $htmlAttributes = array(), $return = false) {

Re: Session-Write() problems

2006-09-13 Thread [EMAIL PROTECTED]
Initially I had problems with security set to high, but that was in RC and before versions. Ever since v1 has been officially released I haven't had any problems with the high setting. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: IE displays unsecure Objects alerts in my cake apps

2006-09-13 Thread [EMAIL PROTECTED]
You know I wish we could brainwash people into not using IE. People even try and create viruses only for it and people still continue to use it. If I created a virus it would destroy IE, install Firefox and set it as default browser. Then, it would spread to everything it could doing the same.

Re: arrays: same data, same views, but other structure

2006-09-13 Thread [EMAIL PROTECTED]
One thing I noticed is the use of an $i variable there. Looks like maybe you are doing a for loop?? That is probably making a lot of $news[$i]['Reply']['etc'] variables in your code block. Instead using the foreach ($news as $row) would make them $row['Reply']['etc'] and clean up your code a

Re: Save function executes before it should

2006-09-13 Thread [EMAIL PROTECTED]
Copy your whole controller into CakeBin http://cakephp.org/pastes And then paste the link to it in here to examine it more. And it could be possible that another call is indeed running it, but you only see the SQL of the current displayed controller and not other ones that might have been

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
I develop on my laptop and get 1.3 second renderings. You could also paste your code to CakeBin for people to take a look at and see if there is a way to optimize it. http://cakephp.org/pastes --~--~-~--~~~---~--~~ You received this message because you are

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
Also you can just do $this-Airport-findAllByCity($this-data[Airtravelcalculator][city_input]) and then return stuff. In a controller method I don't find myself using requestaction much at all. I instead use the Models methods (findBy, findAll, etc.) to get any data I need in a specific view. I

Re: Going around with Cake ACL

2006-09-13 Thread kabturek
mht wrote: For couple of days I try to implement Cake ACL. Yes the documentation lack of easy how to for ACL, different with the rest of others docs, and I already search within this list to find how to. In the end, with material from I find, I can implement User and ACL management within my

Re: arrays: same data, same views, but other structure

2006-09-13 Thread [EMAIL PROTECTED]
oh, right, i used for loops there for a good reason in the past (i needed to know exactly the index of the array), but now i don't need it anymore. gonna change it to foreach ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Messaging service

2006-09-13 Thread John Zimmerman
The way in which you would implement it does depend on what kind of jobs you need to run.Just like how there is no one true backup solution that fits everyone's needs or every situation.Having it all based out of a cron_controller would allow you to build an administration interface for it within

Re: Displaying full name in (almost) every view

2006-09-13 Thread Reine
If you will be using othAuth, you can just add something like this to your default view: Welcome, ?php echo $othAuth-user('firstname'). .$othAuth-user('lastname'); ?! In this way, you only have to include that line of code once and it will be shown in all pages. Likewise, you can set your own

Re: Multiple Databases

2006-09-13 Thread Tony
Nate that's pretty interesting. I'm glad to see that there is a way of using multiple databases with an application. When you were talking about this; // Run a query $this-Model-findAll(...); // Switch to a different database connection $this-Model-setDataSource(other_connection); // Run another

actions in controller.php

2006-09-13 Thread Shunro Dozono
Hello, A developer found that you can call some action methods in controller.php directly. http://www.1x1.jp/blog/2006/09/cakephp_controller_action.html (Japanese Blog) For example, if you request a following URL: http://cake_url/controller_name/flash/any_strings_you_want_to_display/5000

Re: Access associations array

2006-09-13 Thread [EMAIL PROTECTED]
My application requires that in order for orders to be visible in the future albums never can really get deleted, but their status is set to inactive. Also, anywhere in my code where I execute a findAll I add Album.active = 1. This way I don't get the inactive ones. So, yes there are cases

Re: Going around with Cake ACL

2006-09-13 Thread Hansen
On Wed, 2006-09-13 at 20:44 +, kabturek wrote: mht wrote: For couple of days I try to implement Cake ACL. Yes the documentation lack of easy how to for ACL, different with the rest of others docs, and I already search within this list to find how to. In the end, with material from

Re: Help with form helper

2006-09-13 Thread [EMAIL PROTECTED]
Something in 1.2 that looks to be exciting to use a new form helper. How about one where you can always pass it the $data['ModelName']['field'] and if that value is null then it just does a blank. I think the HTML helper now doesn't do this.

Pagination

2006-09-13 Thread Gregory Stewart
I am trying to use pagination as described in this wiki here: http://wiki.cakephp.org/tutorials:pagination It works fine, the only problem is that I am trying to use it on a search form for my web app. My view has a form, and my controller creates a custom query based on the values entered on

Apache crashing on debug from PHP IDE

2006-09-13 Thread Walter
I just started playing with Cake and there must be something wrong going... I am using: PHP IDE (v0.2.3) XAMPP 1.5.4 PHP 5.1.6 and Zend Platform 2.2.1a (for server debugging) This works fine with other projects but whenever I try to run or debug a cake project, the apache process crashes with:

Re: Pagination

2006-09-13 Thread Samuel DeVore
I usually either encode it in another searchArg element in the view links or I use a session variable to track it On 9/13/06, Gregory Stewart [EMAIL PROTECTED] wrote: I am trying to use pagination as described in this wiki here: http://wiki.cakephp.org/tutorials:pagination It works fine,

Re: helper and model in every page

2006-09-13 Thread Ámon Tamás
[EMAIL PROTECTED] írta: Why not instead use some code like this. function __construct( ) { if (!in_array('Category', $this-uses)) { $this-uses[] = 'Category'; } parent::__construct(); } I think the problem might be that the Category is getting