Tuesday, September 30, 2008

Re: Auth Redirect Problems

In my original response, I mentioned there are a couple of
requirements for this auth redirect issue to present itself and fail.
1 - logoutRedirect has to point to the loginAction. (your example
doesn't)
2 - autoRedirect needs to be true. (your example is set to false)
3 - You've called the logout action from a link on different
controller/action page than the user/logout page.

And it really doesn't make much sense to have your loginRedirect
pointed to itself.

Your example will not show the problem. And it will not autoRedirect
to a controlled page after authentication either.

On Sep 30, 1:06 am, "Okto Silaban" <o...@silaban.net> wrote:
> How come? I get no problem with the syntax.. It works fine for me..
>
> This is the full code in app/app_controller.php (I just copy paste it)
>
> beforeFilter()
> {
>         $this->Auth->loginAction = array('controller' => 'users', 'action'
> => 'login');
>         $this->Auth->logoutRedirect = '/';
>         $this->Auth->loginRedirect = array('controller' => 'users', 'action'
> => 'login');
>         $this->Auth->autoRedirect = FALSE;
>
> }
>
> Okto.Silaban.Net
>
> On Fri, Sep 26, 2008 at 10:00 PM, Tony Thomas <truet...@gmail.com> wrote:
>
> > This gives me an "unexpected T_VARIABLE" error on the line with $this-
> > >Auth->autoRedirect = FALSE;
>
> > I think the algorithm might be right, but the syntax is wrong.
>
> > On Sep 17, 12:20 pm, "Okto Silaban" <o...@silaban.net> wrote:
> > > I'm not really sure, but I think :
> > > $this->Auth->loginRedirect
>
> > > doesn't tell we're we gonna go after logging in..
>
> > > But, if we're acessing an area which not allowed by Auth, we will sent to
> > > that page.. (if you're not login yet..).
>
> > > So I set that in beforeFilter :
>
> > > function beforeFilter() {
> > >   $this->Auth->loginRedirect = array('controller' => 'controller_name',
> > > 'action' => 'index');
> > >    $this->Auth->autoRedirect = FALSE; // so after logging in we're not
> > auto
> > > redirected
>
> > > }
>
> > > then manually set
>
> > > function login() {
> > >     $this->redirect('somewhere');
> > >     exit();
>
> > > }
> > > On Tue, Sep 9, 2008 at 10:12 PM, Tony Thomas <truet...@gmail.com> wrote:
>
> > > > If someone is familiar with a post to this group or blog entry that
> > > > addresses this issue, please let me know. I've spent the morning
> > > > scouring both with no satisfactory results.
>
> > > > I have a cakePHP app on a shared server. In local testing, everything
> > > > worked fine. But mod_rewrite did not function properly on the shared
> > > > server, so I'm using CakePHP pretty URLS instead. Also caching (at
> > > > least temporarily) is off. I've uncommented the pertinent lines of
> > > > code in core.php and I've dutifully deleted the .htaccess files.
>
> > > > The problem I have is that after logging in, the redirect is
> > > > inconsistent. About 2/3 of the time I get redirected to
> > > >https://[base_url]/https:/[domain]. I just can't seem to find away
> > > > around this problem.
>
> > > > My login function looks like this:
>
> > > > function login() {
> > > >                        $this->Auth->loginRedirect = array('controller'
> > =>
> > > > 'controller_name', 'action' => 'index');
> > > >    }
>
> > > > I still get inconsistent results with the redirect going to a URL like
> > > > the former example the majority of the time. Any insight, links, etc.
> > > > would be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

html helper issue

Hello guys,
while i was trying to add some meta data in the header of my project i was able to add a "description" meta using a call to the html helper object, something like "echo $html->meta( 'description', 'some text here', array(), false );" to output ( <meta name="description" content="some text here"/> ), and likewise i was able to add the "keywords" meta but when i was trying to add other meta(s) like (Author, Abstract, Copyright ... etc) the output wasn't as expected when dealing with description and keywords, is there any way to generate the output for those metas as dealing with description and keywords metas?

Thanks in advance for any replies.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Any freelance jobs?

http://cakephp.org/jobs
http://withcake.com/

On Sep 28, 4:33 am, evert0n <ever...@notreve.com> wrote:
> Hi, guys anyone need a hand for cakephp projects?
>
> I'm avaliable for any opportunities as freelance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Schema troubles

Hi,

I'm having some trouble with schemas. I'm using 1.2.x.x trunk.

I'm using it to migrate my DB by using the update feature.
I use schema generate to do a snapshot of my development DB and use
schema update on prod with the generated schema file.

However, I've run into a few different problems:
1) It always seems to crash one of my tables every time, and even if I
repair it doesn't help, I must drop and create the table again:

var $jobs = array(
'id' => array('type'=>'integer', 'null' => false, 'default' =>
NULL, 'key' => 'primary'),
'dispatch_line_id' => array('type'=>'integer', 'null' => true,
'default' => NULL, 'key' => 'index'),
'personalized_product_id' => array('type'=>'integer', 'null' =>
false, 'default' => NULL, 'key' => 'index'),
'price' => array('type'=>'float', 'null' => false, 'default' =>
NULL, 'length' => '12,4'),
'quantity' => array('type'=>'integer', 'null' => false, 'default'
=> NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' =>
1), 'product' => array('column' => 'personalized_product_id', 'unique'
=> 0), 'dispatch_line' => array('column' => 'dispatch_line_id',
'unique' => 0))
);


2) It has trouble with primary key switching. I had a linking table
with 2 columns as a combined primary key. I then introduced a new
column called ID and wanted to use that instead as the primary key. It
seems to not handle it so well and doesn't do the update.


Has anyone else had great success with cake schemas in a production
environment to do updates?

thanks,
Tony.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: pushing my luck -- complete pm system?

I guess PM stands for 'Personal Messaging' system.

On 30 sep, 18:35, "Gonzalo Servat" <gser...@gmail.com> wrote:
> On Tue, Sep 30, 2008 at 1:26 PM, rocket <justin...@gmail.com> wrote:
>
> > I'm about to write a PM system for users... but why invent the wheel?
> > Anyone know of a good prebuilt cake pm system, or a vendor I can use?
>
> *
> What does PM stand for?
> Your abbreviation search returned 164 meanings*
>
> Which one of the 164 does your PM stand for?
>
> - Gonzalo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Wrong i18n query

Without posting the CakePHP code you used to generate your query,
there is little anyone can offer to help. Hopefully, however, you've
gotten this straightened out by now.

On Sep 24, 12:21 pm, davidhc <davi...@gmail.com> wrote:
> Hi at all!
> I'm using i18n and i'm trying to search results with a form. But
> cakephp creates a wrong query. I get the error below:
> SQL Error: 1054: Unknown column 'Category.names' in 'where clause'
>
> The query is:
> SELECT `Category`.*, `I18n__name`.`content`, `Category`.`id` FROM
> `categorys` AS `Category` LEFT JOIN `i18n` AS `I18n__name` ON
> (`Category`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model`
> = 'Category' AND `I18n__name`.`field` = 'name') WHERE
> `Category`.`names` LIKE '%AAA%' AND `I18n__name`.`locale` = 'en';
>
> But it should be:
> SELECT `Category`.*, `I18n__name`.`content`, `Category`.`id` FROM
> `categorys` AS `Category` LEFT JOIN `i18n` AS `I18n__name` ON
> (`Category`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model`
> = 'Category' AND `I18n__name`.`field` = 'name') WHERE
> `I18n__name`.`content` LIKE '%AAA%' AND `I18n__name`.`locale` = 'en'
>
> Note that the table name and the field name are wrong!
>
> I think cakephp should create a wright query...
>
> I hope you can help me...
> Thank you very much!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: pushing my luck -- complete pm system?

On Tue, Sep 30, 2008 at 1:26 PM, rocket <justinho1@gmail.com> wrote:

I'm about to write a PM system for users... but why invent the wheel?
Anyone know of a good prebuilt cake pm system, or a vendor I can use?

What does PM stand for?
Your abbreviation search returned 164 meanings


Which one of the 164 does your PM stand for?

- Gonzalo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

pushing my luck -- complete pm system?

I'm about to write a PM system for users... but why invent the wheel?
Anyone know of a good prebuilt cake pm system, or a vendor I can use?

thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to save twice??

perfect the ->create() works
i'd also like to tell others it unsets $this->data


On Sep 30, 12:03 pm, grigri <j...@hendersonwebdesign.com> wrote:
> > Btw, you also have saveAll(), which allows to save multiple records at
> > once.
>
> The 1.1 people don't have that
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: page refresh?

just implmemented it works. lol
cool :) i ended up doing a md5 on time() :)

On Sep 30, 11:30 am, rocket <justin...@gmail.com> wrote:
> interesting fix. thanks
>
> On Sep 29, 5:15 pm, "3lancer.eu" <kilc...@gmail.com> wrote:
>
> > Hi,
>
> > > but when you change the picture, the old picture is still stuck in the
> > > cache, so to see the new pic the user needs to push F5... I can't
> > > figure out how to "refresh" the page automatically.
>
> > > any ideas?
>
> > Simplest way is to add some random query string at the end of the url,
> > likehttp://example.com/images/some_profile_image.jpg?andThisIsSomeHash
>
> > It would be good to utilize the browser cache the proper way, so you
> > can try to set 'andThisIsSomeHash' to something like
> > md5($myModel['MyModel']['modified']) or md5(filemtime('images/
> > some_profile_image.jpg'));
>
> > Regards,
> > Piotr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to save twice??

> Btw, you also have saveAll(), which allows to save multiple records at
> once.

The 1.1 people don't have that


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: override built-in validation methods

I frequently override validation functions in AppModel, it works fine
for me.

Put a debug statement inside your AppModel's alphaNumeric method. If
it appears, then the problem is in your regexp/validation handling. If
it doesn't appear, you've probably got a typo in the method name.

Also make sure that your AppModel method prototype matches the 'Custom
Validation Methods' prototype from the manual, as it is NOT the same
as the prototype for Validation::alphaNumeric (first parameter of
model validation methods is an array: { key => value }, parameters of
Validation class methods are all scalar).

Actually, this last one sounds like it might well be the answer.

hth
grigri

On Sep 30, 4:49 pm, "rrd...@gmail.com" <rrd...@gmail.com> wrote:
> Is anyone knows how to properly overrdie a bult-in validation
> function?
>
> I just created in my app_model.php file a function named alphaNumeric,
> the whole function is the same as the built-in, I just changed the
> regex.
>
> Still I get error message:
> Warning (2): preg_match() expects parameter 2 to be string, array
> given [CORE/cake/libs/validation.php, line 830]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to save twice??

Btw, you also have saveAll(), which allows to save multiple records at
once.

On Sep 30, 11:50 am, teknoid <teknoid.cake...@gmail.com> wrote:
> you need to call $this->Post->create(); before the second save, that
> is if you are getting an update instead of an insert, but you've never
> specified what problem you are actually having.
>
> On Sep 30, 11:29 am, rocket <justin...@gmail.com> wrote:
>
> > I am trying to save an entry twice after getting processed.
>
> > Ideally the query would look like
>
> > $this->Post->save($this->data()); // the first save, so in the mySQL
> > db it will have id 1
> > $this->Post->save($this->data()); // a second save, so another row
> > with id 2
>
> > However it doens't seem to work correctly.
> > Does anyone knwo what I'm doing wrong?
>
> > also, i'm on 1.1x
>
> > thanks
> > rocket
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to save twice??

you need to call $this->Post->create(); before the second save, that
is if you are getting an update instead of an insert, but you've never
specified what problem you are actually having.

On Sep 30, 11:29 am, rocket <justin...@gmail.com> wrote:
> I am trying to save an entry twice after getting processed.
>
> Ideally the query would look like
>
> $this->Post->save($this->data()); // the first save, so in the mySQL
> db it will have id 1
> $this->Post->save($this->data()); // a second save, so another row
> with id 2
>
> However it doens't seem to work correctly.
> Does anyone knwo what I'm doing wrong?
>
> also, i'm on 1.1x
>
> thanks
> rocket
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

override built-in validation methods

Is anyone knows how to properly overrdie a bult-in validation
function?

I just created in my app_model.php file a function named alphaNumeric,
the whole function is the same as the built-in, I just changed the
regex.

Still I get error message:
Warning (2): preg_match() expects parameter 2 to be string, array
given [CORE/cake/libs/validation.php, line 830]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to save twice??

Hi rocket,

> I am trying to save an entry twice after getting processed.
>
> Ideally the query would look like
>
> $this->Post->save($this->data()); // the first save, so in the mySQL
> db it will have id 1
> $this->Post->save($this->data()); // a second save, so another row
> with id 2
>
> However it doens't seem to work correctly.
> Does anyone knwo what I'm doing wrong?
>
> also, i'm on 1.1x

Call $this->Post->create() before the second save() to reset the
models state.

Hope that helps!

--
Daniel Hofstetter
http://cakebaker.42dh.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Finding records that have associated records

I'm a bit of a newbie when it comes to CakePHP and MySQL and I'm not
really sure about all of the terminology involved, so if this question
has been asked before, I apologize.

I have three models:

Skill
Tree
Link

A Skill hasAndBelongsToMany Links. A Skill hasMany Trees. Under
normal circumstances, a Skill should have at least 1 Link and 1 Tree.
But there are valid reasons that a Skill may have 0 Links and/or 0
Trees (e.g. when the Skill is a work-in-progress), but the casual end-
user of the site shouldn't really see these. Since there are
currently 707 Skills, I use Paginator to display them.

What I want to do is create some kind of Paginator query or condition
that will only display Skills that have 1 or more Links and 1 or more
Trees.

(I know I could probably do it easily using a tree_count and
link_count field in the skills table, but that'll be a lot of hassle
to set up. I was thinking there might be some better way to use, say,
a MySQL COUNT() function instead.)

Any thoughts? Thanks for your help!

Daniel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Simple Ajax link to update div

Thanks for the reply.

I placed an fwrite statement in ajaxfcn1() and it is writing to file.
So I'm getting as far as triggering ajaxfcn1 now. But the div isn't
updating.
I guess what I am having trouble understanding is how CakePHP
generates a response to the asynchronous call. With the standard
javascript XMLhttprequest object, the server-side php usually
generates an xml response containing the desired data to be is sent
back to the client.

eg. something like this:
===============
<?php
$data = "this is a test";

// we'll generate XML output
header('Content-Type: text/xml');
// generate XML header
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
// create the <response> element
echo '<response>';
//
echo $data;
// close the <response> element
echo '</response>';
?>
=================

then you can use $data on the client side javascript, for example
placing it in a <div> element.

I understand that this is abstracted out in CakePHP, but I am having a
hard time understanding the process conceptually. In CakePHP how is
this xml data generated? (how do I place data in the response to be
passed back to the client)? And how do I update divs with it? (without
having access to js functions like
document.getElementById("divout").innerHTML). thanks

On Sep 30, 9:07 am, Donkeybob <rip...@gmail.com> wrote:
> it looks like your syntax is wrong for the ajax link . . .no
> parenthesis around '$ajax->link' code either . . .check outhttp://book.cakephp.org/view/212/Methodsfor proper syntax.
>
> from the manual related to your code
> <?php echo $ajax->link('View Post',
> array( 'controller' => 'tests', 'action' => 'ajaxfcn1', 1 ),
> array( 'update' => 'divout', 'complete' => 'alert( "Executed
> OK" )' )
> );
> ?>
>
> in your controller function:
>
> echo "Controller Executed";
>
> as long as protoptype is linked up, then that should work.
>
> On Sep 29, 11:56 pm, qwanta <rgmic...@gmail.com> wrote:
>
> > Hi,
> > I have been struggling a bit to get a simple Ajax link working. I have
> > searched this group for help in older posts, but it seems like a key
> > tutorial (the grahambird one) is no longer available - perhaps because
> > it no longer works with 1.2.
>
> > If there is a tutorial somewhere that covers this, please let me know.
> > I think I have gone over all the available (through google) CakePHP
> > ajax tutorials, but unfortunately without success - some are outdated
> > (pre 1.2), others do not have full working code etc...
>
> > In any case, here is my code:
> > ========================================
> > index.ctp
> > <h2>Ajax 3 - testing ajax link and button</h2>
> > <?php
> > $link_array1 = array('controller'=>'tests' ,
> > 'action'=>'ajaxfcn1'); // the function to execute: function
> > ajaxfcn1 in controller tests
>
> > $link_array2 = array( 'update' => 'divout',
> > 'complete' => 'alert( "Executed OK" )' ); // the div we want
> > to update
>
> > echo ($ajax->link('this an ajax link', $link_array1,
> > $link_array2,'Confirmation String'));
>
> > echo "<br/><br/>";
>
> > echo ($ajax->submit('this is an ajax button', $link_array1,
> > $link_array2,'Confirmation String'));
> > ?>
> > <br/>
> > <div id="divout">
> > the div to update
> > </div>
> > ========================================
> > tests_controller.php
> > <?php
> > class TestsController extends AppController {
>
> > var $name = 'Tests';
> > var $uses = array(); // prevent cake from looking for a database
> > model
>
> > function index() {
>
> > }
>
> > function ajaxfcn1() {
> > $this->render('index', 'ajax');
> > }}
>
> > ?>
> > ========================================
>
> > So basically I have a view with an ajax link, an ajax button, and a
> > <div>. I would like to change the text in the div when I click the
> > link or button. At this point, nothing happens when I click them. I am
> > not sure if the ajaxfcn1() function is even executing at this point.
> > What's an easy statement to add in ajaxfcn1() to determine if the code
> > is executing? What function would I use to set the new div text from
> > within ajaxfcn1()?
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: page refresh?

interesting fix. thanks

On Sep 29, 5:15 pm, "3lancer.eu" <kilc...@gmail.com> wrote:
> Hi,
>
> > but when you change the picture, the old picture is still stuck in the
> > cache, so to see the new pic the user needs to push F5... I can't
> > figure out how to "refresh" the page automatically.
>
> > any ideas?
>
> Simplest way is to add some random query string at the end of the url,
> likehttp://example.com/images/some_profile_image.jpg?andThisIsSomeHash
>
> It would be good to utilize the browser cache the proper way, so you
> can try to set 'andThisIsSomeHash' to something like
> md5($myModel['MyModel']['modified']) or md5(filemtime('images/
> some_profile_image.jpg'));
>
> Regards,
> Piotr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

how to save twice??

I am trying to save an entry twice after getting processed.

Ideally the query would look like

$this->Post->save($this->data()); // the first save, so in the mySQL
db it will have id 1
$this->Post->save($this->data()); // a second save, so another row
with id 2

However it doens't seem to work correctly.
Does anyone knwo what I'm doing wrong?

also, i'm on 1.1x

thanks
rocket
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: validate alphanumeric

It seems somehow the root of the problem is I try to override the
built-in alpaNumeric function. Still no idea how to solve it
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Find - table join - find all posts by user_id using the name

Hi,

Im building a site where i would like to retrieve all articles based
on a username. The username is supplied as part of the url i.e.
mysite.com/userName.

So i need to use find to list all posts based on username however I
only have user_id in the posts table, which then joins to the user
table on id.

So im looking for an example of how to run a find command passing in
the username, and joining on the user_id to the user table.

Can anyone advise?

Best regards, Ben.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: javascipt onclick in $html->image

Double quotes should work too:

'on_click' => "open_win($id);"

On 30 sep, 10:37, bartez <alexmbar...@googlemail.com> wrote:
> Panic over
>
> answer is:
>
> 'onclick'=>'open_win('. $id .')'
>
> cheers
>
> a
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: javascipt onclick in $html->image

Panic over


answer is:

'onclick'=>'open_win('. $id .')'


cheers

a
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

javascipt onclick in $html->image

hey all,

This is really bugging me and i'm sure it's something that i'm not
doing.

my code is:

$id = $module['Module']['id'];
echo $form->input($module['Module']['refer_name'],
array(
'label'=>$module['Module']['title'].$html->image('1/
question.gif',
array(
'class'=>'question',
'onclick'=>'open_win($id)'
)),
'type'=>'checkbox',
'value'=>$module['Module']['price'],
'onclick'=>'addValue(this)'
));

This issue is with the onclick => open_win($id). it is not being
passed correctly. I have tried various combinations and they are as
follows:
(the code works fine if i pass a number through: open_win(1))

In this example, $id is equal to 2.


$id = blank, i.e it is defined but as blank
'$id' = error (unexpected T_VARIABLE)
"$id" = $id (not the value)
<?php echo $id; ?> = blank, i.e. it is defined but as blank
'<?php echo $id; ?>' = error (unexpected '?')
"<?php echo $id;?>" = <?php echo $id;?> not the value

Has anyone come across this before or has anyone got some pointers?

Cheers

alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: 'schema generate' and different connections (was: help with YAML pls basic syntax...etc)

David,

So you have different models using different connections, and when
specifying a -connection
the shell is attempting to schem-ify models not using that connection?

If that is the case please open a ticket, with some examples on how to
reproduce it.

-Mark

On Sep 30, 1:53 am, "David C. Zentgraf" <dec...@gmail.com> wrote:
> Speaking of which...
>
> I have multiple connections in my database.conf. Running a 'cake
> schema generate' always quits with "Error: Missing database table 'x'
> for model 'y'". Even doing 'schema -connection alt -name Model
> generate' quits with the same message. Depending on which '-
> connection' I specify it quits on different models, so it seems it
> always tries to generate schemas for all models, ignoring my flags.
>
> Am I misusing the schema shell or should I open a ticket?
>
> Chrs,
> Dav
>
> On 30 Sep 2008, at 05:03, mark_story wrote:
>
> > In 1.2 there is a builtin Schema shell (console app) that can manage
> > things like ALTER statements that need to be run on a db between runs.
> > To my knowledge it doesn't insert records. From a prompt cd into
> > cake/
> > console and try cake schema help. That will give you a list of
> > commands supported by the SchemaShell.
>
> > -Mark
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Using model without a database for form

Hi
I am not sure if this has already been asked, but i couldnt find the
answer anywhere sad.gif

Anyway my question is
i have a controller,model and view
i dont want to use database/tables since persistance will be
webservice(soap) based.
and i am using cake_1.2.0.7296-rc2.
PHP Code
<?php

/**
* cheers_controller.php
*/
class CheersController extends AppController {

//it seems to work without defining this, but nevertheless:-/
$helpers = array('Form');
function add(){

if (!empty($this->data)) {

if ($this->Cheer->save($this->data)) {
$this->flash('Your post has been saved.', '/cheers');
}else
{
$this->flash('Your post has NOT been saved.', '/
cheers');
}
}
}
}

/**
* cheer.php
*/
class Cheer extends AppModel
{
var $name = "Cheer";
var $useTable = false;
}

/**
* add.ctp
*/
echo $form->create('Cheer');

?>

throws this error
CODE

Fatal error: Call to a member function schema() on a non-object in C:
\xampp\htdocs\cake_1.2.0.7296-rc2\cake\libs\view\helpers\form.php on
line 127

what more do i need to do? after much googling it looks like i have to
override schema() function in my model.
but i cant seem to figure out how? i tried to return a array but still
doesnt work
PHP Code
<?php

/**
* cheer.php
*/
class Cheer extends AppModel
{
var $name = "Cheer";
var $useTable = false;
var $_schema = array(
'uid' => array('type' => 'string','null' => 1, 'default' =>
'','length' => 30),
'msg' => array('type' => 'string','null' => 1, 'default' =>
'','length' => 30),
'senderId' => array('type' => 'string','null' => 1,
'default' => '','length' => 30)
);
function schema($field = false)
{
return $this->_schema;
}
}

?>

Any help, direction would be a greatly appreciated.
Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: bigner for cake

On Sep 30, 8:28 am, anjum <anjum.farr...@gmail.com> wrote:
> I am also getting same error on this example I putted the file into
> app/view/tasks/index.ctp

Hi I assume you are both working through the samples in the book
CakePHP Application Development by Ahsanul Bari and Anupom Syam? If so
I have done these and they do work.

anjum - It might just be a typo in your message but that should be
'views' not 'view'...

app/views/tasks/index.ctp

akhilesh - I agree with Donkeybob your index.ctp should be in a sub
folder called...

app/views/tasks/index.ctp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: bigner for cake

Hi, As you have already created a table, why not try to use the
commandline 'Cake Bake' script?
This should give you a flying start and create everything you
need :-)


On Sep 23, 12:31 pm, akhilesh <akhilesh_singh1...@yahoo.co.in> wrote:
> http://localhost/myfirstcake/
> this is my cake folder name
> ------------------------------------------
>
> i have set in httpd.conf both
>
> Apache mod_rewrite module is switched on
> AllowOverride is set to all
>
> temp dir is writable
> ---------------------------------------------
> table sturucture is
>
> CREATE TABLE tasks (
> id int(10) unsigned NOT NULL auto_increment,
> title varchar(255) NOT NULL,
> done tinyint(1) default NULL,
> created datetime default NULL,
> modified datetime default NULL,
> PRIMARY KEY (id)
> );
>
> database.php.default. Rename to database.php
>
> my database configuration file is present and Cake is able to connect
> to the database
> ---------------------------------------------
>
> my cake module file is CakeTooDoo/app/models/task.php, write the
> following code:
>
> <?php
> class Task extends AppModel {
> var $name = 'Task';}
>
> ?>
> ---------------------------------------------
>
> Controller file is CakeTooDoo/app/controllers/tasks_controller.php,
> with the following code:
>
> <?php
> class TasksController extends AppController {
> var $name = 'Tasks';
> function index() {
> $this->set('tasks', $this->Task->find('all'));}
> }
>
> ?>
>
> ---------------------------------------------
>
> CakeTooDoo/app/views/index.ctp
>
> <h2>Tasks</h2>
> <?php if(empty($tasks)): ?>
> There are no tasks in this list
> <?php else: ?>
> <table>
> <tr>
> <th>Title</th>
> <th>Status</th>
> <th>Created</th>
> <th>Modified</th>
> <th>Actions</th>
> </tr>
> <?php foreach ($tasks as $task): ?>
> <tr>
> <td>
> <?php echo $task['Task']['title'] ?>
> </td>
> <td>
> <?php
> if($task['Task']['done']) echo "Done";
> else echo "Pending";
> ?>
> </td>
> <td>
> <?php echo $task['Task']['created'] ?>
> </td>
> <td>
> <?php echo $task['Task']['modified'] ?>
> </td>
> <td>
> <!-- actions on tasks will be added later -->
> </td>
> </tr>
> <?php endforeach; ?>
> </table>
> <?php endif; ?>
>
> ---------------------------------------------
>
> i am trying to run with this link but it is not runhttp://localhost/CakeTooDoo/tasks/index
>
> i am new for this frame work
> can any one tell me what is the problem in this cake application
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how can run my first program in cakephp

if you follow the manual step by step, then you should have a basic
cake site running. Run through the blog tutorial . . .it will help.

On Sep 30, 4:19 am, "Sonal Kumari" <mera3p...@gmail.com> wrote:
> Hi All
> i m new in cakephp.
> i have installed all things regradinh cakephp....... and now i want to run
> my programs..
> but not getting proper........
> so anyone would you help me...
> plz give me steps for first program..........
>
> thanks a lot......
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: app_controller.php causing errors with my app

No problem.

Perhaps you had moment of "crazy"? :-)

On Sep 30, 3:07 pm, Ryan <ryan.mckil...@gmail.com> wrote:
> That did it. What was I thinking?!
>
> Thank you
>
> On Sep 30, 4:47 am, "dr. Hannibal Lecter" <lecter...@gmail.com> wrote:
>
> > This may be a dumb suggestion, but try removing the "var $name =
> > 'AppController';" line and see if that helps.
>
> > It's not correct anyways, or at least seems incorrect to me.
>
> > On Sep 29, 11:57 pm, Ryan <ryan.mckil...@gmail.com> wrote:
>
> > > I am working on a new app and everything was playing nicely until I
> > > added a simple app_controller.php in order to take advantage of the
> > > Firecake helper:
>
> > > <?php
> > > class AppController extends Controller {
> > >         var $name = 'AppController';
> > >         var $helpers = array('Html', 'Form', 'Javascript', 'Firecake');}
>
> > > ?>
>
> > > Now I am getting errors:
>
> > > Notice (8): Undefined property: ItemsController::$Item [APP/
> > > controllers/items_controller.php, line 6]
>
> > > Fatal error: Call to a member function find() on a non-object in /web/
> > > php/balistik_list_app/app/controllers/items_controller.php on line 6
>
> > > When I delete app_controller.php everything works again. Any ideas?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Simple Ajax link to update div

it looks like your syntax is wrong for the ajax link . . .no
parenthesis around '$ajax->link' code either . . .check out
http://book.cakephp.org/view/212/Methods for proper syntax.

from the manual related to your code
<?php echo $ajax->link('View Post',
array( 'controller' => 'tests', 'action' => 'ajaxfcn1', 1 ),
array( 'update' => 'divout', 'complete' => 'alert( "Executed
OK" )' )
);
?>

in your controller function:

echo "Controller Executed";

as long as protoptype is linked up, then that should work.


On Sep 29, 11:56 pm, qwanta <rgmic...@gmail.com> wrote:
> Hi,
> I have been struggling a bit to get a simple Ajax link working. I have
> searched this group for help in older posts, but it seems like a key
> tutorial (the grahambird one) is no longer available - perhaps because
> it no longer works with 1.2.
>
> If there is a tutorial somewhere that covers this, please let me know.
> I think I have gone over all the available (through google) CakePHP
> ajax tutorials, but unfortunately without success - some are outdated
> (pre 1.2), others do not have full working code etc...
>
> In any case, here is my code:
> ========================================
> index.ctp
> <h2>Ajax 3 - testing ajax link and button</h2>
> <?php
>         $link_array1 = array('controller'=>'tests' ,
>                                                                 'action'=>'ajaxfcn1');               // the function to execute: function
> ajaxfcn1 in controller tests
>
>         $link_array2 = array( 'update' => 'divout',
>                                                                 'complete' => 'alert( "Executed OK" )' );  // the div we want
> to update
>
>         echo ($ajax->link('this an ajax link', $link_array1,
> $link_array2,'Confirmation String'));
>
>         echo "<br/><br/>";
>
>         echo ($ajax->submit('this is an ajax button', $link_array1,
> $link_array2,'Confirmation String'));
> ?>
> <br/>
> <div id="divout">
> the div to update
> </div>
> ========================================
> tests_controller.php
> <?php
> class TestsController extends AppController {
>
>         var $name = 'Tests';
>         var $uses = array();            // prevent cake from looking for a database
> model
>
>         function index() {
>
>         }
>
>         function ajaxfcn1() {
>                         $this->render('index', 'ajax');
>         }}
>
> ?>
> ========================================
>
> So basically I have a view with an ajax link, an ajax button, and a
> <div>. I would like to change the text in the div when I click the
> link or button. At this point, nothing happens when I click them. I am
> not sure if the ajaxfcn1() function is even executing at this point.
> What's an easy statement to add in ajaxfcn1() to determine if the code
> is executing? What function would I use to set the new div text from
> within ajaxfcn1()?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

ACL checking in find()

Hi there,

I'm currently working on an application that makes use of the Cake
ACL component with the database backed configuration. This is working
wonderfully and I am able to assign permissions to my ACO's for my
ARO's and ensure that they are enforced throughout my application with
liberal calls to the 'check' method of the ACL class. The ACO's in my
case are 'Event' instances, and the ARO's are specicic users. Both are
set up with proper foreign_key references in the ARO and ACO tables.

However, I am now running into an issue I hadn't thought of.
Specifically, I need to load a list of Events from the database
between two dates that a user has 'view' permission for. I've had no
trouble loading this list of events without worrying about permission,
but now I need to integrate that bit. I realize that I can ignore the
permissions in the DB query and then loop through the results trimming
out ones that fail a call to Acl->check(), but this seems like an
incredibly inefficient way of doing things.

What I would like to know, is if there is an easy way for me to
integrate permissions checking into the 'find' call I am using to
fetch the events.

Adding the ARO and ACO objects as relationships in my event and user
model has been done, so I suppose I could crawl my way down and check
the permissions that way using a large value for the 'recursive'
property of find, but again, this seems like it might not scale very
effectively.

Any ideas are greatly appreciated! Let me know if I can clarify my
question further.

- Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: help me understand cakaphp

http://book.cakephp.org/view/219/Blog
http://groups.google.com/group/cake-php/web/faq
bakery app https://svn.cakeforge.org/svn/bakery
there's some cakephp books on amazon


On Sep 30, 3:16 pm, "vikramgr...@gmail.com" <vikramgr...@gmail.com>
wrote:
>  I m totally new to cakephp and i need to develope my project using
> cakephp framework .Previously all projects was done using simple php
> coding no framework nothing was used.Can any body tell me how do i
> start my application using cakephp. Before this i used devlope coding
> in php  .I have read the begining mannual but not understood how to
> start.So plz tell me from the beging steps.If posiible plz give any
> example of theapplication where cakephp was used.
>          not exactally where i have use code and put and how run on
> localserver
>
>     Will be very thankfull if somebosy helps me in
> this regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: cake bake doesn't find new tables

Thank you. Works excellent now. :)

On Sep 30, 3:05 pm, Markus Muschol <devbluescr...@googlemail.com>
wrote:
> You have to clean the cache.
> Delete all files in tmp/cache/models.
>
> Best Regards
>
> Am 30.09.2008 um 14:54 schrieb Kenchu:
>
>
>
> > I use cake bake to generate all my controllers, views and models.
> > Unfortunatelyl cake bake doesn't seem to realize the changes I make in
> > my database anymore. I've added a couple of more tables, but when I
> > try to bake some new models, they aren't even in the list of models.
> > Only the old tables are. I've checked the database configuration
> > multiple times and cannot see anything that would suggest why cake is
> > acting this way.
>
> > database.php
>
> > class DATABASE_CONFIG {
>
> >    var $default = array(
> >            'driver' => 'mysql',
> >            'persistent' => false,
> >            'host' => 'localhost',
> >            'login' => 'root',
> >            'password' => '',
> >            'database' => 'mydb',
> >            'prefix' => '',
> >    );
> > }
>
> > If I do this in the command prompt:
>
> > mysql .... (password and user details) ENTER
> > use mydb; ENTER
> > show tables; ENTER
>
> > I get this:
>
> > +-----------------+
> > | Tables_in_mydb  |
> > +-----------------+
> > | adresses        |
> > | bankaccounts    |
> > | banks           |
> > | cars            |
> > | categories      |
> > | comments        |
> > | countries       |
> > | orders          |
> > | orders_products |
> > | products        |
> > | searches        |
> > | users           |
> > +-----------------+
> > 12 rows in set (0.00 sec)
>
> > Using cake bake I get these:
>
> > Possible Models based on your current database:
> > 1. Bankaccount
> > 2. Bank
> > 3. Category
> > 4. Comment
> > 5. Country
> > 6. Order
> > 7. OrdersProduct
> > 8. Product
> > 9. Search
> > 10. User
>
> > Cars and adresses are new tables. Both of them are not present in the
> > list. Any ideas what's wrong here?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Auth Redirect Problems

I don't know why. Are you you using 1.2 or 1.1? I'm using 1.2.

This:

$this->Auth->autoRedirect = FALSE;

Gives me:

"unexpected T_VARIABLE"

I haven't had a chance to investigate.

On Sep 30, 2:06 am, "Okto Silaban" <o...@silaban.net> wrote:
> How come? I get no problem with the syntax.. It works fine for me..
>
> This is the full code in app/app_controller.php (I just copy paste it)
>
> beforeFilter()
> {
>         $this->Auth->loginAction = array('controller' => 'users', 'action'
> => 'login');
>         $this->Auth->logoutRedirect = '/';
>         $this->Auth->loginRedirect = array('controller' => 'users', 'action'
> => 'login');
>         $this->Auth->autoRedirect = FALSE;
>
> }
>
> Okto.Silaban.Net
>
> On Fri, Sep 26, 2008 at 10:00 PM, Tony Thomas <truet...@gmail.com> wrote:
>
> > This gives me an "unexpected T_VARIABLE" error on the line with $this-
> > >Auth->autoRedirect = FALSE;
>
> > I think the algorithm might be right, but the syntax is wrong.
>
> > On Sep 17, 12:20 pm, "Okto Silaban" <o...@silaban.net> wrote:
> > > I'm not really sure, but I think :
> > > $this->Auth->loginRedirect
>
> > > doesn't tell we're we gonna go after logging in..
>
> > > But, if we're acessing an area which not allowed by Auth, we will sent to
> > > that page.. (if you're not login yet..).
>
> > > So I set that in beforeFilter :
>
> > > function beforeFilter() {
> > >   $this->Auth->loginRedirect = array('controller' => 'controller_name',
> > > 'action' => 'index');
> > >    $this->Auth->autoRedirect = FALSE; // so after logging in we're not
> > auto
> > > redirected
>
> > > }
>
> > > then manually set
>
> > > function login() {
> > >     $this->redirect('somewhere');
> > >     exit();
>
> > > }
> > > On Tue, Sep 9, 2008 at 10:12 PM, Tony Thomas <truet...@gmail.com> wrote:
>
> > > > If someone is familiar with a post to this group or blog entry that
> > > > addresses this issue, please let me know. I've spent the morning
> > > > scouring both with no satisfactory results.
>
> > > > I have a cakePHP app on a shared server. In local testing, everything
> > > > worked fine. But mod_rewrite did not function properly on the shared
> > > > server, so I'm using CakePHP pretty URLS instead. Also caching (at
> > > > least temporarily) is off. I've uncommented the pertinent lines of
> > > > code in core.php and I've dutifully deleted the .htaccess files.
>
> > > > The problem I have is that after logging in, the redirect is
> > > > inconsistent. About 2/3 of the time I get redirected to
> > > >https://[base_url]/https:/[domain]. I just can't seem to find away
> > > > around this problem.
>
> > > > My login function looks like this:
>
> > > > function login() {
> > > >                        $this->Auth->loginRedirect = array('controller'
> > =>
> > > > 'controller_name', 'action' => 'index');
> > > >    }
>
> > > > I still get inconsistent results with the redirect going to a URL like
> > > > the former example the majority of the time. Any insight, links, etc.
> > > > would be appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

help me understand cakaphp

I m totally new to cakephp and i need to develope my project using
cakephp framework .Previously all projects was done using simple php
coding no framework nothing was used.Can any body tell me how do i
start my application using cakephp. Before this i used devlope coding
in php .I have read the begining mannual but not understood how to
start.So plz tell me from the beging steps.If posiible plz give any
example of theapplication where cakephp was used.
not exactally where i have use code and put and how run on
localserver

Will be very thankfull if somebosy helps me in
this regards

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: CakePHP 1.1, AJAX and forms not doing anything.

Hi

You should at least give the code from your view, so that we can
figure out what's going on.

Also, english is not my mother language, and I don't understand this sentence :
> However, the $ajax->link's works just fine and when I click one of the
> links, resultin an update to the that element and then return back to
> the original "element" the form starts to work.

Please be a bit more clear.
+++++++
Clément

On Tue, Sep 30, 2008 at 1:34 PM, aka <antti.alho@gmail.com> wrote:
>
> Hi!
>
> I have a controller, which fetches other controllers data through
> requestAction().
>
> The first element contains a form in which there is an $ajax-
>>submit(...);
>
> the problem here is that the form does nothing. The form doesen't even
> send XHR request.
>
> However, the $ajax->link's works just fine and when I click one of the
> links, resultin an update to the that element and then return back to
> the original "element" the form starts to work.
>
> Am I missing something? becouse this seems very odd.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: cake bake doesn't find new tables

Hi,

when you make changes to the database you have to clean the cache.
Delete all files in tmp/cache/models/. Then you should find your new
table.

On 30 Sep., 14:54, Kenchu <SweKen...@gmail.com> wrote:
> I use cake bake to generate all my controllers, views and models.
> Unfortunatelyl cake bake doesn't seem to realize the changes I make in
> my database anymore. I've added a couple of more tables, but when I
> try to bake some new models, they aren't even in the list of models.
> Only the old tables are. I've checked the database configuration
> multiple times and cannot see anything that would suggest why cake is
> acting this way.
>
> database.php
>
> class DATABASE_CONFIG {
>
>         var $default = array(
>                 'driver' => 'mysql',
>                 'persistent' => false,
>                 'host' => 'localhost',
>                 'login' => 'root',
>                 'password' => '',
>                 'database' => 'mydb',
>                 'prefix' => '',
>         );
>
> }
>
> If I do this in the command prompt:
>
> mysql .... (password and user details) ENTER
> use mydb; ENTER
> show tables; ENTER
>
> I get this:
>
> +-----------------+
> | Tables_in_mydb  |
> +-----------------+
> | adresses        |
> | bankaccounts    |
> | banks           |
> | cars            |
> | categories      |
> | comments        |
> | countries       |
> | orders          |
> | orders_products |
> | products        |
> | searches        |
> | users           |
> +-----------------+
> 12 rows in set (0.00 sec)
>
> Using cake bake I get these:
>
> Possible Models based on your current database:
> 1. Bankaccount
> 2. Bank
> 3. Category
> 4. Comment
> 5. Country
> 6. Order
> 7. OrdersProduct
> 8. Product
> 9. Search
> 10. User
>
> Cars and adresses are new tables. Both of them are not present in the
> list. Any ideas what's wrong here?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: app_controller.php causing errors with my app

That did it. What was I thinking?!

Thank you

On Sep 30, 4:47 am, "dr. Hannibal Lecter" <lecter...@gmail.com> wrote:
> This may be a dumb suggestion, but try removing the "var $name =
> 'AppController';" line and see if that helps.
>
> It's not correct anyways, or at least seems incorrect to me.
>
> On Sep 29, 11:57 pm, Ryan <ryan.mckil...@gmail.com> wrote:
>
> > I am working on a new app and everything was playing nicely until I
> > added a simple app_controller.php in order to take advantage of the
> > Firecake helper:
>
> > <?php
> > class AppController extends Controller {
> >         var $name = 'AppController';
> >         var $helpers = array('Html', 'Form', 'Javascript', 'Firecake');}
>
> > ?>
>
> > Now I am getting errors:
>
> > Notice (8): Undefined property: ItemsController::$Item [APP/
> > controllers/items_controller.php, line 6]
>
> > Fatal error: Call to a member function find() on a non-object in /web/
> > php/balistik_list_app/app/controllers/items_controller.php on line 6
>
> > When I delete app_controller.php everything works again. Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: cake bake doesn't find new tables

You have to clean the cache.
Delete all files in tmp/cache/models.

Best Regards

Am 30.09.2008 um 14:54 schrieb Kenchu:

>
> I use cake bake to generate all my controllers, views and models.
> Unfortunatelyl cake bake doesn't seem to realize the changes I make in
> my database anymore. I've added a couple of more tables, but when I
> try to bake some new models, they aren't even in the list of models.
> Only the old tables are. I've checked the database configuration
> multiple times and cannot see anything that would suggest why cake is
> acting this way.
>
> database.php
>
> class DATABASE_CONFIG {
>
> var $default = array(
> 'driver' => 'mysql',
> 'persistent' => false,
> 'host' => 'localhost',
> 'login' => 'root',
> 'password' => '',
> 'database' => 'mydb',
> 'prefix' => '',
> );
> }
>
> If I do this in the command prompt:
>
> mysql .... (password and user details) ENTER
> use mydb; ENTER
> show tables; ENTER
>
> I get this:
>
> +-----------------+
> | Tables_in_mydb |
> +-----------------+
> | adresses |
> | bankaccounts |
> | banks |
> | cars |
> | categories |
> | comments |
> | countries |
> | orders |
> | orders_products |
> | products |
> | searches |
> | users |
> +-----------------+
> 12 rows in set (0.00 sec)
>
> Using cake bake I get these:
>
> Possible Models based on your current database:
> 1. Bankaccount
> 2. Bank
> 3. Category
> 4. Comment
> 5. Country
> 6. Order
> 7. OrdersProduct
> 8. Product
> 9. Search
> 10. User
>
> Cars and adresses are new tables. Both of them are not present in the
> list. Any ideas what's wrong here?
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

cake bake doesn't find new tables

I use cake bake to generate all my controllers, views and models.
Unfortunatelyl cake bake doesn't seem to realize the changes I make in
my database anymore. I've added a couple of more tables, but when I
try to bake some new models, they aren't even in the list of models.
Only the old tables are. I've checked the database configuration
multiple times and cannot see anything that would suggest why cake is
acting this way.

database.php

class DATABASE_CONFIG {

var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => 'mydb',
'prefix' => '',
);
}

If I do this in the command prompt:

mysql .... (password and user details) ENTER
use mydb; ENTER
show tables; ENTER

I get this:

+-----------------+
| Tables_in_mydb |
+-----------------+
| adresses |
| bankaccounts |
| banks |
| cars |
| categories |
| comments |
| countries |
| orders |
| orders_products |
| products |
| searches |
| users |
+-----------------+
12 rows in set (0.00 sec)

Using cake bake I get these:

Possible Models based on your current database:
1. Bankaccount
2. Bank
3. Category
4. Comment
5. Country
6. Order
7. OrdersProduct
8. Product
9. Search
10. User

Cars and adresses are new tables. Both of them are not present in the
list. Any ideas what's wrong here?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: validate alphanumeric

Still I get the same error message.

At /cake/libs/validation.php line 830
if (preg_match($_this->regex, $_this->check)) {

I have an array in $_this->check and this is what generates the error.

In my model I use the following validation rule:

var $validate = array(
'nev' => array('rule' => 'alphaNumeric')
);

By this in validation.php at line 830 I have array('nev' =>
'theGivenString') at this makes the problem, but I can not find out
how to solve it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

how can run my first program in cakephp



Hi All
i m new in cakephp.
i have installed all things regradinh cakephp....... and now i want to run my programs..
but not getting proper........
so anyone would you help me...
plz give me steps for first program..........

thanks a lot......

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: bigner for cake

I am also getting same error on this example I putted the file into
app/view/tasks/index.ctp

But it gives up can't load page error.

Secondly if i go through this way
http://localhost/CakeTooDoo/app/views/tasks/index.ctp

It only shows up the plain HTML form. After adding the add method in
controller its UI totally messes up. Please some one provide step by
step version to run this example for new bies.

with Regards
Anjum

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Umlauts and regular expressions

Hi,

I use 1.2.0.7296 RC2 and got problems to check user input via regular
expressions.

In my project, users are able to change their name. Works well, except
when entering umlauts. My regex always identifies umlauts as illegal
characters.

The $validate array for the field looks like this:

'displayname' => array(
'rule' => array('custom', '/^[\w\p{L}\40]*$/u'),
'message' => 'illegal_characters'
)

In the html header the meta tag
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
is there.

I have no further idea how to solve this.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

question about hasMany and length of form

I am in the process of learning relational database design by making a
scoring system for golf.

in the early stages of planning the database I know I will have a
general relationship as follows:

Tournament hasMany stablefords, pars, eagles etc..

now question is, when i'm making a new tournament it's unknown exactly
how many participants there will be for each type of competition but
it is known there will be at least 20, instead of having to manually
add each entry, how could I have it so I can dynamically add more rows
to the form? I was thinking of rigging up a button with javascript to
add more rows as needed in the view, before I get started, is there an
easier way I should be doing this?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Monday, September 29, 2008

Simple Ajax link to update div

Hi,
I have been struggling a bit to get a simple Ajax link working. I have
searched this group for help in older posts, but it seems like a key
tutorial (the grahambird one) is no longer available - perhaps because
it no longer works with 1.2.

If there is a tutorial somewhere that covers this, please let me know.
I think I have gone over all the available (through google) CakePHP
ajax tutorials, but unfortunately without success - some are outdated
(pre 1.2), others do not have full working code etc...

In any case, here is my code:
========================================
index.ctp
<h2>Ajax 3 - testing ajax link and button</h2>
<?php
$link_array1 = array('controller'=>'tests' ,
'action'=>'ajaxfcn1'); // the function to execute: function
ajaxfcn1 in controller tests

$link_array2 = array( 'update' => 'divout',
'complete' => 'alert( "Executed OK" )' ); // the div we want
to update

echo ($ajax->link('this an ajax link', $link_array1,
$link_array2,'Confirmation String'));

echo "<br/><br/>";

echo ($ajax->submit('this is an ajax button', $link_array1,
$link_array2,'Confirmation String'));
?>
<br/>
<div id="divout">
the div to update
</div>
========================================
tests_controller.php
<?php
class TestsController extends AppController {

var $name = 'Tests';
var $uses = array(); // prevent cake from looking for a database
model

function index() {

}

function ajaxfcn1() {
$this->render('index', 'ajax');
}
}
?>
========================================

So basically I have a view with an ajax link, an ajax button, and a
<div>. I would like to change the text in the div when I click the
link or button. At this point, nothing happens when I click them. I am
not sure if the ajaxfcn1() function is even executing at this point.
What's an easy statement to add in ajaxfcn1() to determine if the code
is executing? What function would I use to set the new div text from
within ajaxfcn1()?

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Fatal error: Class 'Dispatcher' not found - please help

Hi,

> CakePHP will not working on home.pl - there is not rewrite engine (if
> i good remember, they are working on it ;)), try ovh.pl - cheap with
> great polish support

Well, that was not my decision, I just had to install cake there since
the customer already owned server with all e-mail accounts there + a
ssl certificate was assigned to that server as well. If that would be
my call, I'd go for a VPS.

But as for the rewrite engine - yes, there is rewrite engine on home
(.htaccess syntax compatible), and after setting that include paths
cake is working.

Regards,
Piotr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---