Re: Is Model::findCount supposed to work?!?!?!?!

2006-10-17 Thread AD7six


SoCalCakeBaker wrote:
 If anyone has any thoughts hit me ...
Look at, or wait for, the cake 1.2 code ;)

HTH,

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: ajax observeField on a select

2006-10-17 Thread Steniskis

Not yet, thank you Léo, I will.
Have a nice day
Sten


--~--~-~--~~~---~--~~
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: Session and sessionid

2006-10-17 Thread [EMAIL PROTECTED]

sessions are given an id automatically by the php engine, you don't
need to do anything manually for that.  same about the handling, it's
all automatically.
you can basically just use the session without doing any checking on
your own, you can trust php for that. (it's not perfectly secure, but
it does the job very well)
(correct me if i'm wrong)


--~--~-~--~~~---~--~~
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: Session and sessionid

2006-10-17 Thread [EMAIL PROTECTED]

Thanks so far for the answers!

I have an index-page with a form. The user enters data and saves it to
the database (data-table).
The data-table has a data_id as key.
Now I would like to save this actual data_id for the user. So the user
can go to different pages and when he comes back to the index-page, he
is still known as the one who entered the data.

How do I start a session, save the var for the user and so on?

Thanks for the help!

Felix


--~--~-~--~~~---~--~~
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: 2 forms and 1 submit button

2006-10-17 Thread [EMAIL PROTECTED]

Thanks, I will give it a try!


--~--~-~--~~~---~--~~
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: 1 of 3 input fields have to be filled - validate

2006-10-17 Thread [EMAIL PROTECTED]

Thanks for the links. I have followed this tutorial step by step, but
somehow there is a error in my validation rules:

My model:

 var $validate = array(
'email1' = array('enteredAdress','Enter at least one
contact'),
'email2' = array('enteredAdress','Enter at least one
contact'),
'email3' = array('enteredAdress','Enter at least one
contact'),
 );

 function enteredAdress()
{
if (($this-email1 != NULL ) OR ( $this-email2 != NULL ) OR (
$this-email3 != NULL ))
  {return true;}
else
  {return false;}
}


When I go that page, I get the error: Warning: Invalid argument
supplied for foreach() in /app/app_model.php on line 72
What could be my problem?

Thanks

Felix


--~--~-~--~~~---~--~~
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: 1 of 3 input fields have to be filled - validate

2006-10-17 Thread [EMAIL PROTECTED]

OK, I figured that one out. I simply forgot to write the ?php 
? tags in the error.php file. Stupid mistake...


--~--~-~--~~~---~--~~
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 distinguish empty recordset from error in findAll()

2006-10-17 Thread milicic.marko

YEah !

This will be cool feature in cake 1.2

Nate, can you tell us when we can expect 1.2 to be published?

tnx 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
-~--~~~~--~~--~--~---



Convincing my company to use Cake

2006-10-17 Thread MrTufty

Hi guys,

I'm working as a web developer now, and I've been trying to convince
the directors of the company that using some open-source libraries to
build our sites would be a good move. I've almost managed to convince
them that having a template engine is a good idea - with demonstrations
of what I've managed to build myself. From that, I've extended the idea
of using Smarty for future projects...

...but that led me to thinking, the primary benefits of Smarty are to
separate content from presentation - why not go the whole hog and use
Cake? I've been here for a while myself, I think Cake is fantastic and
so far I've been frustrated that I couldn't just use it for
work-related projects.

What they're asking for though is what the advantages and disadvantages
are of adopting this sort of system. I can probably come up with most
of them by myself anyway, but if anyone can suggest any, I'd be very
pleased to hear them :)

As an aside, the MIT license Cake uses - am I right in thinking it
allows use in commercial software (specifically the sort of large
websites we'll be building with it, which of course we're charging
for)? We'll probably have to encode the files as well if only to
prevent our clients from breaking the system...

Thanks in advance for any advice :)


--~--~-~--~~~---~--~~
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: Session and sessionid

2006-10-17 Thread [EMAIL PROTECTED]

how long does that data need to stay in the database? only during the
session? (like 30, 45 minutes, whatever?) then you could just save it
all save it in the session ($session-write())

if longer then that, i would just create a user_id field in the
datatable to store the user_id.


--~--~-~--~~~---~--~~
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: Session and sessionid

2006-10-17 Thread [EMAIL PROTECTED]

Hi Dieter,

30 Minutes is more than enough. It only needs to be saved in the
session. So, then I will try to figure out, how $session-write works.


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread [EMAIL PROTECTED]

you can sell your cake-based apps for money, but you are not allowed to
encrypt/remove copyright/... from the cake files.

if your company doesnt know what the benefits of a framework are, i
wonder what kind of management is leading that company.  I can't
imagine any software company *not* using a framework (many of them
write their own)
obviously a framework takes away the stupid,annoying, repetitive
tasks so the developer can focus on the real problem.  Cakephp does a
pretty good job at providing help for making many things very easy, and
still not standing in the way if you want to do it the other way.  it
makes things more manageable, more abstract.  On the other hand, there
is a learning curve you must go through, and the performance isn't
always optimal, but these points are easily outweighted by the improved
workflow when using the framework.


--~--~-~--~~~---~--~~
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: 1 of 3 input fields have to be filled - validate

2006-10-17 Thread [EMAIL PROTECTED]

But now I get the error: Warning: Delimiter must not be alphanumeric
or backslash in app/app_model.php on line 82.
In other topics I've read that maybe the function for the validation is
not recognized. But in my example there is no chance of spelling it
wrong (the example from my the post before).

Does anyone have an idea what the problem could be?

Thanks

Felix


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread sicapitan

You can use Cake, AND Smarty!

What are your other options to be honest?  Write it all from scratch?
Use another framework?

Don't forget open source means community, and the Cake community is
growing rapidly, so most problems you'll encounter others have
encountered.  Cake is also growing rapidly, I must say I'm nothing
short of impressed at the rate of new versions, updates and of course
tutorials and components being added by the users themselves.

Disadvantages?  Well, if your after a Cake expert to walk in and help
you on a project, perhaps someone who is a PHP programmer who has not
used MVC before, that might cause some delays while he learns the ins
and outs.  I can't think of any more to be honest.  You write code, you
finish an application.  Inbetween that, the team gets a kick out of
using a moden, excellent and efficient framework, and probably gets to
go home on time.

Oh wait I know another disadvantage, once you start using cake you
begin to forget everything else.  It's like the brain getting used to
wearing glasses.  The picture is better, it just makes sense ;-)


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread MrTufty

Luckily, I've been using Cake myself for the past couple of months - so
I'm about as much as we're likely to need for the moment :)

The other options are: keep doing things the same way they've always
been done here (we have a function library, but the functions it
includes are pretty specific to certain projects and thus useless on a
general level), or to write our own framework - which from an ownership
point of view makes sense, but less so from the point of view of hey,
this is a huge job, and it still might have security issues I've
missed.

I've also encountered the problem with having trouble going back to
basic PHP code after a few months of baking. Really, I had to relearn a
lot of my old techniques. Although I think being exposed to Cake has
helped, my code is far more organised now just as a matter of course.

I guess we'll have to see which way we wind up going. I personally
wouldn't mind the challenge of writing our own framework from scratch,
but I have no illusions about the size of the job and the fact that I'd
effectively be responsible for all of it, good or bad. Luckily there's
only one other developer in the company at the moment so training
wouldn't be that hard to manage.

I'm also trying to push for source control, I know it probably seems a
bit backwards to some of you but I don't think the company has ever
felt this sort of thing was worth developing in the past - I'm working
towards bringing them up to modern techniques, so that we can embrace
new developments instead of ignoring them.


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread jitka


[EMAIL PROTECTED] wrote:
 you can sell your cake-based apps for money, but you are not allowed to
 encrypt/remove copyright/... from the cake files.

...even from files from 'app' directory, which is quite annoying as it
(besides other things) little bit complicate auto generated
documentation for company projects etc, as some procedural files
(especially app/webroot/index.php and app/config/*) are in project
documentation mentioned/linked/with source 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: Convincing my company to use Cake

2006-10-17 Thread MrTufty

This might unfortunately be a sticking point.

We're in a position with one of our clients where we simply can't trust
them not to tamper with the code we've written for them. This would be
ok, but anything that goes wrong with it they blame us for even when
it's their fault. So, we use IonCube Encoder on all the work we do for
them before it gets uploaded to their server.

If we're not allowed to do that under the license, then I reckon the
directors will be saying no to Cake (and all other open-source
frameworks, for that matter). We're happy to respect copyright and
leave those messages in place, but the code itself needs to be
protected from tampering. It's a bit of a bugger really!


--~--~-~--~~~---~--~~
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 to update form fields?

2006-10-17 Thread francky06l

You have to attach a remote_url to the onSelect event. There was a tuto
about Ajax with check boxes, basically it's the same approach.
When selecting a value, you would call an action using Ajax and will
update the div's that contains the fields.


--~--~-~--~~~---~--~~
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 to update form fields?

2006-10-17 Thread MrTufty

This wouldn't strictly speaking be Ajax, at least not the way I would
do it.

I'd trap the onchange event in the select tag:

select name=whatever onchange=setFields();

/select

Then have some javascript code to automatically select the other
options.

You COULD do it with Ajax (and this just occurred to me while writing
this post) by putting your sub-elements in their own DIV. Then, you
again use the onchange event, tie it up with an Ajax.Updater() - and
let your Cake application generate the HTML for the other form elements
before passing it back for display.

Anyway, there's bound to be alternatives


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread Chris Hartjes

On 10/17/06, MrTufty [EMAIL PROTECTED] wrote:

 This might unfortunately be a sticking point.

 We're in a position with one of our clients where we simply can't trust
 them not to tamper with the code we've written for them. This would be
 ok, but anything that goes wrong with it they blame us for even when
 it's their fault. So, we use IonCube Encoder on all the work we do for
 them before it gets uploaded to their server.

Then I suggest your company dump the client. ;)

I am one of those people strongly opposed to encoding anything, so
perhaps my opinion should be discounted when it comes to this thread.

I was able to use Cake for a project at my work because the company
doesn't care what technologies we use because we're responsible for
maintaining them as well.  Probably a unique situation.


-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread MJ Ray

MrTufty [EMAIL PROTECTED] wrote: [...]
 We're in a position with one of our clients where we simply can't trust
 them not to tamper with the code we've written for them. This would be
 ok, but anything that goes wrong with it they blame us for even when
 it's their fault. [...]

Why not checksum the files when you upload them and politely refuse to 
support changed files?  Of course, they need to agree to the limited 
support terms when you work for them.  If they dispute it, a diff should 
show the changes done after it left you.

Like Chris Hartjes suggested, it might be best to dump that client, if 
they want more support than you want to offer.

Regards,
-- 
MJ Ray [EMAIL PROTECTED]  www.ttllp.co.uk  +44-870-4321-9-10
Web, localisation, koha, databases, GNU/Linux and statistics.
Registered in England and Wales, partnership number OC303457

--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread MrTufty

Sadly, not my decision to make... although that checksum idea might not
be a bad one for future reference, I'll put that forward to the
directors. I don't think we'll be dumping them though, they really are
our main client at the moment and their business is worth a huge
amount. Plus they'd probably sue us if we did dump them, given the
system is half-developed.

This doesn't mean we can't use Cake for future projects where encoding
is unnecessary :) I reckon this client might have issues with the use
of code that we haven't developed in house in any case - they're a real
nightmare for security, unwilling to allow any of our team to work on
stuff for them from home, even via VPN. And yet their server went down
the other day because 'someone' was on there deleting files :-S

I would be very interested to know the opinion of the Cake developers
as to the encoding issue though :-)


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread Chris Hartjes

On 10/17/06, MJ Ray [EMAIL PROTECTED] wrote:

 MrTufty [EMAIL PROTECTED] wrote: [...]
  We're in a position with one of our clients where we simply can't trust
  them not to tamper with the code we've written for them. This would be
  ok, but anything that goes wrong with it they blame us for even when
  it's their fault. [...]

 Why not checksum the files when you upload them and politely refuse to
 support changed files?  Of course, they need to agree to the limited
 support terms when you work for them.  If they dispute it, a diff should
 show the changes done after it left you.

I really like this idea, given that you can't just dump the client.
They sound like a bunch of a$$hole$ anyway.  No amount of money is
worth a bad client.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread MrTufty

You're telling me... I've been pushing the need since I started here to
finish up a couple of other projects that are nearly ready to go
online... trouble is this client takes up so much of our time, with us
being only a small team, that we don't really get chance to tackle
anything else.

I'll be glad when we've polished this one off to be honest but our
timescale at the minute suggests we'll be dealing with them until at
least next May and probably beyond.


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread bbuchs

IANAL, but I think that the no encryption/modification restrictions
apply to an application that you're either selling or giving away. If
you supply your client with an un-modified Cake Core, you've lived up
to the license. Anything they do after that is for their own use.

There's nothing stopping me or anyone else from making any changes I
want to the Cake Core files for my own use. What I am restricted from
doing is making changes (i.e., removing the copyright) and
*re-distributing* them.


--~--~-~--~~~---~--~~
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: Session and sessionid

2006-10-17 Thread [EMAIL PROTECTED]

So, now i figured out how to handle sessions. And it is extremely
simple!
For all those, who are also thinking about using sessions, here is what
I did:

In the core.php in the /app/config folder I've set the following line
to tmp, because I want cake to store the data in the tmp folder
define('CAKE_SESSION_SAVE', 'tmp');

In my Controller in the index function I save the value in the session:
$myID=whatever you want;
$this-Session-write('ID', $myID);

So, now you can access this ID on every page just by adding this code
to your function in the controller:
Here for example the function for the view page:
echo $this-Session-read('ID');

And this will print out whatever you want.

Cheers
Felix


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread nate

I'll ask gwoo to weigh in here, since he's the IP attorney, but I'm
pretty sure the only stipulations with the MIT License are with regard
to the copyright notice.  So if you wanted to go to the trouble, you
could remove the copyright from the files, encode them, then add the
copyright back at the top of the file.

Also, with those auto-documentor tools, I would think they would let
you exclude certain files from being processed.


--~--~-~--~~~---~--~~
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: Convincing my company to use Cake

2006-10-17 Thread MrTufty

Ok. I believe the IonCube tools allow for copyright notices to be left
unencoded anyway, I'd have to check the documentation to be sure but
I'm sure it mentioned something along those lines.

On Oct 17, 3:51 pm, nate [EMAIL PROTECTED] wrote:
 I'll ask gwoo to weigh in here, since he's the IP attorney, but I'm
 pretty sure the only stipulations with the MIT License are with regard
 to the copyright notice.  So if you wanted to go to the trouble, you
 could remove the copyright from the files, encode them, then add the
 copyright back at the top of the file.

 Also, with those auto-documentor tools, I would think they would let
 you exclude certain files from being processed.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread brandags

I'm setting a few variables in my UserController that I want to access
in my AppController (in the beforeFilter). But I'm getting this error:
Notice: Undefined property: PagesController::$accessExceptions in
C:\websites\klickfile.com\app\app_controller.php on line 67

I get the same error with the $this-category variable as well.

In the app_controller's beforeFilter, are the variables in the child
class not available yet? How can I access them? (If I can, this will be
a really slick way to do user-managed ACL).

class UsersController extends AppController
{
var $uses = array('User');

var $category = 'Users';  // The category this controller belongs to

/**
 * Exceptions for access_rights other that view,index,add,edit,delete.
Maps the exceptions to one of the default access_rights
 */
var $accessExceptions = array(
'dashboard'='view',
'login'='view',
'email'='add',
);
}

class AppController extends Controller {

var $beforeFilter = array('_checkAccess');
var $uses = array('UsergroupRight', 'AccessCategory');

/**
 * Default actions (bit values)
 */
var $defaults = array(
'view'=1,
'index'=2,
'add'=4,
'edit'=8,
'delete'=16
);

/**
 * Checks to see whether a usegroup has permission to perform the
requested
 * action on the requested controller.
 */
function _checkAccess()
{
// Check for accessExceptions
$checkAction = in_array($this-action, $this-defaults) ?
$this-action : $this-accessExceptions[$this-action];

$hasAccess =
$this-UsergroupRight-find(array('AccessCatetegory.name'=$this-category,
'UsergroupRight.usergroup_id'=$this-Session-read('usergroup_id'),
'UsergroupRight.access_rights_value  '.$checkAction.'  0'));

echo 'hasAccess?: '.$hasAccess;
exit();
}
}


--~--~-~--~~~---~--~~
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: Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread D.Pape

hi. you can´t access the variables of the user controller in your app 
controller!!
app controller is the base class of user controller, so you can access 
methods and variables of the app controller in your user controller, but 
the app controller don´t know the user controller!!

--~--~-~--~~~---~--~~
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 to update form fields?

2006-10-17 Thread francky06l

Well it's what I mean by ajaxifying the select trough the onChange
...

Now just have to choose among solutions :-)


--~--~-~--~~~---~--~~
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: Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread brandags

Alright. That makes sense.
But since the Users controller extends the App controller, if I go to a
page like:
/users/add
Shouldn't that be creating a User object rather than an App object? So
that when the beforeFilter runs, it's running through the User object?
For example, if I put the beforeFilter in the userController, it
understands it. And I can call a function in the App controller which
can THEN reference variables in the User controller just fine. But it
seems that the beforeFilter runs BEFORE the User controller is created,
as if the App controller runs on its own before it's run as an
extension of the Users controller. Am I making sense?

When does the beforeFilter run when calling /users/add? And if I have a
beforeFilter in both my Users and App controllers, in what order are
they run?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CakeBot on #cakephp

2006-10-17 Thread John David Anderson (_psychic_)

Quick FYI:

You can ask her to point you to the pastebin using ~bin or  
~paste. If you want someone else to paste something you can ~tell  
nickName about bin, or ~tell nickName about paste.

Doing this autofills your IRC nick in a form field for the paste.  
Instead of copying and pasting the URL for the paste in the IRC  
channel, you can just ask the bot to show someone your last paste by  
~show nickName (which works for saved and non saved posts).

-- 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: Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread Trevor Burton
if the UserController extends AppController then (essentially) when you create an instance of the UserController class it contains all the members of the AppController Class as well as what's defined in UserController. They're created effectively as a single object.
So, by putting something in UserController - you're giving it access to AppController's stuff, too.So something in UserController will be able to access AppController - and then it will be able to get stuff from UserController. But you won't be able to put something in AppController which asks for something that UserController owns and then expect an instance of AppController to be able to get it to work.
If you have an Animal Class and your Dog Class extends Animal then your dog will have all the functionality of an Animal - but your Animal Class won't necessarily know how to bark!Does that make sense!?
On 10/17/06, brandags [EMAIL PROTECTED] wrote:
Alright. That makes sense.But since the Users controller extends the App controller, if I go to apage like:/users/addShouldn't that be creating a User object rather than an App object? Sothat when the beforeFilter runs, it's running through the User object?
For example, if I put the beforeFilter in the userController, itunderstands it. And I can call a function in the App controller whichcan THEN reference variables in the User controller just fine. But itseems that the beforeFilter runs BEFORE the User controller is created,
as if the App controller runs on its own before it's run as anextension of the Users controller. Am I making sense?When does the beforeFilter run when calling /users/add? And if I have abeforeFilter in both my Users and App controllers, in what order are
they run?
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


serving javascript instead of html

2006-10-17 Thread Rodrigo Tassinari

Hello all,

I need to serve Javascript as the output of one action, instead of
regurlar HTML. The purpose is that i want to be able to call this
action from other pages outsite cake (in another domain) like so:

script src=http://mysite/controller/action;
type=text/javascript/script

So the output of my action (a bunch of document.write()'s with HTML) is
rendered in the page that called it.

I can do this with a regular PHP file by sending a javascript header
and then echo'ing the javascript, like:

?php
header(Content-type: application/x-javascript );
echo document.write(\div id='mi_sabrosus'\);\n;
...
echo document.write(\/div\);\n;
?

So, to use this strategy in Cake I created a new layout with:

?php
header(Content-type: application/x-javascript );
echo $content_for_layout;
?

And set the action to use this layout via $this-layout. Then the view
does all the echo'ing of the javascript.

But this is not working. If I browse to
http://mysite/controller/action, the output I see is exactly the same
as if I browse to the regular PHP file in http://mysite/file.php.
However, trying to include the code in another page with script tags
doesn't work for the cake version, only for the normal PHP version.

I tried putting the header and the echo's directly in the controller
too, setting $this-autoRender to false, but that didn't work either.

I'm out of ideas now... If anyone could help me on this I'd very
apreciated.
Thanks,
Rodrigo.


--~--~-~--~~~---~--~~
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: Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread AD7six

The only time an app controller instance is ever created is when you
have an error ;).

But is that really relavent, from yoru first message:
you have code in your app controller referring to accessExceptions
The error message doesn't refer to your users controller
your pages controller (the on in the error message) doesn't have this
variable

If you want to follow that logic define an empty accessExceptions var
in your app controller and override it in each controller as
appropriate. However as I'm here, I would use the cake db-acl system
and make use of the demo related to this blog:
http://www.noswad.me.uk/MiBlog/ACLPart2

hth,

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: serving javascript instead of html

2006-10-17 Thread Chris Hartjes

On 10/17/06, Rodrigo Tassinari [EMAIL PROTECTED] wrote:

 Hello all,

 I need to serve Javascript as the output of one action, instead of
 regurlar HTML. The purpose is that i want to be able to call this
 action from other pages outsite cake (in another domain) like so:

 script src=http://mysite/controller/action;
 type=text/javascript/script


Hi Rodrigo,

I think you may be able to do this by telling your controller that you
wish to output things as Ajax instead of HTML.  I do this in my
Ajax-based controllers with the following line:

$this-layout = 'ajax'

I suppose you may be able to do different stuff like

$this-layout = 'text' but I have not done anything like that.

Hope that helps.
-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: serving javascript instead of html

2006-10-17 Thread nate

It might be because your header is wrong.  header(Content-type:
application/x-javascript ); should be header(Content-type:
text/javascript); to match the type of the requested content.


--~--~-~--~~~---~--~~
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.org and IE 7

2006-10-17 Thread nate

Clearly the ideal solution would be to forgo the use of Internet
Explorer altogether...


--~--~-~--~~~---~--~~
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: making controller methods private?

2006-10-17 Thread nate

The ability to call base class methods directly has already been
removed.  Just grab the latest Cake version.


--~--~-~--~~~---~--~~
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: making controller methods private?

2006-10-17 Thread Chris Hartjes

On 10/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Just preceed the function name with a underscore.


/me counts to five before replying to avoid getting labeled as angry or uncaring

Please note, the following rant is based on PHP, not Cake

Adding an underscore to a function name DOES NOT MAKE A FUNCTION
PRIVATE.  That is a commonly-used convention in PHP though, to make it
easier to figure out with functions SHOULD be private if your language
does not support making private methods of an object.

Ahem.

In PHP 5 you can declare a function private so that code that uses
your object cannot access that function directly.  I take it from
Nate's comments that it has been done already for Cake 1.2.

(There, that wasn't so bad...or angry)

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Is Model::findCount supposed to work?!?!?!?!

2006-10-17 Thread nate

You *can* do pagination (almost) completely in the model, but when you
see how it is implemented in 1.2, you'll realize why that's an
astoundingly bad idea.  Also, decorating data is a task reserved for
the View, and putting View logic in the Model violates the most basic
principles of MVC and is generally considered to be Pure Evil.


--~--~-~--~~~---~--~~
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 distinguish empty recordset from error in findAll()

2006-10-17 Thread nate

We're trying to get a dev version out in the next couple weeks.


--~--~-~--~~~---~--~~
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: making controller methods private?

2006-10-17 Thread Samuel DeVore

no but it does make it private 'like' in cakephp in that it can not be
called with the /controller/method from the browser.

On 10/17/06, Chris Hartjes [EMAIL PROTECTED] wrote:

 On 10/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  Just preceed the function name with a underscore.
 

 /me counts to five before replying to avoid getting labeled as angry or 
 uncaring

 Please note, the following rant is based on PHP, not Cake

 Adding an underscore to a function name DOES NOT MAKE A FUNCTION
 PRIVATE.  That is a commonly-used convention in PHP though, to make it
 easier to figure out with functions SHOULD be private if your language
 does not support making private methods of an object.

 Ahem.

 In PHP 5 you can declare a function private so that code that uses
 your object cannot access that function directly.  I take it from
 Nate's comments that it has been done already for Cake 1.2.

 (There, that wasn't so bad...or angry)

 --
 Chris Hartjes

 The greatest inefficiencies come from solving problems you will never have.
 -- Rasmus Lerdorf

 @TheBallpark - http://www.littlehart.net/attheballpark
 @TheKeyboard - http://www.littlehart.net/atthekeyboard

 



-- 
==
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: making controller methods private?

2006-10-17 Thread Chris Hartjes

On 10/17/06, Samuel DeVore [EMAIL PROTECTED] wrote:

 no but it does make it private 'like' in cakephp in that it can not be
 called with the /controller/method from the browser.

Hey Sam,

Is this actually a feature in CakePHP that it won't let object methods
that start with an underscore be accessed directly?  If so, that's a
neat bit of coding!

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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: Accessing variable in child class from app_controller's beforeFilter

2006-10-17 Thread brandags

Great! Thanks for your help. I'll continue to consider ACL. But since I
want (non-techy) end-users to be able to manage permissions for those
in their hierarchy, I don't want them to be confused with having to
grant access to particlar controllers or function names (actions), etc.


So in this system, I'm categorizing my controllers, and using some
default actions (view,index,add,edit,delete), and mapping all other
actions (the exceptions) to one of the defaults - to make it easy for
the end user, and the programmer, to manage permissions.
If ACL can do this well, I'm certainly open to it.


--~--~-~--~~~---~--~~
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: Re: making controller methods private?

2006-10-17 Thread Samuel DeVore

yea try it

On 10/17/06, Chris Hartjes [EMAIL PROTECTED] wrote:

 On 10/17/06, Samuel DeVore [EMAIL PROTECTED] wrote:
 
  no but it does make it private 'like' in cakephp in that it can not be
  called with the /controller/method from the browser.

 Hey Sam,

 Is this actually a feature in CakePHP that it won't let object methods
 that start with an underscore be accessed directly?  If so, that's a
 neat bit of coding!

 --
 Chris Hartjes

 The greatest inefficiencies come from solving problems you will never have.
 -- Rasmus Lerdorf

 @TheBallpark - http://www.littlehart.net/attheballpark
 @TheKeyboard - http://www.littlehart.net/atthekeyboard

 



-- 
==
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: serving javascript instead of html

2006-10-17 Thread Rodrigo Tassinari

I tested both suggestions: using the ajax layout ($this-layout =
'ajax' ) and changing the the header to header(Content-type:
text/javascript);. Both did not work. :(

I know this is happening because of something to do with CakePHP,
because it works if I just use a regular php file to output the
javascript, and the code that outputs the javascript is identical in
both the regular file and in my action/view with 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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: serving javascript instead of html

2006-10-17 Thread Chris Hartjes

On 10/17/06, Rodrigo Tassinari [EMAIL PROTECTED] wrote:

 I tested both suggestions: using the ajax layout ($this-layout =
 'ajax' ) and changing the the header to header(Content-type:
 text/javascript);. Both did not work. :(

 I know this is happening because of something to do with CakePHP,
 because it works if I just use a regular php file to output the
 javascript, and the code that outputs the javascript is identical in
 both the regular file and in my action/view with cakephp...


Well, I've been able to output content NOT as HTML, so I'd be looking
at my code before I blame CakePHP for the problem.

I think showing the list your code will solve this problem quickly.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



drag id in dropRemote

2006-10-17 Thread naryga

I have a div with id=albumCover.  I'm using $ajax-dropRemote() to
turn it into a drop zone that calls a Controller method.  It only
responds when an image with the class=draggers is dropped on it.
I've got that part down just fine.  My problem is that the method it is
calling needs to know some information about the draggable image that
is dropped on it.  How can I pass that information on the the
controller method?  I'm using the class of the draggable images instead
of individual id's because the images are generated dynamically and I
don't know what the id's will be ahead of time.  Specifically, I need
to send along the dragged image's new x and y coordinates.  I've been
using top and left so far.  Any assistance is greatly appreciated!


--~--~-~--~~~---~--~~
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: serving javascript instead of html

2006-10-17 Thread Rodrigo Tassinari

You're right Chris, here's my code, hope you guys spot something I'm
doing wrong.

This is the regular PHP file, which works fine:

links.php
?php
header(Content-type: application/x-javascript );
echo document.write(\div id='mi_sabrosus'\);\n;
echo   document.write(\ul\);\n;
echo document.write(\lia title='Dicas do Augusto Campos para
ganhar dinheiro com progandas do Google'
href='http://br-linux.org/linux/usando-o-google-adsense-para-gerar-recursos-para-o-seu-projeto-livre'Usando
o Google Adsense para gerar recursos para o seu projeto livre |
BR-Linux.org/a/li\);\n;
echo document.write(\liMais em a title='links'
href='http://links.pittlandia.net'links/a\);\n;
echo   document.write(\/ul\);\n;
echo document.write(\/div\);\n;
?

These are the files I use in my cake app, which is not working:

badge.thtml (layout)
?php
header(Content-type: text/javascript);
echo $content_for_layout;
?

recent.thtml (view)
?php
echo document.write(\div id='mi_sabrosus'\);\n;
echo   document.write(\ul\);\n;
foreach ($links as $link):
  echo document.write(\lia
title='.utf8_decode($link['Link']['description']).'
href='.$link['Link']['url'].'.utf8_decode($link['Link']['title'])./a/li\);\n;
endforeach;
echo document.write(\liMais em a
title='.$siteConfig['nome_sistema'].'
href='.$siteConfig['link_sistema'].'.$siteConfig['nome_sistema']./a/li\);\n;
echo   document.write(\/ul\);\n;
echo document.write(\/div\);\n;
?

links_controller.php (controller, only showing the recent action)
function recent($quant = 5)
{
$this-layout = 'badge';
if (!empty($this-params['url']['q']))
{
$quant = $this-params['url']['q'];
}
$links = $this-Link-getLinks($quant);
$this-set('links', $links);
}

And finally, this is the page that tests the inclusion of the outputed
code in both methods:

links.html
html
head
  titleTeste de Links via Javascritp/title
/head
body
pTestando.../p
script src=http://links.pittlandia.net/links/recent?q=5;
type=text/javascript/script
pTestando de novo.../p
script src=http://www.pittlandia.net/links.php;
type=text/javascript/script
pAcabou o teste/p
/body
/html

You can try out for yourself by going to:
http://www.pittlandia.net/links.html

Thanks in advance,
Rodrigo.


--~--~-~--~~~---~--~~
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: Pagination not advancing results

2006-10-17 Thread LikeSoy

I mean that the same five (or 20, 30, etc.) results are displayed
whether you are on page one or page 101.

So this is page 2:
--
id vcourse_prefix   course_title
1   CLA Classical Mythology
2   AST Descriptive Astronomy
3   ECN The World Economy
4   ECN London's Financial Markets
5   ANT Cultures of the Iberian Peninsula

1 | *2* | 3 | 4 | 5 | 6 | 7 | 8 | ... | 140
---

and this is page 6:
--
id vcourse_prefix   course_title
1   CLA Classical Mythology
2   AST Descriptive Astronomy
3   ECN The World Economy
4   ECN London's Financial Markets
5   ANT Cultures of the Iberian Peninsula

1 | 2 | 3 | 4 | 5 | *6* | 7 | 8 | ... | 140
---

If you sort on another column, the results change, but then that new
set appears no matter what page you go to in the pagination links.


--~--~-~--~~~---~--~~
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: Pagination not advancing results

2006-10-17 Thread AD7six

You are probably not passing the var $page to your find

list($order,$limit,$page) = $this-Pagination-init();
$this-data = $this-Course-findAll(null, null, $order, $limit,
$page);

HTH,

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: Is Model::findCount supposed to work?!?!?!?!

2006-10-17 Thread SoCalCakeBaker

Well - sounds like the CakePHP team has this under control.  :)

Where in the 1.2 branch can I see how you guys did this?

B.


On Oct 17, 12:10 pm, nate [EMAIL PROTECTED] wrote:
 You *can* do pagination (almost) completely in the model, but when you
 see how it is implemented in 1.2, you'll realize why that's an
 astoundingly bad idea.  Also, decorating data is a task reserved for
 the View, and putting View logic in the Model violates the most basic
 principles of MVC and is generally considered to be Pure Evil.


--~--~-~--~~~---~--~~
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: serving javascript instead of html

2006-10-17 Thread SoCalCakeBaker

Hi Rodrego,

It doesn't look like you called render() in your controller action...

B.

On Oct 17, 1:05 pm, Rodrigo Tassinari [EMAIL PROTECTED] wrote:
 You're right Chris, here's my code, hope you guys spot something I'm
 doing wrong.

 This is the regular PHP file, which works fine:

 links.php
 ?php
 header(Content-type: application/x-javascript );
 echo document.write(\div id='mi_sabrosus'\);\n;
 echo   document.write(\ul\);\n;
 echo document.write(\lia title='Dicas do Augusto Campos para
 ganhar dinheiro com progandas do Google'
 href='http://br-linux.org/linux/usando-o-google-adsense-para-gerar-recursos...Usando
 o Google Adsense para gerar recursos para o seu projeto livre |
 BR-Linux.org/a/li\);\n;
 echo document.write(\liMais em a title='links'
 href='http://links.pittlandia.net'links/a\);\n;
 echo   document.write(\/ul\);\n;
 echo document.write(\/div\);\n;
 ?

 These are the files I use in my cake app, which is not working:

 badge.thtml (layout)
 ?php
 header(Content-type: text/javascript);
 echo $content_for_layout;
 ?

 recent.thtml (view)
 ?php
 echo document.write(\div id='mi_sabrosus'\);\n;
 echo   document.write(\ul\);\n;
 foreach ($links as $link):
   echo document.write(\lia
 title='.utf8_decode($link['Link']['description']).'
 href='.$link['Link']['url'].'.utf8_decode($link['Link']['title'])./a/li\);\n;
 endforeach;
 echo document.write(\liMais em a
 title='.$siteConfig['nome_sistema'].'
 href='.$siteConfig['link_sistema'].'.$siteConfig['nome_sistema']./a/li\);\n;
 echo   document.write(\/ul\);\n;
 echo document.write(\/div\);\n;
 ?

 links_controller.php (controller, only showing the recent action)
 function recent($quant = 5)
 {
 $this-layout = 'badge';
 if (!empty($this-params['url']['q']))
 {
 $quant = $this-params['url']['q'];
 }
 $links = $this-Link-getLinks($quant);
 $this-set('links', $links);

 }And finally, this is the page that tests the inclusion of the outputed
 code in both methods:

 links.html
 html
 head
   titleTeste de Links via Javascritp/title
 /head
 body
 pTestando.../p
 script src=http://links.pittlandia.net/links/recent?q=5;
 type=text/javascript/script
 pTestando de novo.../p
 script src=http://www.pittlandia.net/links.php;
 type=text/javascript/script
 pAcabou o teste/p
 /body
 /html

 You can try out for yourself by going to:http://www.pittlandia.net/links.html
 
 Thanks in advance,
 Rodrigo.


--~--~-~--~~~---~--~~
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: serving javascript instead of html

2006-10-17 Thread Rodrigo Tassinari

SoCalCakeBaker wrote:
 Hi Rodrego,

 It doesn't look like you called render() in your controller action...


Thanks SoCalCakeBaker, a simple $this-render() at the end of the
action seems to have solved the problem! I'll try some more tests, but
I think that solved 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
-~--~~~~--~~--~--~---