Re: ACL for groups

2009-03-27 Thread djiize

For nested groups, you should read this post:
http://edwardawebb.com/programming/php-programming/cakephp/nested-trees-cakephp

In ACL, I (personnaly) think it's a good idea to have a ROOT group,
even if you don't use it now, maybe later ;)

If you don't want one, a NULL value should suffice.

On 27 mar, 05:16, brian  wrote:
> I need to have nested groups, so the table has a parent_id column.
> But, should top-level groups have a NULL parent_id? Or would there
> have to be a ROOT group, so to speak? I'm having a real hard time
> sorting all this out.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Links from an other controller in my view

2009-02-19 Thread djiize

$html->link('Add User', array('controller' => 'users', 'action' =>
'add'));

On 19 fév, 12:01, amarradi  wrote:
> Hello together,
>
> i have 2 Controller EntriesController and UsersController.
>
> And i have views for the Entries and views for the user.
>
> If i set an link like in an view from Entries i will get an link to
> add new Entry
>
> $html->('Add Entry', array('action'=>'add'));
>
> But what have i to do to get an link to Add new User into the Entry-
> View ? I tried
>
> $html->('Add User', array('action'=>'Users.add'));
>
> But is doesn't run
>
> Many greetings
>
> Marcus Radisch
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: The logged in username on view a Question about the AuthComponent

2009-02-19 Thread djiize

oh thanks AD7six, didn't think of that (shame on me)

On 19 fév, 11:39, AD7six  wrote:
> On Feb 19, 11:30 am, djiize  wrote:
>
> > in your beforeFilter of beforeRender :
> > $this->set($this->Auth->user());
>
> Why bother. It's in the session, just read from it.
>
> view code:
> debug ($session->read()); die; and look
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: The logged in username on view a Question about the AuthComponent

2009-02-19 Thread djiize

in your beforeFilter of beforeRender :
$this->set($this->Auth->user());

On 19 fév, 11:14, amarradi  wrote:
> Hello together,
>
> my Controller has the following action
> function beforeFilter() {
>         parent::beforeFilter();
>         $this->Auth->allow('index','search');
>     }
>
> if i click on the add Action e.q. i will be automatic redirect to the
> login screen. Thats ok.
>
> But how can i set the logged in username on the views? Thanks a lot
>
> many greetings
>
> Marcus Radisch
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File upload stopped working

2009-02-04 Thread djiize

Can you post the output of the FormHelper ? Here or better on the
Cakebin ?

I see 2 things:
- the names "ImportFile" with a caps in the middle => will often
produce "import_file" variable
- the form and the field have the same name "ImportFile" => conflict ?

On 4 fév, 12:30, Günther Theilen  wrote:
> I used the form helper and it doesn't change anything.
>
> My form looks like this:
>
> $form->create('ImportFile', array('action' => 'add', 'type' => 'file'));
>   $form->file('ImportFile'); ?>
> $form->end();
>
> Which should and did work.
>
> But now I get something like this in $_FILES:
> Array (
>    [data] => Array (
>      [name] => Array (
>        [ImportFile] => etc...
>
> which looks perfectly fine.
>
> But $this->data is empty.
>
> djiize wrote:
> > maybe see output of the Form Helper in general
> > I think it's
> > 
>
> > see "data[model][field]" here? you need to format your names this way
> > to automatically populate $this->data var
> > maybe just data[field] suffice, but I don't know as I always use
> > FormHelper, you can try yourself
>
> > On 4 fév, 08:05, Günther Theilen  wrote:
> >> Hi,
>
> >> I'm a little bit lost here, maybe someone can help.
> >> A file upload on one of my sites (Cake 1.2) "suddenly" stopped working.
> >> The method isn't used very often so I can't exactly say since when it
> >> doesn't work anymore but I know that my hoster has moved to a new data
> >> center and I suspect that something went wrong. But neither me nor my
> >> hoster's technical support have any clue what could have happened.
>
> >> The data send by the form just doesn't appear in $this->data anymore.
> >> If I do a debug($_POST) or debug ($_FILES) in my controller after
> >> sending the form I can see that the data is submitted but $this->data is
> >> empty.
>
> >> I usually use the form helper but I even tried to build the simplest
> >> possible form by myself:
>
> >>  >> action="/import_files/add">
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
>
> >> Same result. I get data in $_POST and in $_FILES but $this->data is
> >> completely empty.
>
> >> Any clues or hints where to look?
>
> >> Regards
> >> Guenther
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File upload stopped working

2009-02-04 Thread djiize

maybe see output of the Form Helper in general
I think it's


see "data[model][field]" here? you need to format your names this way
to automatically populate $this->data var
maybe just data[field] suffice, but I don't know as I always use
FormHelper, you can try yourself

On 4 fév, 08:05, Günther Theilen  wrote:
> Hi,
>
> I'm a little bit lost here, maybe someone can help.
> A file upload on one of my sites (Cake 1.2) "suddenly" stopped working.
> The method isn't used very often so I can't exactly say since when it
> doesn't work anymore but I know that my hoster has moved to a new data
> center and I suspect that something went wrong. But neither me nor my
> hoster's technical support have any clue what could have happened.
>
> The data send by the form just doesn't appear in $this->data anymore.
> If I do a debug($_POST) or debug ($_FILES) in my controller after
> sending the form I can see that the data is submitted but $this->data is
> empty.
>
> I usually use the form helper but I even tried to build the simplest
> possible form by myself:
>
>  action="/import_files/add">
> 
> 
> 
> 
> 
> 
>
> Same result. I get data in $_POST and in $_FILES but $this->data is
> completely empty.
>
> Any clues or hints where to look?
>
> Regards
> Guenther
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: can we generate 2D barcode with TCPDF..

2008-10-23 Thread djiize

it is really possible
you can also generate 2D barcode in PDF with TCPDF and Cake

On 23 oct, 11:49, Penfold <[EMAIL PROTECTED]> wrote:
> i think so
>
> On 23 Oct, 10:34, xelios <[EMAIL PROTECTED]> wrote:
>
> > Is it possible to generate 2D barcode with TCPDF..
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: file does not start with '%PDF-'

2008-10-23 Thread djiize

add "%PDF-" at the beginning of your PDF file

On 23 oct, 09:25, xelios <[EMAIL PROTECTED]> wrote:
> While using TCPDF with CakePHP,
>
> It generates an error "file does not start with '%PDF-'"
>
> What to do now!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: TCPDF is not generating pdf...

2008-10-23 Thread djiize

either your pdf is blank empty
or your pdf is not generated

On 23 oct, 12:00, xelios <[EMAIL PROTECTED]> wrote:
> "nope" itself is a big clue...
>
> On Oct 23, 2:49 pm, Penfold <[EMAIL PROTECTED]> wrote:
>
> > nope
>
> > On 23 Oct, 06:51, xelios <[EMAIL PROTECTED]> wrote:
>
> > > on visiting the page.. {http://localhost/cake12/CakePHP/books/viewPdf}
>
> > > It is displaying a blank page...
>
> > > any clue...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: problem with using TCPDF...

2008-10-23 Thread djiize

your cake app cannot find the class XTCPDF

On 23 oct, 07:03, xelios <[EMAIL PROTECTED]> wrote:
> I am using TCPDF for creating pdf. I have following problem:
>
> Fatal error: Class 'XTCPDF' not found in C:\xampp\htdocs\cake12\CakePHP
> \app\views\books\view_pdf.ctp on line 3..
>
> please help me!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Write view output to file - best MVC approach?

2008-10-22 Thread djiize

1st idea : test it, you'll see if your server crash
2nd idea : maybe there is a way to override View (like an AppView for
instance)
I don't know of it's possible, but if I were you, I'll check towards
this way

On 22 oct, 17:08, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi djiize,
>
> Thanks for the hint. But my problem with the size of my view would still 
> remain.
>
> I guess in the end the view will contain several thousands (litearally) of 
> lines in xml and would cause a crash of either php / server / or browser. So 
> what I would like to do is write chunks of data from the view output into a 
> file while it is generated and not after I have a big servercrashing datablob.
> Any idea?
>
> Background information: I program a product information system and in the end 
> all gathered data should go to an xml-export file for e.g. a WCMS, catalogue 
> or a distributor.
>
> Greetings Anja
>
> -Ursprüngliche Nachricht-
> Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von djiize
> Gesendet: Mittwoch, 22. Oktober 2008 16:55
> An: CakePHP
> Betreff: Re: Write view output to file - best MVC approach?
>
> in Controller code, a call to $this->render() returns the content of the view 
> HTH
>
> On 22 oct, 15:49, "Liebermann, Anja Carolin"
>
> <[EMAIL PROTECTED]> wrote:
> > Hi everybody,
>
> > I make good progress with my xml-export.
> > Since I expect the output to become very big, I would like to write
> > the resulting view rather to the harddisk to download later than show
> > it on the screen.
>
> > Now my questions:
> > In my controller I have an function which could write strings in a file.
> > But my strings are composed in my view!
>
> > What is the best approach to stay in the MVC world?
>
> > Call the write function form the view? Or transfer all foreach logic
> > to the controller? If I do the second what do I do with strings I have
> > put in elements?
>
> > If I want to avoid an overflow in my RAM do I have to flush something
> > in between?
>
> > Thank you for your opinion and any hints!
>
> > Anja
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Write view output to file - best MVC approach?

2008-10-22 Thread djiize

in Controller code, a call to $this->render() returns the content of
the view
HTH

On 22 oct, 15:49, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I make good progress with my xml-export.
> Since I expect the output to become very big, I would like to write the
> resulting view rather to the harddisk to download later than show it on
> the screen.
>
> Now my questions:
> In my controller I have an function which could write strings in a file.
> But my strings are composed in my view!
>
> What is the best approach to stay in the MVC world?
>
> Call the write function form the view? Or transfer all foreach logic to
> the controller? If I do the second what do I do with strings I have put
> in elements?
>
> If I want to avoid an overflow in my RAM do I have to flush something in
> between?
>
> Thank you for your opinion and any hints!
>
> Anja
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Best profiler for cake php?

2008-09-09 Thread djiize

Do you have a PHP accelerator (as Zend Optimizer) ?
Try do disabled it

On 9 sep, 10:42, RichardAtHome <[EMAIL PROTECTED]> wrote:
> I'd also like this info. XDebug crashes my apache (on windows) too :-(
>
> On Sep 9, 5:42 am, Dianne  van Dulken <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I was just wondering what profiler everyone else was using.  I'm
> > having trouble finding one that will work with my cakephp setup.
>
> > Xdebug causes my apache to crash, and I'm having similar issues with
> > some other ones.
>
> > My setup is
>
> > Cake version: 1.2.0.5427
> > Apache 2.2.4
> > PHP: 5.2.4
>
> > If anyone could tell me what they are using, I'd really appreciate it
>
> > Di
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: changing links according to selected language

2008-07-03 Thread djiize

Did your read the 2 links I sent you ?

On 3 juil, 18:52, K3 <[EMAIL PROTECTED]> wrote:
> Yes, i was asked to include language string so the search engine can
> better index the pages.
>
> @leo: we dont need high rating, just want both language versions t be
> indexed by the search engine. So we can not define such subdomains for
> each page.
>
> thats why the easiest way i can see so far is to ovveride htmlhelpers
> url and link methods. but looking forward for other sugestions.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: changing links according to selected language

2008-07-03 Thread djiize

In SEO point of view, it's better to have language in the URL : the 2
languages will be indexed with each its own URL
How search engines will deal with 1 URL with different content ?

For routes magic, see this article from Nate : 
http://c7y.phparch.com/c/entry/1/art,cake-seo
This one too: 
http://blog.jails.fr/cakephp/index.php?post/2008/05/29/Smart-url-for-i18n

On 3 juil, 17:07, "b logica" <[EMAIL PROTECTED]> wrote:
> IMO, you're better off not relying on the language being in the URL.
> Set it in the session when the user switches and check that.
>
> On Thu, Jul 3, 2008 at 10:04 AM, K3 <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > im using i18n and i can switch language wihtout problems. However, the
> > links in the URL bar remain the same, for example site.com/controller/
> > action. Is it possible to "patch" THTML helper somehow so i can
> > automatically change links to current_lang/controller/action,
> > for example when i write echo $html->url('/controller/action') to get
> > link to site.com/en/controller/action (if en is selected as current
> > language setting).
>
> > at the moment i have
> > Router::connect('en/:controller/:action/*', array('controller' =>
> > 'pages', 'action' => 'display', 'lang' => 'en'));
>
> > maybe i need to override htmlhelper's url and link methods. Any ideas
> > or suggestions?
>
> > thanks in advance
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strict or Pretty? We're looking for a few good opinions

2008-06-07 Thread djiize

I read somewhere that from PHP6, E_STRICT will be merged in E_ALL
If you drop PHP4 support, be ready for PHP6 support ;)

Personally, I usually follow core dev rules for Cake, and it's the
same thing for PHP. They have Strict mode, so I try to have strict
compliant code.

As Aranworld said, if each brick we use has "hacks" (not the real
word, but close to my thought), the wall won't be strong.

On 7 juin, 20:38, aranworld <[EMAIL PROTECTED]> wrote:
> Sometimes us programmers not on the CakePHP development team will
> think that we have an improvement to the core code, so we come up with
> our own solution (hack) to "improve" things.  But then inevitably the
> core code gets changed, and we suddenly find out that our hack is
> broken, or just didn't make sense in the context of the future
> direction of the Cake core.
>
> This is why I think it might be hazardous to not use strict.
> Presumably certain rules are in place, because the people who live and
> breath the PHP core code have a good idea about where things are going
> and they are trying to signal to us how to do things properly so that
> they match where they are going and don't break with future versions.
>
> On Jun 7, 10:26 am, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > The blank check metaphor is excellent. It can be a very slippery slope
> > when heading down the path of non-strict compliance. If we understand
> > the hazards and take precautions hopefully we can prevent sliding down
> > too far.
>
> > As far as what Nate is getting at, I think I understand him correctly
> > when I say that the need to move outside of strict mode comes with the
> > Models. Basically, if we do not comply with strict mode, we can call
> > models statically, with late bindings and without the need for a
> > separate Record class for handling data results as objects.
>
> > To put it in code, and based on some initial testing we should be able
> > to do:
> > $post = Post::create();
> > $post->title = "This is cool";
> > Post::save();
>
> > This violates strict mode because you are calling static methods on a
> > non static class.
> > Anyway, this is the best I can do to explain the scenario we have
> > encountered so far. Bottom line is..we do want the best framework. To
> > us, that means code that is cleaner and simpler. Sometimes the
> > benefits of such ease outweigh the costs of being completely
> > compliant. To be honest, I do not know 100% the inner workings of php.
> > My fear is that php could change and we would end up with unexpected
> > behavior. Also, while I do not support labels, being strict means
> > being "enterprise" ready. For the average developer this is not a
> > problem, but for larger companies looking to adopt Cake this is a
> > valid concern for the same reasons as the slippery slope.
>
> > There are more questions...How important is static access to models?
> > Should we just create instances as we do now? Would you prefer the
> > global access that a static class would provide?
>
> > Hope this helps the discussion. I look forward to more opinions on how
> > people see the use of CakePHP evolving.
>
> > Bake on.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Where to put new functions

2008-06-05 Thread djiize

easy way : in app/config/bootstrap.php
Cake way : create a custom Helper in app/views/helpers/

On 5 juin, 15:17, moment11 <[EMAIL PROTECTED]> wrote:
> I want a simple function that I can use in all my views:
>
>         function export_var($the_var) {
>                if (isset($the_var)) {
>                  return $the_var;
>                } else {
>                  return "";
>                }
>         }
>
> I'm not really sure where to put this in the cakephp code such that I
> can use it throughout all my views.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: RC1 breaks my auth.

2008-06-05 Thread djiize

add Cookie to your components list in the controller

leo a écrit :
> I haven't had time to pin this down further than
>
> If I use the cake directory from the 1.2 beta auth works but if I use
> the 1.2 rc1 it's broken.
>
> The cookie code came from the manual  @ 5.2.2.7
>
> The error is:
>
> Notice (8): Undefined property:  UsersController::$Cookie [APP
> \controllers\users_controller.php, line 44]
>
> Code
>
> if (empty($this->data))
>
> {
>
> $cookie = $this->Cookie->read('Auth.User');
>
> UsersController::login() - APP\controllers\users_controller.php, line
> 44
> Object::dispatchMethod() - CORE\cake\libs\object.php, line 114
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 261
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 233
> [main] - APP\webroot\index.php, line 84
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How can I get the name of the view that is being rendered in my layout?

2008-06-03 Thread djiize

you're right, that's why I said "by default" too ;)
but it's a good idea to insist on this feature like you did

On 3 juin, 13:08, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 3, 2008 at 4:25 PM, djiize <[EMAIL PROTECTED]> wrote:
>
> > $this->action is the name of the action, and by default, this is the
> > same as the view one
>
> By default yes but not always
>
> If I call $this->render() in my controller the view will be different
>
> T
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problems with cakePHP on serevre - pictures and css files not found

2008-06-03 Thread djiize

mod_rewrite activated?

On 3 juin, 13:46, Margarittka <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I carry out site to the server. Result - pictures are not reflected
> and css files do not seen. But om the local server all is ok. Hosting
> is masterhost. I place folder bakesale at the folder httpdocs. What
> must be change for solving this problem?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How can I get the name of the view that is being rendered in my layout?

2008-06-03 Thread djiize

$this->action is the name of the action, and by default, this is the
same as the view one

On 3 juin, 12:45, MarcS <[EMAIL PROTECTED]> wrote:
> thanks Tarique,
>
> I knew about being able to get the controller name. I was hoping there
> would be something similar for the view name
>
> On Jun 3, 11:30 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
>
> > On Tue, Jun 3, 2008 at 3:53 PM, MarcS <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > Is it possible to get the name of the view that is currently being
> > > rendered from inside the layout?
>
> > You can get the name of the controller and action - but thats it - name of
> > the view is not there at least by default
>
> > HTH
>
> > Tarique
>
> > --
> > =
> > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > PHP for E-Biz:http://sanisoft.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Result of a query gets messed up

2008-05-29 Thread djiize

and what if you define an alias to your column?
select users.id, users.name, my_custom_function(users.id, 'ABC') AS
custom, users.phone
from users
where users.id > 500;

or better : "AS users.custom"

and another question, do you need to specify "users.id" instead of
just "id" ? In your example, it will work

On 29 mai, 20:53, weckmann <[EMAIL PROTECTED]> wrote:
> That is a small workaround... because then i can get the value
> returned by the function by calling $result[0]
> ['my_custom_function(users'][id] ... and I also have all other values
> before.
>
> But that workaround does not work if you need to call more than one
> function. It only works if you call just "normal" columns and in the
> end one single speciality.
>
> And also, if you have a function with more than 2 parameters, things
> are getting much worse because then there is another "," in the string
> and Cake get really crazy about this ;-)
>
> So, I guess, I have to avoid using functions... or only use on in the
> end of the string? Or does anyone have a rabbit hidden in his had for
> me?
>
> On 29 Mai, 17:53, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > What happens if you put the function call last in your query?
>
> > On Thu, May 29, 2008 at 9:47 AM, weckmann <[EMAIL PROTECTED]> wrote:
>
> > > Then $result will hold the array which I showed in my last posting...
> > > which is quiet useless because users.phone is missing (or anything
> > > that comes after the function call).
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Different performance between 1.1 and 1.2

2008-05-29 Thread djiize

Don't do benchmark with debug on, it's useless.
Even if Cake 1.1 is faster than 1.2 with debug on, it won't tell you
if it's the same when debug is off !

On 29 mai, 17:31, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 28 Mag, 19:33, Joel Perras <[EMAIL PROTECTED]> wrote:
>
> > On May 28, 12:58 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > With debug=2 the queries are exaclty equal except for the DESCRIBE
> > > operation on the joinTable.
>
> > As I stated previously, when debug = 0 these queries are cached.
>
> > > Perhaps it'is a my feeling.
> > > Exist a instrument for evalute the time loading of a scripts?
>
> > A quick and dirty way of benchmarking page rendering time would be to
> > put a call to microtime() in app_controller.php in both the
> > beforeRender() and afterFilter() methods, and echo/log the time
> > difference between the two.
>
> I use this method and I test this case
>
> In cake 1.2 : a controller -action with one read operation ;
> controller uses one model.
>                   debug: 2
>
> In cake 1.1 : a controller -action with one read operation ;
> controller uses teen model.
>                    debug: 2
>
> Using microtime in app_controller.php  I get that:
>
> Cake1.2 is always over 100ms
>
> Cake 1.1 is always over 60ms
>
> The incredible thing is that from debug it seems that the controller-
> action in Cake 1.1 makes more queries (DESCRIBE query) because it has
> to load more models that cake 1.2
>
> > > Is it possible to use eAccelarator with Cake 1.2?
>
> > Cake actually uses Memcache (a PHP wrapper for memcached) for
> > caching.  Sadly there isn't anything in book.cakephp.org describing
> > this (yet), but a few well placed google queries and a quick search of
> > this group should give you an idea of how things work.  I've never
> > used eAccelerator, but I've heard of other people who have used it in
> > conjunction with Cake.
>
> > -Joel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Saving NOW() in model

2008-05-22 Thread djiize

yes you're right!
I care about that because we have 1 MySQL central server and several
servers that request it.
And we have not always full control of theses servers (apps can be
coded by others teams/companies).

On 22 mai, 14:16, Joel Perras <[EMAIL PROTECTED]> wrote:
> It doesn't really matter whether or not you obtain the date from
> Apache/PHP or MySQL; as long as you are consistent.
>
> On May 22, 4:01 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > I use the same way as Stephen
> > Because what if MySQL is hosted on another server than Apache/PHP ?
> > You'll save Apache/PHP time which can be different of MySQL time (no
> > the same meridian for instance).
> > Of course, it's a very specific case.
> > And my servers are time synchronised together, but some time
> > differences appeared once or twice a year.
>
> > On 22 mai, 07:47, Stephen Orr <[EMAIL PROTECTED]> wrote:
>
> > > I believe I used this method:
>
> > > 'last_login' => '!-NOW()'
>
> > > Which makes Cake stop trying to quote it. But I'm pretty sure the
> > > latest SVN revision recognises NOW() and doesn't quote it anyway.
> > > Maybe I'm confused.
>
> > > Steve
>
> > > On May 22, 2:12 am, Alex Ciobanu <[EMAIL PROTECTED]> wrote:
>
> > > > Zifnab wrote:
> > > > > I'm trying to figure out how to implicitly make a mysql NOW() call
> > > > > when doing a model save...here's an example of the code:
>
> > > > > $aUserData = array(
> > > > >     'User'  =>  array(
> > > > >         'id' => 4,
> > > > >         'last_login' => 'NOW()'
> > > > >     )
> > > > > );
>
> > > > > $this->User->save( $aUserData, false, array( 'last_login' ) );
>
> > > > > Naturally the save doesn't work, because NOW() saves as a string
> > > > > "NOW()" instead of as a mysql function NOW()How do I get it to
> > > > > save as a mysql function?
>
> > > > $aUserData['User']['last_login'] = date("Y-m-d H:i:s");
> > > > $this->User->save($aUserData);
>
> > > > Not using NOW(), but does the trick.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can any body help me please for tiny MCE editor issue

2008-05-22 Thread djiize

how do you load tiny_mce.js file?
do you use JavascriptHelper like that?
echo $javascript->link('tiny_mce');

I saw several questions from you these days, and many can be answered
by the use of core helpers
You should know that CakePHP manipulates URL (to make them pretty),
and that change the way to load files/images/css/...

On 22 mai, 13:52, vishal <[EMAIL PROTECTED]> wrote:
> Hi Friend,
>             I am facing a very difficult problem, if you have any
> suggestion for me then plz guide me what i will do ??
> actually I have placed a tiny MCE editor to add the page content for
> my cms. these pages shown
> on front end & handled by admin. ther are 5 -6 pages so I have stored
> it in the database.
>
> when i edit the page with Id the TinyMCE editor is not shown, while in
> case of add it works fine.
>
> when i click on edit link this link shown in 
> URL:http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit/6
>
> & the contents are shown in form of textarea not in the editor
>
> The main problem is the id...but it is mandatory for me.
>  while in case of this 
> URL,http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/cmts/edit
>
> it shows me the editor but not the content , what i will do 
>
> the code is below for edit :
> 
>     tinyMCE.init({
>         theme : "advanced",
>         mode : "textareas",
>
>         plugins :
> "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
>
>                 // Theme options
>                 theme_advanced_buttons1 :
> "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
>                 theme_advanced_buttons2 :
> "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
>                 theme_advanced_buttons3 :
> "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
>                 theme_advanced_buttons4 :
> "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
>                 theme_advanced_toolbar_location : "top",
>                 theme_advanced_toolbar_align : "left",
>                 theme_advanced_statusbar_location : "bottom",
>                 theme_advanced_resizing : true,
>         convert_urls : true
>     });
> 
>
> Edit Page
>
>   echo $form->create('Cmt', array('action' =>'edit'));
>
>  ?>
>
>   border="0">
>
> 
> 
> PageName: $form->input('name',array('label'=>'')); ?>
>
> 
> 
>
> 
> 
> Title: $form->input('title',array('label'=>'')); ?>
>
> 
> 
>
> 
> 
>  Content:
> input('content', array('rows' =>
> '15','cols'=>'35','label'=>'')); ?>
> 
> 
>
> 
>  Date:dateTime('dateadded',
>                 $dateFormat = 'DMY',
>                 $selected = null,
>                 $attributes = array(),
>                 $showEmpty = true
>         ) ; ?>
> 
> 
>
> 
> 
> 
> echo $form->end('Save Page');
> ?>
>
> :
>
> I am waiting for anybody replies
>
> thanks
> vishal
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Saving NOW() in model

2008-05-22 Thread djiize

I use the same way as Stephen
Because what if MySQL is hosted on another server than Apache/PHP ?
You'll save Apache/PHP time which can be different of MySQL time (no
the same meridian for instance).
Of course, it's a very specific case.
And my servers are time synchronised together, but some time
differences appeared once or twice a year.

On 22 mai, 07:47, Stephen Orr <[EMAIL PROTECTED]> wrote:
> I believe I used this method:
>
> 'last_login' => '!-NOW()'
>
> Which makes Cake stop trying to quote it. But I'm pretty sure the
> latest SVN revision recognises NOW() and doesn't quote it anyway.
> Maybe I'm confused.
>
> Steve
>
> On May 22, 2:12 am, Alex Ciobanu <[EMAIL PROTECTED]> wrote:
>
> > Zifnab wrote:
> > > I'm trying to figure out how to implicitly make a mysql NOW() call
> > > when doing a model save...here's an example of the code:
>
> > > $aUserData = array(
> > >     'User'  =>  array(
> > >         'id' => 4,
> > >         'last_login' => 'NOW()'
> > >     )
> > > );
>
> > > $this->User->save( $aUserData, false, array( 'last_login' ) );
>
> > > Naturally the save doesn't work, because NOW() saves as a string
> > > "NOW()" instead of as a mysql function NOW()How do I get it to
> > > save as a mysql function?
>
> > $aUserData['User']['last_login'] = date("Y-m-d H:i:s");
> > $this->User->save($aUserData);
>
> > Not using NOW(), but does the trick.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Layout change in edit case(help me please)

2008-05-20 Thread djiize

you're welcome

I'll try to answer your questions, but I've got some warns before:
- in your view, the action of your form is wrong
'action' => '/add/index'
should be
'action' => '/users/add/'
- you changed your flash call in 'edit' action, but not in others

And now, to upload your image:
Your form is correct, what's miss is business logic in your
controller's edit action.
Be sure to work with DEBUG set to 2 (in app/config/core.php)
Check the value of $this->data:
function edit($id = null) {
  if (!empty($this->data)) {
pr($this->data);
  }
}
you'll see an array like this one:
array['User'] = array(
  'name' => '...',
  'address' => '...',
  '...' => '..',
  'image' => array(
'name' => 'original_name.ext', // the name of the file in your
computer
'type' => 'mime/type', // MIME type : image/jpeg, image/gif, ...
'size' => '123', // size in bytes
'tmp_name' => '/tmp/321654', // where is your file being uploaded
'error' => 0, // error code, 0 if upload OK
  )
)

you must copy the temp file in your server
$save_dir = 'a path on you server'; // maybe 'files' for '/app/webroot/
files' folder
move_uploaded_file($this->data['User']['image']['tmp_name'],
$save_dir . $this->data['User']['image']['name']);

I hope this is clear enough. If not, try to search on Google 'PHP
upload', it's PHP basics.
And after, when you'll know well enough PHP & CakePHP, you could try
'Upload behavior' in this group

On 20 mai, 12:48, vishal <[EMAIL PROTECTED]> wrote:
> Thanks you very much my friend...!!! I have done the changes & my
> problem is solved..!!!
>
> thanks you very much..
>
> friend can you help me in this matter also if you have few minutes for
> me..??
>
> I have problem in uploading the image..I want to display the image as
> well as store the image in database...
> I mean to say these are my files:
>
> add.ctp:
> Add User
>
>   echo $form->create('User', array('action' => '/add/
> index','enctype'=>'multipart/form-data'));
> echo  $form->input('name');
> echo $form->input('address', array('rows' => '3'));
> echo $form->input('phone');
> echo $form->input('mobile');
> echo $form->input('email');
> echo $form->input('city');
> echo $form->input('state');
> echo $form->input('image',array('type' => 'file'));
> echo $form->end('Save User');
> ?>
>
> This is my controller file:
>
>  class UsersController extends AppController {
>
>         var $name = 'Users';
>         var $layout='user';
>
>         var $paginate = array(
>         'limit' => 4,
>         'order' => array(
>             'User.name' => 'asc'
>         )
>     );
>
>         function index() {
>                 //$this->set('users', $this->User->find('all'));
>                 $data = $this->paginate('User');
>           $this->set(compact('data'));
>         }
>
>         function view($id) {
>                 $this->User->id = $id;
>                 $this->set('user', $this->User->read());
>
>         }
>
>         function delete($id) {
>         $this->User->del($id);
> $this->flash('The user with id: '.$id.' has been deleted.', 'http://
> 192.168.0.60/vishal/cake_1.2.0.6311-beta/app/users/index');
>
> }
>
>         function add() {
>                 if (!empty($this->data)) {
>
>                                 $this->flash('Your detail has been 
> saved.','http://192.168.0.60/
> vishal/cake_1.2.0.6311-beta/app/users/index');
>                         }
>
>                 }
>
>         function edit($id = null) {
>         $this->User->id = $id;
>         if (empty($this->data)) {
>                 $this->data = $this->User->read();
>         } else {
>                 if ($this->User->save($this->data['User'])) {
>                         $this->flash('Your detail has been updated.', 
> array('action' =>
> 'index'));
>                 }
>         }
>
>

Re: Layout change in edit case(help me please)

2008-05-20 Thread djiize

it's due to Cake routing and URL rewriting
in some cases, prefer HTML helper instead your own HTML

in your layout, change

by
css('style') ?>

and change al

by
image('your_image.gif') ?>

And last, in your "flash" calls, don't repeat the host, path, etc...
just do:
$this->flash('Your detail has been updated.', '/users/index');
or better, as you already are in Users controller (and you'll get
others benefits, as reverse routing):
$this->flash('Your detail has been updated.', array('action' =>
'index'));

On 20 mai, 10:33, vishal <[EMAIL PROTECTED]> wrote:
> Hi,
>      Myself vishal facing a problem while editing.when i edit the
> layout changes. so anybody help me please..
> But in case of add it look well.
> This is the details of the file:
>
> Layout file:
>
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml";>
> 
> 
>  type="text/css" />
>
> 
> 
>
> 
>         
>                         
>                                 
>                                         
>                                                  align='right'>Home| Our Company| Sitemap|
> Projects
>                                         
>                                         
>                                                  align="center">
>                                                  align="center">
>                                                  SRC="../../app/webroot/img/logo.gif"  > td>
>                                         
>                                 
>
>                         
>         
>         
>                 
>                                  cellspacing="3" border="0"
> align="center">
>                                          $html->link('User', 'http://
> 192.168.0.60/vishal/cake_1.2.0.6311-beta/app/users/index'); ?> tr>
>                                          $html->link('Messages',
> 'http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/messages/
> index'); ?>
>                                          $html->link('Account',
> 'http://192.168.0.60/vishal/cake_1.2.0.6311-beta/app/messages/
> index'); ?>
>                                 
>                 
>                 
>                                 
>
>                 
>         
>         
>                         
>                                 contactus| About us| 
> privacy policy
>                         
>         
> 
> 
> 
>
> This is my controller page:
>
>  class UsersController extends AppController {
>
>         var $name = 'Users';
>         var $layout='user';
>
>         var $paginate = array(
>         'limit' => 4,
>         'order' => array(
>             'User.name' => 'asc'
>         )
>     );
>
>         function index() {
>                 //$this->set('users', $this->User->find('all'));
>                 $data = $this->paginate('User');
>           $this->set(compact('data'));
>         }
>
>         function delete($id) {
>         $this->User->del($id);
> $this->flash('The user with id: '.$id.' has been deleted.', 'http://
> 192.168.0.60/vishal/cake_1.2.0.6311-beta/app/users/index');
>
> }
>
>         function add() {
>                 if (!empty($this->data)) {
>                         if ($this->User->save($this->data)) {
>                                 $this->flash('Your detail has been 
> saved.','http://192.168.0.60/
> vishal/cake_1.2.0.6311-beta/app/users/index');
>                         }
>
>                 }
>         }
>
>         function edit($id = null) {
>         $this->User->id = $id;
>         if (empty($this->data)) {
>                 $this->data = $this->User->read();
>         } else {
>                 if ($this->User->save($this->data['User'])) {
>                         $this->flash('Your detail has been 
> updated.','http://192.168.0.60/
> vishal/cake_1.2.0.6311-beta/app/users/index');
>                 }
>         }
>
> }
> }
>
> ?>
>
> & this is my edit.ctp view file:
> Edit User
>
>  echo $form->create('User', array('action' => 'edit'));
> echo  $form->input('name');
> echo $form->input('address', array('rows' => '3'));
> echo $form->input('phone');
> echo $form->input('mobile');
> echo $form->input('email');
> echo $form->input('city');
> echo $form->input('state');
> echo $form->input('image',array('type' => 'file'));
> echo $form->end('Save User');
> ?>
>
> I am using the same layout in case of add & edit...but in case of edit
> it looks differentt without images that i use in layout file...so plz
> help me as soon as possible...
> I m waiting for the reply..!!!
>
> vishal
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: "save" oddity

2008-04-30 Thread djiize

try a pr($this->data) in your controller and you'll the date is not
"DB compliant" (it is split in several parts)
do a $this->cleanUpFields() before Model->save()

On 30 avr, 13:13, "annie.r.knight" <[EMAIL PROTECTED]>
wrote:
> I'm very new to CakePHP so please do bear with me.
>
> I've used the simple blog application from the manual as a crib for a
> small application that I'm creating. I ran into a problem when simply
> trying to deal with some date inputs in forms. The dates would insert
> ok, but if I tried to edit them I'd run into a brick wall: there was
> no update query being executed at all. If I changed the field type to
> text it was working ok.
>
> My controller's add() function looked like this:
>
> function add() {
>
> if (!empty($this->data)) {
> if ($this->Closeddate->save($this->data)) {
> $this->flash('The new details have been 
> saved.','/closeddates');
> }
> }
>
> }
>
> And the edit() function:
>
> function edit($id = null) {
>
> $this->Closeddate->id = $id;
>
> if (empty($this->data)) {
> $this->data = $this->Closeddate->read();
> }
> else {
>
> if 
> ($this->Closeddate->save($this->data['Closeddate'])) {
> $this->flash('Your Closed Date has 
> been updated.','/
> closeddates');
> }
> }
> }
>
> I fixed it by changing the parameter to the save() function to $this-
>
> >data (less the array index).
>
> So my question: Why does the broken method not work with dates? What
> did I do wrong? What am I misunderstanding?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Components, how many is too many?

2008-04-29 Thread djiize

You're right, it was a mistake to say ServicesController, etc...
I would say ServicesComponent, etc...

To load components in a component with $components member:
http://api.cakephp.org/1.2/class_component.html#1ffa81df593c314ae23143bb0834c8bc

To dynamically load components in a controller with
App::import('Component', 'YourComponent')
http://api.cakephp.org/1.2/class_app.html#2a84eb340fe947c7fdc753c3bf8cd053

On 29 avr, 14:49, mixersoft <[EMAIL PROTECTED]> wrote:
> I just tried to create components that inherit from a common component
> base class, and found that there were problems loading components --
> especially when those components also use other components. It wasn't
> that easy -- I'm not sure how you can load/declare components
> dynamically in the var $controller attributes since that is static to
> the class.
>
> if I'm doing it wrong, I'd love to have someone point out a better
> way. It there a reason why subclassing controllers works better than
> subclassing components?
>
> In my example above, my components are for importing photos from
> Flickr/Facebook/etc, one each. And it always seems that most of the
> code deals with either managing Sessions/Cookies/authentication keys
> at those third party sites, or other state related issues like setting
> variables for views, or testing for different form values before
> sending the data to the model.
>
> On Apr 27, 8:32 pm, djiize <[EMAIL PROTECTED]> wrote:
>
> > and that's where MVC and OOP are very useful
>
> > MVC because:
> > I'm pretty sure some parts of your components can be turned in Model/
> > Behavior/Datasource (gData, Flicker data access, ... are Model's
> > logic)
>
> > OOP because:
> > why your ServicesController loads all components when it only needs
> > some?
> > Maybe you should separate in several controllers that inherit
> > ServicesController (YahooServicesController,
> > GoogleServicesController, ...)
> > That way, each sub-ServicesController has its own $components list.
>
> > Dont' forget that in CakePHP, there's still PHP ;-)
>
> > On 27 avr, 10:31, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > > you have the option of importing them when you need and keeping generall
> > > required (heavily used comps in the controllers)
>
> > > *App::import*('*Component*'.$name)
>
> > > same goes for models etc
>
> > > at least thats as I understand.
>
> > > 2008/4/27 mixersoft <[EMAIL PROTECTED]>:
>
> > > > I am really wrestling with this one and wanted to know if others have
> > > > established a best practice.
>
> > > > My controllers are getting to be pretty big, and different actions may
> > > > need different components. Also, in the name of DRY, I have a
> > > > 'services'  controller that performs a lot of standard utility
> > > > functions -- which may need differnt components depending on who
> > > > called it. (i.e. Flickr component for Flickr stuff, Facebook component
> > > > for FB, Google component for Google, etc.)
>
> > > > It really seems like Cake wants me to include all compoments in the
> > > > controller var $compoments class attribute, so they can all be easily
> > > > referenced as a class variable.  But I'm looking at my 'services'
> > > > controller, and that could very well have a lot of very large
> > > > components.
>
> > > > I've tried to use App::import('Compoment', component) to load
> > > > components on the fly, but when I do so I can't seem to access any
> > > > components which those components need to use. (see post on Component
> > > > Polymorphism).
>
> > > > What do people do? Is the extra overhead so nominal that I should just
> > > > include everything plus the kitchen sink? Is Cake smart enough only to
> > > > actually load a component when it is actually required?  Has anyone
> > > > else figured out how to properly load components on the fly?
>
> > > > TIA.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Components, how many is too many?

2008-04-27 Thread djiize

and that's where MVC and OOP are very useful

MVC because:
I'm pretty sure some parts of your components can be turned in Model/
Behavior/Datasource (gData, Flicker data access, ... are Model's
logic)

OOP because:
why your ServicesController loads all components when it only needs
some?
Maybe you should separate in several controllers that inherit
ServicesController (YahooServicesController,
GoogleServicesController, ...)
That way, each sub-ServicesController has its own $components list.

Dont' forget that in CakePHP, there's still PHP ;-)

On 27 avr, 10:31, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> you have the option of importing them when you need and keeping generall
> required (heavily used comps in the controllers)
>
> *App::import*('*Component*'.$name)
>
> same goes for models etc
>
> at least thats as I understand.
>
> 2008/4/27 mixersoft <[EMAIL PROTECTED]>:
>
>
>
> > I am really wrestling with this one and wanted to know if others have
> > established a best practice.
>
> > My controllers are getting to be pretty big, and different actions may
> > need different components. Also, in the name of DRY, I have a
> > 'services'  controller that performs a lot of standard utility
> > functions -- which may need differnt components depending on who
> > called it. (i.e. Flickr component for Flickr stuff, Facebook component
> > for FB, Google component for Google, etc.)
>
> > It really seems like Cake wants me to include all compoments in the
> > controller var $compoments class attribute, so they can all be easily
> > referenced as a class variable.  But I'm looking at my 'services'
> > controller, and that could very well have a lot of very large
> > components.
>
> > I've tried to use App::import('Compoment', component) to load
> > components on the fly, but when I do so I can't seem to access any
> > components which those components need to use. (see post on Component
> > Polymorphism).
>
> > What do people do? Is the extra overhead so nominal that I should just
> > include everything plus the kitchen sink? Is Cake smart enough only to
> > actually load a component when it is actually required?  Has anyone
> > else figured out how to properly load components on the fly?
>
> > TIA.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Can I use AuthComponent without ACL and existing User Table

2008-04-24 Thread djiize

hi

1. you can use existaing tables, see userModel and fields Auth
variables
2. ACL not needed if you just do authentication. If you need
authorization too, you can use ACL or whatever else
3. Auth is a somewhat wrapper for authentication and authorization.
The last part can be done by ACL. But ACL has is own life, maybe you
should read more on cookbook and API.

Tip: there's lot of info there:
http://groups.google.com/group/cake-php/web/faq

On 24 avr, 13:44, bingo <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have been using OthAuth component for long for user authentication
> purpose. But now I am planning to switch to using AuthComponent mainly
> because it is part of core CakePHP library. I wanted to know,
>   1. can I use my existing user table with AuthComponent
>   2. Do I need to use ACL component or not.
>   3. I looked into several tutorials but there is no official tutorial
> explaining relationship between Auth and ACL. Did I miss looking
> somewhere?
>
> any help will be appreciated.
>
> Regards,
> Ritesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how can access the Auth info form view

2008-04-23 Thread djiize

when logged, you can pass user's data to the view
$this->set('loggedin_user', $this->Auth->user());

and in your view:
if (empty($loggedin_user)) {
  // not logged in
}
else {
  // logged in
}

On 23 avr, 08:14, candesprojects <[EMAIL PROTECTED]> wrote:
> And without $session->check('Auth.User.id'))  there is not helper or
> someting that let me use $Auth->isAuthentificate and to return true or
> false?
>
> If not I'm thinking to create a helper for this, that user $session
> and get me what I want.
>
> On Apr 22, 5:43 pm, francky06l <[EMAIL PROTECTED]> wrote:
>
> > in the view :
>
> > if($session->check('Auth.User.id'))
> >echo $html->link() ..
>
> > hth
>
> > On Apr 22, 4:00 pm, Sliv <[EMAIL PROTECTED]> wrote:
>
> > > You will probably want to do that in the controller action and set a
> > > variable for the view
>
> > >http://manual.cakephp.org/view/172/authentication
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: SSL enable for some site sections

2008-04-02 Thread djiize

you can setup a callback with:
$this->Security->blackHoleCallback = 'switch2secure';

and in your controller:
function switch2secure($param) { // param will be array('secure') in
your case
  // redirect to https
}

On 2 avr, 11:49, Kusok <[EMAIL PROTECTED]> wrote:
> I need to enable https for some site sections. I am using the
> SecurityComponent::requireSecure to define the actions I need to be
> secured. The question now is how to switch from http to https when
> that action is triggered.
> So I have a login controller and an index action, when that action is
> hit with http I want it to switch to https. How could this be done?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Adding meta description tags on a view page

2008-03-28 Thread djiize

in the head section of your layout, add this line:

it will be replaced by all $html->meta(), $meta->css() and $javascript-
>link() with inline to false

On 28 mar, 02:08, Rusty <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm not sure if I am doing something wrong, but I am trying to add a
> meta tag on the view page using the following command:
>
> echo $html->meta('description', 'meta description goes in here',
> array('type'=>'description'), false);
>
> Doing this, nothing shows up on the page. If I set the inline to true,
> it shows right at the top of the page, but after all the header
> information from the layout page.
>
> I would like to have it so that setting it to false puts it up in the
> head section (as per the API).
>
> Does anyone have any ideas, or is it me doing something wrong?
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: upload an image to a directory

2008-03-26 Thread djiize

search for Upload behavior in Group and Bakery

On 26 mar, 05:46, damo <[EMAIL PROTECTED]> wrote:
> I'm sure this is super easy also, but can't find how to do it in the
> cookbook for 1.2.
>
> So what I want to do is using the form helper upload a file (jpeg or
> jpg) and then save it to the directory /img/students/ and rename it to
> studentnumber.jpg (where student number is a field within the student
> record.
>
> It would also be handy to know how to delete this image from the edit
> view as well.
>
> I'm using the following to display images, it doesn't use any of the
> cakePHP goodness, so if there is some better way - I would love to
> hear it!
>
>  $image = $student['Student']['studentnumber'];
> echo ' echo '.jpg" width="300" border="0" alt="No student Image Available">';
> ?>
>
> Many thanks,
> Damo
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Application Design Issue

2008-03-10 Thread djiize

you can load a Model in a component
see App::import('Model', 'ModelName')

but it's not very MVC compliant, so if you can avoid that... ;)

Maybe you could do your business in AppController, or better in a
behavior (or many) ?

On 10 mar, 13:58, sleepy1038 <[EMAIL PROTECTED]> wrote:
> Could I use a component instead, since a lot of the logic that is
> being duplicated is business logic? If so, how do I use Model classes
> in a component? According to the manual, there is no guarantee that
> model instances will be created at the time my component attempts to
> use them.
>
> Thanks,
>
> Mike
>
> On Mar 10, 2:28 am, Adam Royle <[EMAIL PROTECTED]> wrote:> You have three 
> options:
>
> > - put generic code in app_model.php
> > - use model inheritance, eg. class MyModel extends MyBaseModel, class
> > MyBaseModel extends AppModel
> > - write a model behaviour (not unlike multiple inheritance)
>
> > Cheers,
> > Adam
>
> > On Mar 10, 4:04 pm, sleepy1038 <[EMAIL PROTECTED]> wrote:
>
> > > In my application, I will have the same problem if I put the bulk of
> > > the code in the models. I have as many models as I do controllers. How
> > > should I handle this?
>
> > > Thanks
>
> > > On Mar 9, 10:31 pm, mbavio <[EMAIL PROTECTED]> wrote:
>
> > > > The essential Fat Models, Skinny Controllers:
>
> > > > "Write big and long models, and short controllers"
>
> > > > DRY itself.
>
> > > > Cheers,
> > > > Martin B
>
> > > > On Mar 9, 4:52 pm, sleepy1038 <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello,
>
> > > > > I've recently implemented a content management system using Cake, and
> > > > > am running into a design issue. I have many different types of posts
> > > > > (articles, books, etc.). All these posts must be associated to tags. I
> > > > > implemented a general posts table, and associated the tags to this. I
> > > > > then implemented each type of post as belonging to a content post.
>
> > > > > The problem is, I now have many controllers. Each post type has its
> > > > > own controller, although aside from differing fields they pretty much
> > > > > have the same controller logic. The only thing that really differs in
> > > > > each controller code is the name of the controller instance. Whenever
> > > > > I need to make an update, I have to essentially copy and paste into 10
> > > > > different controllers.
>
> > > > > My questions is, how do I consolidate this logic into one location. I
> > > > > thought about using a component, put b/c Cake uses lazy loading I
> > > > > don't believe the model classes are available in a component. Am I
> > > > > wrong about this? Is there a way around this? Also, is there any way
> > > > > to consolidate the many views associated with the controllers? Any
> > > > > help would be greatly appreciated.
>
> > > > > Thank 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?hl=en
-~--~~~~--~~--~--~---



Re: MVC Architecture: model <--> controller <--> view

2008-03-03 Thread djiize

If Views directly ask Models to have Data:
1- what is Controllers' purpose?
2- how do you do business Logic with your data?

On 3 mar, 12:32, Marcel <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I've been doing some research about MVC implementations in different
> frameworks. Now in allmost every book I have on my desk it says
> something like 'the view in turn, asks the model for some data to
> display it'. In cake I have noticed (if I'm correct) the controller is
> asking data from the model and that data is then passed to the view.
>
> Example: $newsItem = $this->requestAction("/news/view",
> array("id"=>1));
>
> My question is why this kind of implementation? It seams to be a bit
> of double work because having that kind of intermediate 'layer'
> between model and view.
>
> Just curious ;-)
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: UUID as primary key

2008-02-13 Thread djiize

1.2 Manual beta
http://tempdocs.cakephp.org/#TOC62419
1.2 Cookbook
http://book.cakephp.org/view/70/primary-keys-used-as-uuids
1.2 API source
http://api.cakephp.org/1.2/libs_2model_2model_8php-source.html#l01213

On 12 fév, 23:41, Aaron  Shafovaloff <[EMAIL PROTECTED]> wrote:
> On this page (http://bakery.cakephp.org/articles/view/uuid-behavior) I
> saw the following:
>
> "Last cake 1.2 build support uuid for your primary key column. You
> just need have field ID with type varchar(36)"
>
> Does anyone have any more information on this?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug while using PHPmailer

2008-02-13 Thread djiize

if you want to use the core component, delete or move/rename your own
email.php component. It overrides the core's one

On 13 fév, 16:02, djiize <[EMAIL PROTECTED]> wrote:
> good start to Email core component:http://book.cakephp.org/view/176/email
>
> On 13 fév, 15:41, searchmax <[EMAIL PROTECTED]> wrote:
>
> > Hi djiize,
>
> > Thanks a ton i have resolved that bug. Actually there is a space after
> > the (?>) closing tag and after removing that my code is working fine..
> > Thankyou very much for your help:-)
>
> > djiize wrote:
>
> > > in your email.php component file, check if there's nothing after
> > > closing tag (?>)
> > > and FYI, there's an Email core component in Cake
>
> > > On 13 fév, 11:04, searchmax <[EMAIL PROTECTED]> wrote:
> > >> My code was working fine with sessions but when i added the
> > >> email(phpmailer),
> > >> I am getting the below error when i use email(phpmailer) component and
> > >> checking the session
>
> > >> If i comment var $components = array('Email');, everything works fine.
> > >> Pls
> > >> help me in this regard
>
> > >> CODE
>
> > >>  > >> class ProductsController extends AppController
> > >> {
>
> > >> var $helpers = array("html","Javascript");
>
> > >> var $components = array('Email');
>
> > >> function beforeFilter()
> > >> {
> > >> $this->checkSession();
> > >> }
> > >> //rest of the code
>
> > >> Error
> > >> Warning: Cannot modify header information - headers already sent by
> > >> (output
> > >> started at
> > >> C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116)
> > >> in
> > >> C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on
> > >> line
> > >> 447
>
> > >> --
> > >> View this message in
> > >> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html
> > >> Sent from the CakePHP mailing list archive at Nabble.com.
>
> > --
> > View this message in 
> > context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html
> > Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug while using PHPmailer

2008-02-13 Thread djiize

good start to Email core component:
http://book.cakephp.org/view/176/email

On 13 fév, 15:41, searchmax <[EMAIL PROTECTED]> wrote:
> Hi djiize,
>
> Thanks a ton i have resolved that bug. Actually there is a space after
> the (?>) closing tag and after removing that my code is working fine..
> Thankyou very much for your help:-)
>
>
>
> djiize wrote:
>
> > in your email.php component file, check if there's nothing after
> > closing tag (?>)
> > and FYI, there's an Email core component in Cake
>
> > On 13 fév, 11:04, searchmax <[EMAIL PROTECTED]> wrote:
> >> My code was working fine with sessions but when i added the
> >> email(phpmailer),
> >> I am getting the below error when i use email(phpmailer) component and
> >> checking the session
>
> >> If i comment var $components = array('Email');, everything works fine.
> >> Pls
> >> help me in this regard
>
> >> CODE
>
> >>  >> class ProductsController extends AppController
> >> {
>
> >> var $helpers = array("html","Javascript");
>
> >> var $components = array('Email');
>
> >> function beforeFilter()
> >> {
> >> $this->checkSession();
> >> }
> >> //rest of the code
>
> >> Error
> >> Warning: Cannot modify header information - headers already sent by
> >> (output
> >> started at
> >> C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116)
> >> in
> >> C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on
> >> line
> >> 447
>
> >> --
> >> View this message in
> >> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html
> >> Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> View this message in 
> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15459378.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Bug while using PHPmailer

2008-02-13 Thread djiize

in your email.php component file, check if there's nothing after
closing tag (?>)
and FYI, there's an Email core component in Cake

On 13 fév, 11:04, searchmax <[EMAIL PROTECTED]> wrote:
> My code was working fine with sessions but when i added the email(phpmailer),
> I am getting the below error when i use email(phpmailer) component and
> checking the session
>
> If i comment var $components = array('Email');, everything works fine. Pls
> help me in this regard
>
> CODE
>
>  class ProductsController extends AppController
> {
>
> var $helpers = array("html","Javascript");
>
> var $components = array('Email');
>
> function beforeFilter()
> {
> $this->checkSession();
> }
> //rest of the code
>
> Error
> Warning: Cannot modify header information - headers already sent by (output
> started at
> C:\apache2triad\htdocs\cakeapp\app\controllers\components\email.php:116) in
> C:\apache2triad\htdocs\cakeapp\cake\libs\controller\controller.php on line
> 447
>
> --
> View this message in 
> context:http://www.nabble.com/Bug-while-using-PHPmailer-tp15452984p15452984.html
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Yet another Auth and ACL question

2008-02-01 Thread djiize

it seems to be the correct behavior:
- if you're not logged in, it redirectts you to login page
- if you're logged, it checks if you're allowed to access to
controller:
  * if yes, ok
  * if not, it redirects you back and tell you "access denied"
Why do you want to be redirected to login since you're already logged
in?
It's up to you to add this: if I don't have access to a controller,
give the choice to be logged in with another account (like a Linux
sudo or Vista UAC). IMHO it's not a very common need.

On 1 fév, 07:09, chad <[EMAIL PROTECTED]> wrote:
> Braindead - I'm wondering the same thing.  Right now, as you said, it
> just redirects you to the current page. Perhaps an enhancement ticket
> at trac?
>
> On Jan 29, 12:51 pm, Braindead <[EMAIL PROTECTED]> wrote:
>
> > That's what I already did. When I'm not logged in and want to enter an
> > access controlled controller, I'm redirected to $loginAction.
> > But how is it possible to be redirected to $loginAction, when I'm
> > already logged in, but not allowed to access a 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?hl=en
-~--~~~~--~~--~--~---



Re: how to find referrer url?

2008-01-22 Thread djiize

1- Did you try to follow Daniel Hofstetter's answer ?
2- Did you try to search by yourself ?
http://api.cakephp.org/class_controller.html#e87c8e6edf53aadc511e3d050d71a494
Cake 1.1 API -> Controller::referer() function is here
http://groups.google.com/group/cake-php/search?group=cake-php&q=referer&qt_g=Rechercher+dans+ce+groupe
1st page -> 4 relevant results (dunno if it's 1.1, but there are a lot
of more pages and I bet there's some 1.1 relative)

Maybe I'm grumpy tonight, but even after the answer was given, you ask
the question on the same topic... I felt it's a little too much to
keep quiet...
Many people argue about poorness of Cake's doc, but many people too
argue about poorness of users' search capability

On 22 jan, 23:25, skoggins <[EMAIL PROTECTED]> wrote:
> Is there a solution for 1.1?
>
> On Jan 4, 5:03 am, krr <[EMAIL PROTECTED]> wrote:
>
> > That worked. Thanks a lot Daniel.
>
> > On Jan 4, 5:10 pm, Daniel Hofstetter <[EMAIL PROTECTED]> wrote:
>
> > > Hi krr,
>
> > > Controller::referer returns the referring url.
>
> > > HTH
>
> > > daniel
>
> > > --
> > > Daniel Hofstetterhttp://cakebaker.42dh.com
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: What do fields "foreign_key" in ACL do?

2008-01-22 Thread djiize

it's for bind a model as ARO
let's say Users are ARO, so you have 'User' in 'model' and id of user
in 'foreign_id'
you can have mutltiple ARO: User, Group, Role, Application, ...
go see in AclBehavior that automates this

On 22 jan, 10:29, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm currently working with ACL on creating some groups for users. I
> was wondering what are "foreign_key" and "model" fields for in AROS
> table !? I walked through API without success on this matter. My first
> thought is that "foreign_key" field can be used for referencing to
> e.g. "users" table...
>
> Do you have any ideas?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: cakephp 1.2 beta, How to add metalanguage support in my application?

2008-01-21 Thread djiize

http://groups.google.com/group/cake-php/web/frequent-discussions
Go to section "How to add i18n support?"

On 21 jan, 11:40, ali <[EMAIL PROTECTED]> wrote:
> Can any body tell me in detail, how I can add multi language support
> in application. I am newby to cakephp. Please help me in this regard,
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component encrypting password before validation.

2008-01-18 Thread djiize

http://bin.cakephp.org/view/266619336

Quick test of what I said, you just need to modify User->password
function to your needs.

On 18 jan, 12:45, MrTufty <[EMAIL PROTECTED]> wrote:
> What he said ;)
>
> I've been working with overriding hashPasswords to provide a randomly
> salted sha256 implementation, but my brains leaked out of my ears
> (that'll teach me to code at 3am).
>
> Steve
>
> On Jan 18, 11:30 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > You can already choose your hashing method, see in function
> > Auth::hashPasswords
> > If you define Auth->authenticate variable with the name of an object
> > of your own that definse the function hashPasswords, this function
> > will be called instead of the Auth default one
>
> > If you just want md5 or sha256 instead of sha1, you can define
> > Security->hashType (maybe in bootstrap)
>
> > Thanks to code devs to permits that 2 things ;)
>
> > On 18 jan, 11:47, phpjoy <[EMAIL PROTECTED]> wrote:
>
> > > nate, someone could want to use other hashing methods and not the
> > > default one.
> > > i vote for enabling :)
>
> > > and adding the last crypt component to cake :D
>
> > > On Jan 18, 6:18 am, nate <[EMAIL PROTECTED]> wrote:
>
> > > > No.  Disabling password hashing is Evil with a capital "E".  That's
> > > > why I don't let you do it.
>
> > > > On Jan 17, 11:03 am, dizz <[EMAIL PROTECTED]> wrote:
>
> > > > > Thanks to both of you, I thought of this, but I thought it would be
> > > > > easier to disable the AuthComponent::hashPasswords and then do what
> > > > > Baz did above.
>
> > > > > Anyways thanks again for the help.
>
> > > > > -Andrew
>
> > > > > On Jan 17, 10:45 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > > > > > Yep,
>
> > > > > > Use a different field, eg. new_password or something. (I'm assuming
> > > > > > you're validating when creating a password. No need for login)
>
> > > > > > Here's assuming you have a model called User:
>
> > > > > > // needed for validation for some reason
> > > > > > $this->User->set($this->data);
> > > > > > if ($this->validates($this->data))
> > > > > > {
> > > > > > $this->data['User']['passwd'] =
> > > > > > $this->Auth->password($this->data['User']['new_passwd'] )
>
> > > > > > // all we did was hash passwords, no need to revalidate.
> > > > > > if ($this->save($this->data, false))
> > > > > > {
> > > > > > //do stuff
> > > > > > } else
> > > > > > {
> > > > > > // invalid
> > > > > > }
>
> > > > > > }
>
> > > > > > Would be nice to stick this is beforeSave in the model, but you 
> > > > > > can't
> > > > > > [easily] access the Auth component from the model.
>
> > > > > > Hope this helps.
>
> > > > > > On Jan 17, 2008 9:31 AM, dizz <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hello,
>
> > > > > > > I am using the auth component and before my model can validate the
> > > > > > > password the auth component already encrypts the password so 
> > > > > > > making it
> > > > > > > impossible to use the between built in valid method.
>
> > > > > > > Is there any work around for this?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component encrypting password before validation.

2008-01-18 Thread djiize

You can already choose your hashing method, see in function
Auth::hashPasswords
If you define Auth->authenticate variable with the name of an object
of your own that definse the function hashPasswords, this function
will be called instead of the Auth default one

If you just want md5 or sha256 instead of sha1, you can define
Security->hashType (maybe in bootstrap)

Thanks to code devs to permits that 2 things ;)

On 18 jan, 11:47, phpjoy <[EMAIL PROTECTED]> wrote:
> nate, someone could want to use other hashing methods and not the
> default one.
> i vote for enabling :)
>
> and adding the last crypt component to cake :D
>
> On Jan 18, 6:18 am, nate <[EMAIL PROTECTED]> wrote:
>
> > No.  Disabling password hashing is Evil with a capital "E".  That's
> > why I don't let you do it.
>
> > On Jan 17, 11:03 am, dizz <[EMAIL PROTECTED]> wrote:
>
> > > Thanks to both of you, I thought of this, but I thought it would be
> > > easier to disable the AuthComponent::hashPasswords and then do what
> > > Baz did above.
>
> > > Anyways thanks again for the help.
>
> > > -Andrew
>
> > > On Jan 17, 10:45 pm, Baz <[EMAIL PROTECTED]> wrote:
>
> > > > Yep,
>
> > > > Use a different field, eg. new_password or something. (I'm assuming
> > > > you're validating when creating a password. No need for login)
>
> > > > Here's assuming you have a model called User:
>
> > > > // needed for validation for some reason
> > > > $this->User->set($this->data);
> > > > if ($this->validates($this->data))
> > > > {
> > > > $this->data['User']['passwd'] =
> > > > $this->Auth->password($this->data['User']['new_passwd'] )
>
> > > > // all we did was hash passwords, no need to revalidate.
> > > > if ($this->save($this->data, false))
> > > > {
> > > > //do stuff
> > > > } else
> > > > {
> > > > // invalid
> > > > }
>
> > > > }
>
> > > > Would be nice to stick this is beforeSave in the model, but you can't
> > > > [easily] access the Auth component from the model.
>
> > > > Hope this helps.
>
> > > > On Jan 17, 2008 9:31 AM, dizz <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello,
>
> > > > > I am using the auth component and before my model can validate the
> > > > > password the auth component already encrypts the password so making it
> > > > > impossible to use the between built in valid method.
>
> > > > > Is there any work around for this?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - Edit User blank password

2008-01-14 Thread djiize

Interesting too, didn't think about this way.
Maybe one workaround, you may have to hash the password yourself,
instead of Auth auto hash it

On 14 jan, 15:42, Baz <[EMAIL PROTECTED]> wrote:
> Oooohh, gotcha.
>
> Interesting. What I usually do is have another field like chng_pass...and if
> that is set, I'd set password = chgn_pass.
> --
> Kevin Lloyd
> 3HN Designshttp://www.3HNDesigns.com/
> (214) 473-4207
>
> On 1/14/08, djiize <[EMAIL PROTECTED]> wrote:
>
>
>
> > I use 2 ways, it depends of project, design, ... :
> > 1- 2 forms : 1 for passowrd change, and 1 for other fields. So the
> > $fieldList save are fixed
> > 2- 1 form to rule them all. I test if password is set, and set
> > $fieldList accordingly
>
> > On 14 jan, 15:07, Baz <[EMAIL PROTECTED]> wrote:
> > > I'm confused...
>
> > > So what if they do want to edit the password? Do you check $this->data
> > > before save and populate the fileds array in save() conditionally?
>
> > > I guess my real question is why not just don't put the password field on
> > the
> > > form.
>
> > > On Jan 14, 2008 7:04 AM, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > and better, use the security component, it will secure your forms very
> > > > well
> > > > but it's another topic
>
> > > > On 14 jan, 14:03, djiize <[EMAIL PROTECTED]> wrote:
> > > > > you're welcome
> > > > > in addition, it's always a good practice to specify which fileds to
> > > > > update in each Model->save() call
> > > > > it will prevent POST forgery
>
> > > > > On 14 jan, 12:37, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hey djiize , that worked great, thanks :)
>
> > > > > > Mike
>
> > > > > > On Jan 14, 11:39 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > > > > you can speciify which fields to update with the 3rd parameter
> > of
> > > > > > > Model->save():
> > > >http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd4.
> > ..
>
> > > > > > > On 14 jan, 11:03, Mike Digital Egg <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I am using the Auth component for 1.2 and it is all working
> > fine
> > > > > > > > except when I go to edit a user I want to have the option to
> > leave
> > > > the
> > > > > > > > password field blank and have itleave the password unchanged.
> > > > Whenever
> > > > > > > > I do this it rehashes the password using '' as the password. I
> > > > have
> > > > > > > > tried using unset( $this->data['User']['password'] ); so that
> > the
> > > > > > > > password field is not added to the query but it does not work.
> > Any
> > > > > > > > ideas how I would do this?
>
> > > > > > > > Thanks
>
> > > > > > > > Mike
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - Edit User blank password

2008-01-14 Thread djiize

I use 2 ways, it depends of project, design, ... :
1- 2 forms : 1 for passowrd change, and 1 for other fields. So the
$fieldList save are fixed
2- 1 form to rule them all. I test if password is set, and set
$fieldList accordingly

On 14 jan, 15:07, Baz <[EMAIL PROTECTED]> wrote:
> I'm confused...
>
> So what if they do want to edit the password? Do you check $this->data
> before save and populate the fileds array in save() conditionally?
>
> I guess my real question is why not just don't put the password field on the
> form.
>
> On Jan 14, 2008 7:04 AM, djiize <[EMAIL PROTECTED]> wrote:
>
>
>
> > and better, use the security component, it will secure your forms very
> > well
> > but it's another topic
>
> > On 14 jan, 14:03, djiize <[EMAIL PROTECTED]> wrote:
> > > you're welcome
> > > in addition, it's always a good practice to specify which fileds to
> > > update in each Model->save() call
> > > it will prevent POST forgery
>
> > > On 14 jan, 12:37, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > > > Hey djiize , that worked great, thanks :)
>
> > > > Mike
>
> > > > On Jan 14, 11:39 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > > you can speciify which fields to update with the 3rd parameter of
> > > > > Model->save():
> >http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd4...
>
> > > > > On 14 jan, 11:03, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I am using the Auth component for 1.2 and it is all working fine
> > > > > > except when I go to edit a user I want to have the option to leave
> > the
> > > > > > password field blank and have itleave the password unchanged.
> > Whenever
> > > > > > I do this it rehashes the password using '' as the password. I
> > have
> > > > > > tried using unset( $this->data['User']['password'] ); so that the
> > > > > > password field is not added to the query but it does not work. Any
> > > > > > ideas how I would do this?
>
> > > > > > Thanks
>
> > > > > > Mike
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: sessions being dropped on redirect or whenever i call a new page

2008-01-14 Thread djiize

there was a ticket about session regenerated for img in the page
I didn't remind if it was fixed before or after the beta
maybe you should try with a newer SVN code
but as precedent advice said, check before if there's undescore in
your localhost or subdomain.

On 14 jan, 12:43, wirtsi <[EMAIL PROTECTED]> wrote:
> Are you using IE? It silently drops the session if the hostname
> contains an underscore  took me ages to find out why
> project_beta.domain.com wouldn't work ...
>
> wirtsi
>
> On 13 Jan., 15:50, Grainne <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Hope you are all having enjoyable weekends... I'm certain I'm missing
> > something obvious - but I have spent days trying to figure out what -
> > so I thought I'd ask.
>
> > My sessions are being dropped when or if I just go to a new page.
>
> > I am using beta 1.2
> > I checked for whitespace outside of my models and controllers.
> > My security is set to low.
> > I have tried using cake,php, and database.
> > I looked for session start in my vendor files - or really anywhere.
> > I have tried it with debug set to 0-3.
>
> > Thank you so much, in advance.  I really apprecate it!
>
> > - Grainne
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - Edit User blank password

2008-01-14 Thread djiize

and better, use the security component, it will secure your forms very
well
but it's another topic

On 14 jan, 14:03, djiize <[EMAIL PROTECTED]> wrote:
> you're welcome
> in addition, it's always a good practice to specify which fileds to
> update in each Model->save() call
> it will prevent POST forgery
>
> On 14 jan, 12:37, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > Hey djiize , that worked great, thanks :)
>
> > Mike
>
> > On Jan 14, 11:39 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > > you can speciify which fields to update with the 3rd parameter of
> > > Model->save():http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd4...
>
> > > On 14 jan, 11:03, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I am using the Auth component for 1.2 and it is all working fine
> > > > except when I go to edit a user I want to have the option to leave the
> > > > password field blank and have itleave the password unchanged. Whenever
> > > > I do this it rehashes the password using '' as the password. I have
> > > > tried using unset( $this->data['User']['password'] ); so that the
> > > > password field is not added to the query but it does not work. Any
> > > > ideas how I would do this?
>
> > > > Thanks
>
> > > > Mike
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - Edit User blank password

2008-01-14 Thread djiize

you're welcome
in addition, it's always a good practice to specify which fileds to
update in each Model->save() call
it will prevent POST forgery

On 14 jan, 12:37, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
> Hey djiize , that worked great, thanks :)
>
> Mike
>
> On Jan 14, 11:39 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > you can speciify which fields to update with the 3rd parameter of
> > Model->save():http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd4...
>
> > On 14 jan, 11:03, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I am using the Auth component for 1.2 and it is all working fine
> > > except when I go to edit a user I want to have the option to leave the
> > > password field blank and have itleave the password unchanged. Whenever
> > > I do this it rehashes the password using '' as the password. I have
> > > tried using unset( $this->data['User']['password'] ); so that the
> > > password field is not added to the query but it does not work. Any
> > > ideas how I would do this?
>
> > > Thanks
>
> > > Mike
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth Component - Edit User blank password

2008-01-14 Thread djiize

you can speciify which fields to update with the 3rd parameter of
Model->save():
http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd428f5c81

On 14 jan, 11:03, Mike Digital Egg <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using the Auth component for 1.2 and it is all working fine
> except when I go to edit a user I want to have the option to leave the
> password field blank and have itleave the password unchanged. Whenever
> I do this it rehashes the password using '' as the password. I have
> tried using unset( $this->data['User']['password'] ); so that the
> password field is not added to the query but it does not work. Any
> ideas how I would do this?
>
> Thanks
>
> Mike
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Requesting picture in webroot but controller requested

2007-12-21 Thread djiize

are your .htaccess files OK?
and Apache mod_rewrite activated?

On 21 déc, 13:40, stefuNz <[EMAIL PROTECTED]> wrote:
> hm no ... using the img folder doesn't work, too ...
> in the pre-beta i began with it worked ...
> Error:  ImgController could not be found. is the error message
>
> cheers...
>
> On 21 Dez., 12:48, djiize <[EMAIL PROTECTED]> wrote:
>
> > maybe because images folder is "img"
> > try using $html->image helper function in your views
>
> > On 21 déc, 12:35, stefuNz <[EMAIL PROTECTED]> wrote:
>
> > > Hi..
>
> > > I really don't get it ! I'm using CakePHP 1.2, nightly build from 18.
> > > dec
>
> > > when i request /cake/images/picture.png, cake is looking for
> > > ImagesController !
> > > thats very confusing! how can i make cake display the picture?
>
> > > cheers,
> > > stefan
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Requesting picture in webroot but controller requested

2007-12-21 Thread djiize

maybe because images folder is "img"
try using $html->image helper function in your views

On 21 déc, 12:35, stefuNz <[EMAIL PROTECTED]> wrote:
> Hi..
>
> I really don't get it ! I'm using CakePHP 1.2, nightly build from 18.
> dec
>
> when i request /cake/images/picture.png, cake is looking for
> ImagesController !
> thats very confusing! how can i make cake display the picture?
>
> cheers,
> stefan
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: image link dorks up my session

2007-12-19 Thread djiize

some days ago:
http://groups.google.com/group/cake-php/browse_thread/thread/6a48d8467e5b505b/89a0434b7447829e?lnk=gst&q=session#89a0434b7447829e

(look at Grant Cox's message)

On 19 déc, 20:23, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> "What was the answer you were looking for?"
> I am looking for something helpful and you've responded both times
> with a whole bunch of nothing, you've spent a lot of time writing when
> you should have said to yourself "I don't really know anything that
> can help so I'll leave this post to someone that does."
>
> I'll state again that I realize that it is the code and I'm looking
> for something constructive that can help me narrow down what the
> problem with.
>
> The img and href tags are properly formed and work fine when they
> point to a static url, however, whenever I include
> data passed from the controller in them, it will cause the 
> $this->Session->check('User') to fail in the controller. The page renders
>
> correctly, the tags are formed correctly and work, they just cause the
> session check to fail.
>
> Also, I can include any variables that are defined in the view withing
> the tags without any problems, just when I use data from the
> controller in an href tag or src tag do I have this problem.
>
> The data from the controller works fine everywhere else and will not
> cause the session check to fail. If anyone has any concise ideas about
> what I can do to help fix this problem PLEASE help. I am not looking
> for "the code's broke" I already know this and that's why I came here
> in the first place.
>
> On Dec 19, 11:22 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Dec 19, 2007 1:06 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > href tag in the view. I appreciate the reply, but saying "it's the
> > > code" is not very productive, of course something is wrong with the
> > > code, I'm just trying to see if anyone has any ideas about what it
> > > could be (ie if anyone has seen this before, how did they fix it).
>
> > Why is it when someone is told that the non-core code they are using
> > or have written isn't working properly, they get all defensive and
> > complain that being told that fact is 'not very productive'?  I know
> > this will come as a shock to many people, but I have written both good
> > code and shitty code.  Most of the time when a problem with a CakePHP
> > app occurs, it's because of the shitty non-core code that someone has
> > written.
>
> > What was the answer you were looking for?  "Yes, it must be CakePHP's
> > fault that some part of the non-core code is messing with the contents
> > of a session".
>
> > I will restate what I said before:  there is nothing about adding
> > properly-formed href tags or properly formed img-src tags to a page
> > that will cause sessions to not work properly.  Therefore, it must be
> > a problem in the code.  I will gladly change my mind when presented
> > with evidence to the contrary.
>
> > Just because you don't like the answer doesn't mean that it isn't
> > helpful or isn't valid.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @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?hl=en
-~--~~~~--~~--~--~---



Re: define layout for error404.thtml

2007-12-11 Thread djiize

did you try:
layout = 'error'; ?>
in your error404.thtml ?

On 11 déc, 15:37, grigri <[EMAIL PROTECTED]> wrote:
> how about
>
> class AppController extends Controller {
>   function beforeRender() {
> if ($this->viewPath == 'errors') {
>   $this->layout = 'error';
> }
>   }
>
> }
>
> On Dec 11, 2:25 pm, BoSc <[EMAIL PROTECTED]> wrote:
>
> > I found that changing the layout in error.php (errorHandler class)
> > does seem to work. This doens't seem like good-practice though...
>
> > Any simpler solutions?
>
> > On 11 dec, 11:40, BoSc <[EMAIL PROTECTED]> wrote:
>
> > > When calling a 404 error with:
>
> > > $this->cakeError('error404',array(array('url'=>'/')));
>
> > > How do I set the layout for the error404.thtml. It tends to use the
> > > default.thtml layout, but I would like to change this!
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-10 Thread djiize

default page (see routes.php) is /app/views/home.ctp
you can cusomize this page like you want, and import data from DB in
it with elements/requestAction:
http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction

On 10 déc, 17:17, "Mike Green" <[EMAIL PROTECTED]> wrote:
> A view without a controller.. is just a php page. you could achieve
> the same effect by other means but it would be pointless.
>
> On 10/12/2007, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Dec 10, 2007 10:34 AM, boris <[EMAIL PROTECTED]> wrote:
>
> > > Is this possible in CakePHP or am I constrained to associate every
> > > view with a database table, model, and controller?
>
> > Well, you can certainly create models that don't use databases, and
> > controllers that don't need a model, but given the very nature of MVC
> > I think you could not create a view without a controller...
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @TheKeyboard -http://www.littlehart.net/atthekeyboard
>
> --
> 
> Mike Green
>
> Find yourself some misspelled ebay bargains!http://www.typingwand.com
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Anyone up for a 1.2 query construction challenge?

2007-12-07 Thread djiize

there is an argument for generateList that group your result by state:
$places_list= $this->Hobby->Place->generateList(null, 'name ASC',
null, null, null, '{n}.Place.state');

and with a little post-processing, you'll have counts:
foreach ($places_list as $state => $places) {
  foreach ($places as $place_id => $place) {
$count = $this->Hobby->Person->findCount(array('place_id' =>
$place_id));
$places_list[$state][$place_id] = $places_list[$state]
[$place_id] . ' (' . $count . ')';
  }
}
$this->set('places', $places_list);

and in you view:
input('Place.id', array('options' => $places,
'empty' => 'Choose a place')) ?>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Big problems with admin routing and Auth/ACL

2007-11-28 Thread djiize

point 2.
unknown action admin_img is maybe due to wrong image paths in your
views, do you use Html helper?

On Nov 27, 10:42 pm, Dodger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> 1. Whenever I open an admin URL, such as /admin/videos, I get the following
> warning:
>
> 2007-11-27 23:28:18 Warning: Warning (2):
> fopen(C:\...\tmp\cache\persistent\cake_core_object_map) 
> [http://php.net/function.fopenfunction.fopen ]: failed to open stream:
> Permission denied in [CORE\cake\libs\file.php, line 144]
>
> This doesn't appear to happen with non-admin routes.
>
> 2. When accessing my add URL, /admin/videos/add, it seems
> Auth::isAuthorised() is being called 3 times, twice with an unknown action
> (admin_img):
>
> 2007-11-27 23:34:07 Debug: Group ID: 4
> 2007-11-27 23:34:07 Debug: ACO alias: Videos/admin_add
> 2007-11-27 23:34:10 Debug: Group ID: 4
> 2007-11-27 23:34:10 Debug: ACO alias: Videos/admin_img
> 2007-11-27 23:34:10 Debug: Group ID: 4
> 2007-11-27 23:34:10 Debug: ACO alias: Videos/admin_img
>
> (Group ID = the ARO)
>
> 3. (far less important) Am I supposed to be able to access
> $this->params['controller'] in beforeFilter() for an admin route? Seems to
> work for other routes, but with admin routes it can't find the 'controller'
> array index. Perhaps related to #2 above.
>
> Please help.
>
> Glen.
> --
> View this message in 
> context:http://www.nabble.com/Big-problems-with-admin-routing-and-Auth-ACL-tf...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Clear definitions for M V C? (newbie)

2007-11-26 Thread djiize

Controller: business logic
Model: data logic
View: presentation logic
http://en.wikipedia.org/wiki/Model-view-controller
http://manual.cakephp.org/chapter/basic_concepts

On Nov 26, 1:11 pm, powtac <[EMAIL PROTECTED]> wrote:
> Hi, Im trying to move an existing project into cakephp (and also into
> a MVC-modell).
> What questions can I use to find out if
> -an existing part of code
> -an existing functionality
> -an existing database table
> is a model or a controller or only a view...
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: prefixes on cake identifiers to avoid naming collisions

2007-11-14 Thread djiize

PHP functions are not prefixed too, then you need to know their names
to not use the same.
I think Cake is the same, it has its keywords list, it's your job to
know them.

Waiting for namespaces support in PHP (6?)

keymaster wrote:
> Anyone know if there is a particular reason cake does not use
> identifier prefixes to distinguish cake identifiers from application
> defined identifiers ?
>
> I noticed zend does this, at least for their class names. Haven't used
> zend in any detail so I don't know how deep their naming conventions
> go.
>
> Perhaps we are expected to know all the cake model and controller
> class variable names (to know not to use 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?hl=en
-~--~~~~--~~--~--~---



Re: Auth/ACL problem: "You are not authorized to access that location."

2007-11-13 Thread djiize

Thanks Ralph, but I knew that for CakePHP.
I asked Jeff about its Acl plugin...
Seb.

On 13 nov, 17:58, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On the project page (http://cakeforge.org/projects/cakephp/) you can
> click the little letter icon to Monitor that project.  It'll email you
> when a new package is released.  Watch your spam folder, I find my
> alerts sometimes end up in there.
>
> Ralph
>
> On Nov 13, 4:58 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > Hi again
> > I update my Cake install with the last SVN branch, and now it works
> > like a charm.
> > Thanks again for your work
> > Is there any way to be warned when a new version is available?
> > Seb.
>
> > On Nov 13, 11:28 am, djiize <[EMAIL PROTECTED]> wrote:
>
> > > Hi jeff
> > > thanks for this plugin, it looks great on the demo
> > > but when I installed it in my app, it says
> > >   Missing controller
> > >   You are seeing this error because controller PagesController could
> > > not be found.
> > > It seems I should add some routes to redirect /admin/acl/aros to /
> > > plugins/acl/views/acl/admin_aros.ctp
> > > Another guy has the same problem (see comment on your Bakery article)
> > > Have you any clue to solve this please?
> > > Seb.
>
> > > On Nov 12, 7:39 pm, Jeff Loiselle aka phishy <[EMAIL PROTECTED]>
> > > wrote:> Hey guys,
>
> > > > I've been working on an ACL plugin if you're 
> > > > interested.http://bakery.cakephp.org/articles/view/acl-management-plugin
>
> > > > Regards,
> > > > jeff


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth/ACL problem: "You are not authorized to access that location."

2007-11-13 Thread djiize

Hi again
I update my Cake install with the last SVN branch, and now it works
like a charm.
Thanks again for your work
Is there any way to be warned when a new version is available?
Seb.

On Nov 13, 11:28 am, djiize <[EMAIL PROTECTED]> wrote:
> Hi jeff
> thanks for this plugin, it looks great on the demo
> but when I installed it in my app, it says
>   Missing controller
>   You are seeing this error because controller PagesController could
> not be found.
> It seems I should add some routes to redirect /admin/acl/aros to /
> plugins/acl/views/acl/admin_aros.ctp
> Another guy has the same problem (see comment on your Bakery article)
> Have you any clue to solve this please?
> Seb.
>
> On Nov 12, 7:39 pm, Jeff Loiselle aka phishy <[EMAIL PROTECTED]>
> wrote:> Hey guys,
>
> > I've been working on an ACL plugin if you're 
> > interested.http://bakery.cakephp.org/articles/view/acl-management-plugin
>
> > Regards,
> > jeff


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Auth/ACL problem: "You are not authorized to access that location."

2007-11-13 Thread djiize

Hi jeff
thanks for this plugin, it looks great on the demo
but when I installed it in my app, it says
  Missing controller
  You are seeing this error because controller PagesController could
not be found.
It seems I should add some routes to redirect /admin/acl/aros to /
plugins/acl/views/acl/admin_aros.ctp
Another guy has the same problem (see comment on your Bakery article)
Have you any clue to solve this please?
Seb.

On Nov 12, 7:39 pm, Jeff Loiselle aka phishy <[EMAIL PROTECTED]>
wrote:
> Hey guys,
>
> I've been working on an ACL plugin if you're 
> interested.http://bakery.cakephp.org/articles/view/acl-management-plugin
>
> Regards,
> jeff


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Transform column names

2007-11-12 Thread djiize

I think the best way for you is to create a TransformField behavior,
and override afterFind (to populate 'title' in array) and beforeSave
(to change 'title' to 'FP002EX' in UPDATE) in it.
If it's just for one table, directly override them in your model.
Maybe you'll need to override other callbacks too, check API:
http://api.cakephp.org/1.2/class_model_behavior.html

On Nov 12, 8:22 am, mmalca <[EMAIL PROTECTED]> wrote:
> Iam looking for a way to transform column names (behaviour perhaps?).
> I have an existing database with very confusing column names (like
> FP002EX - remember Fortran) and would like to display/use/edit them in
> cakephp via friendlier name: eg FP002EX -> title
>
> Something like:
>
> class MyModel extends AppModel {
> var $actsAs = array('transnames');
> var $transNames = array('FP002EX'=>'title',...);
>
> }
>
> controller usage:
> $this->data['MyModel']['title'] = 'New title'; // would set FP002EX
> $this->save($this->data);
>
> Is there an existing solution to my problem? Can someone point me to
> the best way for implementing this behaviour?
> Tnx


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: cakePHP and ecommerce security reisks

2007-10-12 Thread djiize

One best practice, specify which fields are to be saved:
http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd428f5c81
The third argument of the Model->save() is an array "List of fields to
allow to be written"
and in your CREATE TABLE, add "DEFAULT 0" to "active" field.

On 12 oct, 14:39, grigri <[EMAIL PROTECTED]> wrote:
> Well, sure - $this->User->save() will save any correct data in the
> array. But the user doesn't have access to model functions, only
> controller functions (actions). And in your controller action you
> should always, always, always validate the data being transmitted.
> This isn't cakephp-specific, it's a general rule of web development.
> Always assume that every form submission is a cracker trying to do
> something they shouldn't.
>
> Just doing something like this would be sufficient:
>
> class UsersController extends AppController {
>   // ...
>   function edit($id = null) {
> if (!empty($this->data)) {
>   unset($this->data['User']['active']);
>   // carry on as normal here
> }
>   }
>   // ...
>
> }
>
> Although logging and trapping could be useful too.
>
> I believe the 1.2 Security Component has some way of designating form
> fields as restricted, as well as ensuring only fields that were
> generated with formhelper are accepted. Not 100% sure how that works
> though. But to be fair, it's hardly rocket science to do it yourself.
>
> On Oct 12, 9:28 am, Sharkoon <[EMAIL PROTECTED]> wrote:
>
> > Well he's got a point.
>
> > When I have this:
> > $form->input('User.email');
> > $form->input('User.password');
>
> > and put via firebug  > value="1">
>
> > and then $this->User->save($this->data);
> > It saves active as well!!!
>
> > A huge security risk!!


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Badword Bahavior

2007-10-08 Thread djiize

to access another Model from a controller, add this:
var $uses = array('Guestbook', 'Badword');  // all models you need
that aren't associated with an loaded one

and now $this->Badword->find*() magic happens!

On 8 oct, 18:46, Zoltan <[EMAIL PROTECTED]> wrote:
> That's the way I would do it too :(
> I guess there are to solutions - you could make BadWords a component
> instead of a behavior and use multiple models that way, the other
> would be to store your bad-words in an array, rather than calling them
> from the database. You could even move it into the config file for
> easier editing.
>
> Zoltanwww.yyztech.ca
>
> On Oct 8, 12:28 pm, Braindead <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to write a badword behavior for my guestbook, where a
> > guestbook entry has to be verified when one or more badwords are
> > detected inside the guestbook entry. My badwords are stored in a
> > database. The problem is how to query the badwords, when the current
> > model is the guestbook?
>
> > Is the only possibility something like
>
> > $badwords = $model->query('SELECT `entry` FROM `badwords` ORDER BY
> > `entry`');
>
> > or is there a more "cake-like" way?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Uploading Large Files

2007-10-05 Thread djiize

some folks on this group had fun with SWFUpload, try to search it in
the group

On 5 oct, 16:41, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I am trying to figure out what's the best way to upload large files.
> Let's say 10MB+. It has to be part of the web interface therefore FTP
> is not an option... Java, Flash would do. I just can't find anything
> suitable.
>
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Doxyfile

2007-09-11 Thread djiize

I'm using PHPDocumentor to generate API and have something very
similar to the online one with no patch or tweak

On 11 sep, 15:05, "Mike Green" <[EMAIL PROTECTED]> wrote:
> I too would like to get hold of this. I've asked Mr Nut on irc a
> couple of times and sent him an email, but hes a workaholic (and
> rightly so), so has not had the chance to sent it over.
>
> Maybe another cake-dev could share it :)
>
> Mike
>
> On 11/09/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Could someone please post the Doxyfile used to generate the api
> > documentation for cakephp. I am guessing some modification was
> > required to get it to support several phpdoc style comments.
>
> > thanks
> > David
>
> --
> 
> Mike Green
>
> Find yourself some misspelled ebay bargains!http://www.typingwand.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: API Documentation Generator

2007-09-06 Thread djiize

Where did you see it was parsed by Doxygen?
I still use PHPDocumentor, and I remember a post from phpNut saying it
was parsed by this tool...
http://www.phpdoc.org/

On 6 sep, 16:00, MarkH <[EMAIL PROTECTED]> wrote:
> I'm investigating the use of Doxygen / PHPDocumentor with Cake
> programs.
>
> According to the output athttp://api.cakephp.org/1.2/it's generated
> by Doxygen 1.5.2. However, in my tests I can't get doxygen to parse
> the cake sources without heaps of errors and it was my understanding
> that doxygen can't do things like
>
> @param type name comment
> @result type comment
>
> for PHP?
>
> Does the cake site use a modified doxygen, some king of pre-filter,
> some other king of trickery or do I just need to RTFM somewhere...
>
> Mark


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Cake & Mysql& UTF-8 :(

2007-08-31 Thread djiize

if you have Cake 1.2, add 'encoding' => 'utf8' in conf/database.php
if you have Cake 1.1, call query("SET NAME 'UTF8' ") just after
connexion (don't remember if in database.php or app_model.php)

On 31 août, 18:36, Mech7 <[EMAIL PROTECTED]> wrote:
> Ah that is great google can't handle them either :D here is what it
> looks with me:
>
> http://img124.imageshack.us/img124/2272/characterhellko6.gif
>
> On Aug 31, 6:30 pm, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > Does anybody know how to save utf8 charachters properly in Cake.. when
> > i save special characters they get saved very weird in mysql for
> > exmaple:   becomes 
>
> > The database table is set to utf8_general_ci and in the html it is set
> > to utf8 too.. 
>
> > The problem seems to come when saving to mysql, does anybody know how
> > i can fix this ?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: formatting of log file

2007-08-30 Thread djiize

if you look at source:
http://api.cakephp.org/1.2/cake__log_8php-source.html#l00092
you'll see that write() add a "\n" for each log, so I don't know why
you don't have new lines
With which text editor do you open your log file?

On 30 août, 12:55, rtanz <[EMAIL PROTECTED]> wrote:
> is this thing possible or do i have to store the logs in a db in order
> to achieve this?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Saving search criteria - Clueless!

2007-08-21 Thread djiize

complex way:
create a table searches with fields for all conditions:
  id
  user_id
  bedrooms
  price
  area_id
and its Model

and save your condition:
user_id = 2
bedrooms = 3
price = 'BETWEEN 500 AND 600'
area_id = '02,03' // in string format, choose a separator

and:
// get user conditions from db
$conditions = $this->Search->read(null, $search_id);
// convert some fields, would be better in afterFind in Search Model
$conditions['Search']['area_id'] = explode(',', $conditions['Search']
['area_id']); // to recover array from string
// search properties with conditions
$properties = $this->Property->findAll($conditions);

I didn't tested this code, but you've the idea.
Tell me if you have questions

On 21 août, 17:12, djiize <[EMAIL PROTECTED]> wrote:
> simple way:
> you can serialize your conditions array in a new fieldhttp://php.net/serialize
> but beware of future DB modifications (field renaming, etc...)
>
> On 21 août, 16:00, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > I'm building a property site (trying anyway!)
>
> > I've constructed my search $conditions from the data submitted in the
> > search form - it gives me an array:
>
> > Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
> > AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )
>
> > which in the SQL request gets converted by CAKE into:
>
> > WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
> > (`area_id` IN (02, 03) )
>
> > but I want to offer the option for the user to save these search
> > criteria so the site will email new property details to the  user
> > automagically.
>
> > If I split the $conditions array apart I'll need to save four or more
> > separate rows and build logic to reconstruct them when the time comes
> > to check for new properties.
>
> > Can I just grab the complete query (without running it) and cram it
> > into a field?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Saving search criteria - Clueless!

2007-08-21 Thread djiize

simple way:
you can serialize your conditions array in a new field http://php.net/serialize
but beware of future DB modifications (field renaming, etc...)

On 21 août, 16:00, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm building a property site (trying anyway!)
>
> I've constructed my search $conditions from the data submitted in the
> search form - it gives me an array:
>
> Array ( [Letting] => Array ( [bedrooms] => 3 [price] => BETWEEN 500
> AND 600 [area_id] => Array ( [0] => 02 [1] => 03 ) ) )
>
> which in the SQL request gets converted by CAKE into:
>
> WHERE (`bedrooms` = 3) AND (`price` BETWEEN '500' AND '600') AND
> (`area_id` IN (02, 03) )
>
> but I want to offer the option for the user to save these search
> criteria so the site will email new property details to the  user
> automagically.
>
> If I split the $conditions array apart I'll need to save four or more
> separate rows and build logic to reconstruct them when the time comes
> to check for new properties.
>
> Can I just grab the complete query (without running it) and cram it
> into a field?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---




Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

you're welcome, happy your code work ;)

On 21 août, 16:55, cronet <[EMAIL PROTECTED]> wrote:
> I think it's clear now to me...
>
> I get exactly what I wanted with the following:
> ---%<
> function beforeFilter() {
> if( $this->action != 'view' AND
> $this->action != 'index' ) {
> $this->__validateLoginStatus();
> }
> }
> ---%<----
>
> Thank you for your help djiize !!!
>
> Bye...
>
> On 21 Aug., 14:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > the beforeFilter function have no parameters
> > but you can get the parameters sent to the action by $this->params
>
> > On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote:
>
> > > 2. Great. This works!
>
> > > 3. That's great for debbugging!
> > > ehm. But:
> > > I tried to figure out what params the beforeFilter function accepts.
> > > That isn't in the output...
>
> > > On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > 2. create a file app_controller.php in /app and write that (or copy
> > > > from /cake/app_controller.php):
> > > >  > > > class AppController extends Controller {
>
> > > >   // callback example
> > > >   function beforeFilter() {
> > > > // will be called for ALL controllers
> > > >   }
>
> > > >   // custom function example
> > > >   function __myprivate() {
> > > > // available in every controller with $this->__myprivate()
> > > >   }}
>
> > > > ?>
>
> > > > 3. look at the content of $this
> > > >   pr($this)
> > > > and you'll see:
> > > > $this->name // name of the controller (string)
> > > > $this->action // name of the action (string)
> > > > $this->params // parameters of the action (array)
> > > > $this->passedArgs // named parameters of the action (array)
>
> > > > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > Thank you for your reply.
> > > > > 1. Ok. 1 is clear now.
>
> > > > > 2. How do i extend AppController?
>
> > > > > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > > > > function, because i only want to use it on specific actions.
> > > > > So I thought I look at the API...
>
> > > > > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > > > 1. in Cake conventions, function prefixed with __ is private, so
> > > > > > you're correct
>
> > > > > > 2. if you need to access a function from several controllers, don't
> > > > > > put it in a specific one, move it to app_controller.php.
> > > > > > Since all your controllers extend AppController, 
> > > > > > $this->__validateLogin() is OK
>
> > > > > > IMHO a validateLogin() function is more in a Model than in a
> > > > > > Constroller, but depends of what you're doing in it.
>
> > > > > > 3. just override beforeFilter in your controller, and you'll have
> > > > > > access to controller's variables with $this.
> > > > > > Maybe I don't understand well your question here...
>
> > > > > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi There,
>
> > > > > > > I just started using cake, and having heavy troubles getting some
> > > > > > > basic things to work
>
> > > > > > > 1. How do I define a function without a view?
> > > > > > > I read somewhere on the net, that these actions/functions start 
> > > > > > > with a
> > > > > > > double underscore...
> > > > > > > example: function __validateLogin()
> > > > > > > Is this okay?
>
> > > > > > > 2. How to access the function defined in 1 from other Controllers?
> > > > > > > In the same controller i simply use $this->__validateLogin();
> > > > > > > But in other controllers?
>
> > > > > > > 3. How to get infos from the API?
> > > > > > > e.g. i tried to get informations, what parameters could be used 
> > > > > > > in the
> > > > > > > beforeFilter function...
> > > > > > > I simply searched the api for "beforeFilter" and found the first 
> > > > > > > entry
> > > > > > > useful : "Controller::beforeFilter()";
> > > > > > > But on line 1127 of file controller.php only
>
> > > > > > > 01123 /**
> > > > > > > 01124  * Called before the controller action.  Overridden in
> > > > > > > subclasses.
> > > > > > > 01125  *
> > > > > > > 01126  */
> > > > > > > 01127 function beforeFilter() {
> > > > > > > 01128 }
>
> > > > > > > Nothing more... Wher can I find the source to get the params 
> > > > > > > section?
>
> > > > > > > Perhaps someone could help me and describes how to solve this...
>
> > > > > > > Greetings,
> > > > > > > Alexander


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

the beforeFilter function have no parameters
but you can get the parameters sent to the action by $this->params

On 21 août, 13:28, cronet <[EMAIL PROTECTED]> wrote:
> 2. Great. This works!
>
> 3. That's great for debbugging!
> ehm. But:
> I tried to figure out what params the beforeFilter function accepts.
> That isn't in the output...
>
> On 21 Aug., 12:57, djiize <[EMAIL PROTECTED]> wrote:
>
> > 2. create a file app_controller.php in /app and write that (or copy
> > from /cake/app_controller.php):
> >  > class AppController extends Controller {
>
> >   // callback example
> >   function beforeFilter() {
> > // will be called for ALL controllers
> >   }
>
> >   // custom function example
> >   function __myprivate() {
> > // available in every controller with $this->__myprivate()
> >   }}
>
> > ?>
>
> > 3. look at the content of $this
> >   pr($this)
> > and you'll see:
> > $this->name // name of the controller (string)
> > $this->action // name of the action (string)
> > $this->params // parameters of the action (array)
> > $this->passedArgs // named parameters of the action (array)
>
> > On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
>
> > > Thank you for your reply.
> > > 1. Ok. 1 is clear now.
>
> > > 2. How do i extend AppController?
>
> > > 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> > > function, because i only want to use it on specific actions.
> > > So I thought I look at the API...
>
> > > On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > > > 1. in Cake conventions, function prefixed with __ is private, so
> > > > you're correct
>
> > > > 2. if you need to access a function from several controllers, don't
> > > > put it in a specific one, move it to app_controller.php.
> > > > Since all your controllers extend AppController, 
> > > > $this->__validateLogin() is OK
>
> > > > IMHO a validateLogin() function is more in a Model than in a
> > > > Constroller, but depends of what you're doing in it.
>
> > > > 3. just override beforeFilter in your controller, and you'll have
> > > > access to controller's variables with $this.
> > > > Maybe I don't understand well your question here...
>
> > > > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi There,
>
> > > > > I just started using cake, and having heavy troubles getting some
> > > > > basic things to work
>
> > > > > 1. How do I define a function without a view?
> > > > > I read somewhere on the net, that these actions/functions start with a
> > > > > double underscore...
> > > > > example: function __validateLogin()
> > > > > Is this okay?
>
> > > > > 2. How to access the function defined in 1 from other Controllers?
> > > > > In the same controller i simply use $this->__validateLogin();
> > > > > But in other controllers?
>
> > > > > 3. How to get infos from the API?
> > > > > e.g. i tried to get informations, what parameters could be used in the
> > > > > beforeFilter function...
> > > > > I simply searched the api for "beforeFilter" and found the first entry
> > > > > useful : "Controller::beforeFilter()";
> > > > > But on line 1127 of file controller.php only
>
> > > > > 01123 /**
> > > > > 01124  * Called before the controller action.  Overridden in
> > > > > subclasses.
> > > > > 01125  *
> > > > > 01126  */
> > > > > 01127 function beforeFilter() {
> > > > > 01128 }
>
> > > > > Nothing more... Wher can I find the source to get the params section?
>
> > > > > Perhaps someone could help me and describes how to solve this...
>
> > > > > Greetings,
> > > > > Alexander


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

2. create a file app_controller.php in /app and write that (or copy
from /cake/app_controller.php):
__myprivate()
  }
}
?>

3. look at the content of $this
  pr($this)
and you'll see:
$this->name // name of the controller (string)
$this->action // name of the action (string)
$this->params // parameters of the action (array)
$this->passedArgs // named parameters of the action (array)

On 21 août, 12:22, cronet <[EMAIL PROTECTED]> wrote:
> Thank you for your reply.
> 1. Ok. 1 is clear now.
>
> 2. How do i extend AppController?
>
> 3. I wanted to get behind the 'action' Parameter for the beforeFilter
> function, because i only want to use it on specific actions.
> So I thought I look at the API...
>
> On 21 Aug., 12:07, djiize <[EMAIL PROTECTED]> wrote:
>
> > 1. in Cake conventions, function prefixed with __ is private, so
> > you're correct
>
> > 2. if you need to access a function from several controllers, don't
> > put it in a specific one, move it to app_controller.php.
> > Since all your controllers extend AppController, $this->__validateLogin() 
> > is OK
>
> > IMHO a validateLogin() function is more in a Model than in a
> > Constroller, but depends of what you're doing in it.
>
> > 3. just override beforeFilter in your controller, and you'll have
> > access to controller's variables with $this.
> > Maybe I don't understand well your question here...
>
> > On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
>
> > > Hi There,
>
> > > I just started using cake, and having heavy troubles getting some
> > > basic things to work
>
> > > 1. How do I define a function without a view?
> > > I read somewhere on the net, that these actions/functions start with a
> > > double underscore...
> > > example: function __validateLogin()
> > > Is this okay?
>
> > > 2. How to access the function defined in 1 from other Controllers?
> > > In the same controller i simply use $this->__validateLogin();
> > > But in other controllers?
>
> > > 3. How to get infos from the API?
> > > e.g. i tried to get informations, what parameters could be used in the
> > > beforeFilter function...
> > > I simply searched the api for "beforeFilter" and found the first entry
> > > useful : "Controller::beforeFilter()";
> > > But on line 1127 of file controller.php only
>
> > > 01123 /**
> > > 01124  * Called before the controller action.  Overridden in
> > > subclasses.
> > > 01125  *
> > > 01126  */
> > > 01127 function beforeFilter() {
> > > 01128 }
>
> > > Nothing more... Wher can I find the source to get the params section?
>
> > > Perhaps someone could help me and describes how to solve this...
>
> > > Greetings,
> > > Alexander


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Newbie starting questions for 1.2.x!

2007-08-21 Thread djiize

1. in Cake conventions, function prefixed with __ is private, so
you're correct

2. if you need to access a function from several controllers, don't
put it in a specific one, move it to app_controller.php.
Since all your controllers extend AppController, $this-
>__validateLogin() is OK
IMHO a validateLogin() function is more in a Model than in a
Constroller, but depends of what you're doing in it.

3. just override beforeFilter in your controller, and you'll have
access to controller's variables with $this.
Maybe I don't understand well your question here...

On 21 août, 11:25, cronet <[EMAIL PROTECTED]> wrote:
> Hi There,
>
> I just started using cake, and having heavy troubles getting some
> basic things to work
>
> 1. How do I define a function without a view?
> I read somewhere on the net, that these actions/functions start with a
> double underscore...
> example: function __validateLogin()
> Is this okay?
>
> 2. How to access the function defined in 1 from other Controllers?
> In the same controller i simply use $this->__validateLogin();
> But in other controllers?
>
> 3. How to get infos from the API?
> e.g. i tried to get informations, what parameters could be used in the
> beforeFilter function...
> I simply searched the api for "beforeFilter" and found the first entry
> useful : "Controller::beforeFilter()";
> But on line 1127 of file controller.php only
>
> 01123 /**
> 01124  * Called before the controller action.  Overridden in
> subclasses.
> 01125  *
> 01126  */
> 01127 function beforeFilter() {
> 01128 }
>
> Nothing more... Wher can I find the source to get the params section?
>
> Perhaps someone could help me and describes how to solve this...
>
> Greetings,
> Alexander


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: where to put independent functions

2007-08-16 Thread djiize

If you want to access by http://mysite.com/uploadfile, you'll need to
wrap it in an controller's action

let's say:
controller: UploadController
action: uploadfile

and write a route that redirect /uploadfile to /upload/uploadfile

If you want a function and its view, in Cake words, it's a controller
action and its view.

I hope you understood my not-so-clear explanation...

On 16 août, 14:06, rtanz <[EMAIL PROTECTED]> wrote:
> in my case i wouldnt want to call any particular controller, but just
> the upload function directly, therefore i would need just the function
> and its view, and i would want to call it from mysite.com/uploadfile
>
> should i use the bootstrap to do this?
> 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?hl=en
-~--~~~~--~~--~--~---



Re: where to put independent functions

2007-08-16 Thread djiize

since it's business logic, you can make a component for that
(UploadComponent) and include it in your controller(s) ( var
$components = array('Upload') )

in addition, for simple fonctions, you can add them in /app/config/
bootstrap.php. This file is loaded at the start of the request, and
its content is available almost everywhere.

On 16 août, 10:42, rtanz <[EMAIL PROTECTED]> wrote:
> hi i am wondering where to put some functions which are independent
> from the models in my site. for example i have a file upload function
> which does not affect anything else but is just used to upload files
> into a folder on the server without saving anything to the database.
> 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?hl=en
-~--~~~~--~~--~--~---



Re: Can you use helpers in controllers?

2007-08-09 Thread djiize

I don't know if you can access helpers from controller, but I know you
shouldn't do it!

Helpers are for views, components are for controllers (and behaviors
for models)

A component + helper combo is possible, maybe your solution.

On 9 août, 11:00, Mike Green <[EMAIL PROTECTED]> wrote:
> Dear all
>
> I've come across a small problem.
>
> In my app, I'm trying to totally seperate all of the calculations and
> views into the controllers and .ctp files, which seem to be fine.
>
> However, when I am populating my table array, ready for the view, I
> want to use the cake html helper class, and it seems that I can only
> call this from the .ctp file with $html->link() function. Is there any
> way at all to be able to use this helper in the controller as then I
> can populate the links array before the view even sees it.
>
> then the view can literally just call
>
> echo $html->tableCells($mylinks);
>
> Are there any workaround? Somebody on irc suggested using
> HtmlHelper::link() but that didn't work.
>
> Open to ideas here. Please don't tell me that my view will have to
> traverse an array and populate stuff. Oh and I dont really want to
> hard code it from the controller either as at some point joomla (jake)
> will need to hook into it at some point.
>
> Thanks in advance
>
> MIke


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: constants issue

2007-08-09 Thread djiize

you have access from almost everywhere to:
$this->name // controller name (events)
$this->action // action name (view)

and several constants are in /cake/basics.php

On 9 août, 08:17, francky06l <[EMAIL PROTECTED]> wrote:
> You want to extract this from where, I mean, in a controller ?
> beforeFilter ?
>
> On Aug 9, 7:50 am, CakeMan <[EMAIL PROTECTED]> wrote:
>
> > Hello Friends,
>
> > do anyone has list of Contants in Cakephp. i have seen in the manul
> > but they will not do me good in my task.
>
> > What i need is :-
>
> > Suppose we have a URL such 
> > ashttp://mysite.com/insidecake/events/view/28/12/2016
>
> > i want to extract URL upto "http://mysite.com/insidecake/events"; how
> > can i achieve this.
>
> > I have used "FULL_BASE_URL" but i have got only "http://mysite.com";
> > other constants are not working such as $this->webroot, WWW_ROOT  etc.
>
> > Pls help.
>
> > 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?hl=en
-~--~~~~--~~--~--~---



Re: How to force a 404 error?

2007-06-25 Thread djiize

the simple way:
$this->redirect('qsdfqsdf'); // or whatever non-existent page you want
(/page-doesnt-exist for instance)

notice: only work with DEBUG = 0

On 25 juin, 10:28, Braindead <[EMAIL PROTECTED]> wrote:
> Hi, I'm using CakePHP for a week now. And now I'm searching for a
> possibility to force a 404 error (and display the 404 error page) in a
> controller when certain conditions are met.
>
> Is there a possibility or is it not possible?
>
> Braindead


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: HABTM relationship and meta-data in link-table

2007-06-20 Thread djiize

Take this cautiously, it's just an experiment.

I just found an interest for the 'with' parameter when defining an
HABTM when reading the source code.

So I defined that:
class Estate extends AppModel {
var $name   = 'Estate';
var $hasAndBelongsToMany= array(
'Service'   => array(
'with'  => 'EstateService',
),
);
}
class Service extends AppModel {
var $name   = 'Service';
var $hasAndBelongsToMany= array('Estate');
}

My view action warned me about a EstateService model, so...
class EstateService extends AppModel {
var $name   = 'EstateService';
var $useTable   = 'estates_services'; // for some 
Inflector reasons I
didn't care about for now, I must add that or Model search for
estate_services table
}

And now in my view, I have that:
Array
(
[Estate] => Array
(
[id] => 1
[name] => lorem ipsum
[description] => dolor sit amet
[type_id] => 1
[created] => 2007-06-20 23:08:03
[modified] => 2007-06-20 23:10:33
)
[Type] => Array
(
[id] => 1
[name] => Apartment
)
[Service] => Array
(
[0] => Array
(
[id] => 1
[name] => Service1
[EstateService] => Array
(
[estate_id] => 1
[service_id] => 1
[comment] => test1
)
)
[1] => Array
(
[id] => 3
[name] => Service2
[EstateService] => Array
(
[estate_id] => 1
[service_id] => 3
[comment] => test2
)
)
)
)

Tadaa, did you see the "comment" field? ;)
And thanks to this design, you can also use another table than the
real join-table.

Maybe someone more experimented with this technic can add his comments
please?
Just to confirm I don't misunderstand the purpose of this parameter...

I repeat, take this cautiously, I'm only playing with this thing for
half an hour now

On 20 juin, 22:46, BoSc <[EMAIL PROTECTED]> wrote:
> Does this allow me to update the join-table, also the columns that are
> not really part of the HABTM association?
>
> Also, at the moment I solved this using the Has Many --> Belongs to
> <-- Has many method. The solution was to use the recursive variable.
>
> thanks for the help so far.
>
> On Jun 20, 1:59 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:> I did something 
> similar, where 'faculty' has and belongs to many
> > 'activity' and each link has a student count associated with it -- I
> > used a custom finderQuery in the definition of the association to pull
> > the student count field with all the other data (TSQL, so some minor
> > differences from MySQL, and this works with cake 1.2):
>
> > var $hasAndBelongsToMany = array(
> > 'Activity' => array('className'  => 'Activity',
> > 'joinTable'  => 'activity_links',
> > 'foreignKey' => 'faculty_id',
> > 'associationForeignKey' => 'activity_id',
> > 'unique' => true,
> > 'finderQuery' => '
> > SELECT
> > [Activity].[id] as [Activity.id],
> > [Activity].[name] as [Activity.name],
> > [Activity].[activity_type_id] as [Activity.activity_type_id],
> > [Activity].[credits] as [Activity.credits],
> > [ActivityLink].[students] as [Activity.students],
> > [ActivityLink].[id] as [Activity.activity_link_id]
> > FROM
> > [activities] AS [Activity]
> > JOIN [activity_links] AS [ActivityLink] ON [ActivityLink].
> > [activity_id] = [Activity].[id]
> > WHERE
> > [ActivityLink].[faculty_id] = {$__cakeID__$}
> > ORDER BY
> > [Activity].[name] ASC'
> >   )
>
> > On Jun 20, 6:03 am, BoSc <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I have three tables:
>
> > > cities
> > > categories
> > > categories_cities
>
> > > The first two are normal tables, the third one is used for linking.
> > > Since I want to be able to indicate if the link is active, I've added
> > > a column active to the categories_cities table. Using HABTM I am not
> > > able to access any data of the categories-cities table caus it's used
> > > for linking only. Is there any way to do make this work?
>
> > > I've considered u

Re: Design questions

2007-06-20 Thread djiize

best place for validation of data is in models, but it's flexible
enough ;)

look for $validation member in Model class, and also beforeValidation
callback

On 20 juin, 09:35, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Ok one more question.. If i have multiple controllers that i want all
> to use some validation method, where would be the best place to put
> the validation method?
>
> On Jun 17, 5:28 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > I would keep the functionality in separate controllers, not bloat your
> > Users one just because you want to access the User model.  To ensure
> > that users cannot view/edit someone elses data you just need to
> > incorporate this into whatever ACL you use.  For our application I
> > have a function in app_model called isUserOwned( $user_id, $row_id ),
> > which just does a lookup to see if the requested row is owned by the
> > passed user id.  This can easily be included in all my controller
> > actions before allowing the request to proceed.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: i18n and sprintf

2007-06-14 Thread djiize

> msgid "Tomatoes"
> msgstr "Tomates"

That's a way to do that, but same things, you will have to list ALL
possibilities. If data comes from DB, it's almost impossible.

Another way if data comes from DB, you can use the Translate behavior.
It permits you to have some fileds in several languages.
Check this thread about this feature:
http://groups.google.com/group/cake-php/browse_frm/thread/889c63d32cfdf69/894514404c1f133f?lnk=gst&q=translate&rnum=2#894514404c1f133f

On 14 juin, 12:00, Gilles Dubois <[EMAIL PROTECTED]> wrote:
> I want to translate in french "Edit" to "Modifier" and "Tomatoes" to
> "Tomates".
>
> I don't think that the first methos works. If in my default.po i put :
>
> msgid "Edit %s"
> msgstr "Modifier %s"
>
> The result is "Modifier Tomatoes" (a mixture of French and English)
>
> If it works for you, can you explain me what you put in your
> default.po ?
>
> I think that "sprintf(__("Edit %s", true), __($name, true))" could be
> a good method ?
> With :
>
> msgid "Edit"
> msgstr "Modifier"
>
> msgid "Tomatoes"
> msgstr "Tomates"


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: i18n and sprintf

2007-06-11 Thread djiize

the 1st method is the correct one, because you .po file needn't need
to know all $name possibilities
then you can translate "Edit %s" to "Whatever %s" you want, and %s can
be tomatoes or potatoes or carrots or ...

On 11 juin, 18:20, Gilles Dubois <[EMAIL PROTECTED]> wrote:
> In CakePHP, in particular in the scaffolding, there are many lines of
> code with, for example, sprintf(__("Edit %s", true), $name)) who, in
> my opinion, do not function, while __(sprintf ("Edit %s", $name),
> true) gives the awaited result. What do you think about 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?hl=en
-~--~~~~--~~--~--~---



Re: Sessions Issue

2007-05-30 Thread djiize

I had an issue like that with WAMP, it was due to an "underscore" in
the subdomains and the session didn't "fix".
Maybe not your case, but I must told you in case of ;)

On 30 mai, 14:51, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 5/29/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Chris,
>
> > The debug is set to 2. The set up is WAMP where I experience this
> > issue. However, just to make sure that this happens on Linux box or
> > not, I booted into Linux and it works fine in linux. So I don't know
> > if its CakePHP issue or its WAMP configuration issue. Let me know.
>
> Sorry, no experience with WAMP at this end.  I don't know of any
> tried-and-true methods of debugging sessions.  There must be other
> people from the WAMP crowd on this list who can help you out.
>
> Good to see that debug is set to 2.  First step is to get as much
> information as possible. :)
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @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?hl=en
-~--~~~~--~~--~--~---



Re: Changing datasources to support web services.

2007-05-24 Thread djiize

instead of doing:
$this->setDataSource('whatever');

you can do that:
class MyModel extends AppModel {
  $useDbConfig = 'whatever';
  //...
}

On 24 mai, 17:37, shmit <[EMAIL PROTECTED]> wrote:
> Because I like to answer my own questions, I found the solution to
> this.
>
> Here's how you set up the map for your new service:
>
> name your file 'app/models/datasources/type_source.php' (e.g.,
> 'web_services_source.php')
> your class name will be the StudlyCaps version of that (e.g.,
> 'WebServicesSource'), defined in the above file.
>
> Set up a map for that datasource to a name in database.php's
> DATABASE_CONFIG class:
>
> var $whatever = array('datasource' => 'type'); (e.g.: var
> $web_services => array('datasource' => 'web_services'))
>
> The datasource value is the name of your datasource file w/o the
> '_source.php' at the end. The name of the variable ($web_services),
> can be whatever you want.
>
> In your model, tell it to use your new data source. I did this in the
> constructor with:
>
> $this->setDataSource('whatever');
>
> Where 'whatever' is the name of your variable in the DATABASE_CONFIG
> class.
>
> I'm probably doing that last part wrong, but it seems to work for me.
>
> On May 24, 11:01 am, shmit <[EMAIL PROTECTED]> wrote:> On May 23, 7:44 pm, 
> gwoo <[EMAIL PROTECTED]> wrote:
>
> > > then create a connection in database.php that can be used.
> > > you could use the xml class to get the web service.
>
> > This is the part I'm missing. I can't for the life of me figure out
> > how to get the data source loaded. The docs turn up nothing. Google
> > turns up nothing, and I can't pick apart the source enough (yet) to
> > figure out how to load it.
>
> > The only thing I've found was this comment:
>
> >  * @param string $name The name of the DataSource, as defined in 
> > app/
> > config/connections
>
> > Of course, the file doesn't exist, and I can't even tell if its
> > getting loaded at all, nor what format it's supposed to be in.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Best Practices - Associations & calling functions

2007-05-13 Thread djiize

It should work if you have a function cleanComment() in your Comment
model.
$this->Post->Comment is an instance of the comment model and have all
its functions.

But the better is to test if it's right and tell us the result ;)

On 13 mai, 20:46, johnvv <[EMAIL PROTECTED]> wrote:
> I'm wondering what the best practice is for calling a method from
> inside one controller that happens to associate with another Model/
> Controller.
>
> For Instance, if I have a blog post that has many comments and I want
> to run a method within the CommentsController to format/clean the
> comment... how would I do this?
>
> I doubt something like this would work
>
> PostController {
> ...
> function view($id){
> ..
> $this->Post->Comment->cleanComment();
>
> }
>
> Thoughts?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Get rid of default header

2007-05-09 Thread djiize

Don't edit the files in /cake folders, it's the CORE of Cake, and
should never been modified!
All your files must be in /app and/or /vendors
Create default.ctp in /app/views/layouts/ if not exists
And read the manual for layout/view/conventions rules

On 9 mai, 11:48, AD7six <[EMAIL PROTECTED]> wrote:
> On 9 mayo, 11:16, rocky <[EMAIL PROTECTED]> wrote:
>
> > Hey Greg,
>
> > Thanks very much for your reply! it helps a lot although the location
> > should be in /cake/lib/views/layouts/
>
> Do not edit that file - see the link Greg provided.
>
> AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: how to deal with static pages ,can I routes url to a html page?

2007-05-09 Thread djiize

search for "Pages controller" in the group
for short: it's a special controller, you just add .thtml|.ctp files
in /app/viws/pages/ folder and they are visible at mysite.com/pages/
file (without extension)

On 9 mai, 10:42, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> how you guys to deal with static pages ,
>
> can I routes url to a html page,and how?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Disapearing text in IE

2007-05-09 Thread djiize

It's a CSS cause
but I don't know exactly where in the file, I always start projects
with a blank CSS

On 9 mai, 11:01, Harro <[EMAIL PROTECTED]> wrote:
> I have the latest stable release of cake, with no edits to the CSS.
> But when I use tags such as ,  ect. in the view files, the text
> is invisable in IE until you highlight it, but it remains visible once
> you un-highlight it again.
>
> Sites appear fine in FF and Opera. Anyone have any ideas on this?
>
> Thanks, Harro.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: problem with index page

2007-05-09 Thread djiize

it seems you have not the mysql extension for PHP
if you have PHP5, try mysqli instead of mysql in your database conf
file

On 9 mai, 09:43, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> hi i am new to cakephp , i am facing one problem , i followed the
> tutorial 
> fromhttp://www.learncake.com/installing-cakephp-and-configuring-mysql/,
> but am getting an error like this
>
> Your database configuration file is present.
>
> Fatal error: Call to undefined function mysql_connect() in C:\Program
> Files\Apache Software Foundation\Apache2.2\htdocs\cake_1.1.14.4797\cake
> \libs\model\dbo\dbo_mysql.php on line 102
>
> how to solve this problem
>
> please help me
>
> regards
> Shalid


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Main index page

2007-05-04 Thread djiize

Hi jeffy

1. to custom the homepage, create the file /app/views/pages/home.thtml
(or .ctp with Cake 1.2)
2. search in the manual and group for Pages controller

On 4 mai, 15:12, jeffy <[EMAIL PROTECTED]> wrote:
> Hi guys
>
> A newbie question, I can't find the answer:
>
> 1. How can I set a main index page for a website?
> There are a lot of manuals, but in every manual there are examples of
> how to createwww.mysite.com/posts/index
> orwww.mysite.com/posts/user. How do I create and index forwww.mysite.com?
> BTW main page must use different header(bigger header image). How can
> I do that?
>
> 2. What is a best way for creating static pages (but they must use
> general website layout)
>
> Thanks 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?hl=en
-~--~~~~--~~--~--~---



Re: tag behavior, where was it ?

2007-05-02 Thread djiize

The Bakery / Code / Behaviors / Simple Tagging Behavior
http://bakery.cakephp.org/

On 2 mai, 11:06, thequietlab <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I remember I've seen somewhere a tag behavior and now I can't find
> it ..
>
> Can anyone help ?
>
> Thanks,
> thequietlab


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Associate two models without using the primary key

2007-04-04 Thread djiize

in manual:
http://manual.cakephp.org/chapter/models
section 4, you can pass extra parameters to associations

On 4 avr, 17:06, Gonçalo Marrafa <[EMAIL PROTECTED]> wrote:
> Hi.
>
> Can i associate two models using another field other than the primary
> key?
>
> What i have is a set of entities that can access the system. They can be
> persons, units (and others). I have an entity table to associate the
> auth information with the correspondent subjects. Here's an example:
>
> entity:   user:
>   idid
>   type  username
> entity
>
> person:   unit:
>   idid
>   name  name
>   entityentity
>
> What i would like to do is to associate the Unit and Person models to the
> User model joining then by the entity field (that isn't a primary key on
> either of them). Is there a way to do this with Cake's associations?
>
> Thanks in advance.
>
> --
> Gonçalo Marrafa <[EMAIL PROTECTED]>


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: problem with html->link

2007-04-04 Thread djiize

if you uncomment BASE_URL, don't forget to delete .htaccess files
in / /app and /app/webroot

On 4 avr, 15:20, "andy corpes" <[EMAIL PROTECTED]> wrote:
> Hi again Djiize
>
> I was looking in the wrong place, my define of the BASE_URL was commented
> out!!!
>
> Things are looking a little different now,, not quite correct, but it may be
> my own fault, at least i'm not so baffled.
>
> Thanks for leading me to the correct place.
>
> On 04/04/07, andy corpes <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi djiize,
>
> > Here my baseurl setting
>
> > define ('BASE_URL', env('SCRIPT_NAME'));
>
> > is also tried
>
> > define ('BASE_URL', "cake/index.php/".env('SCRIPT_NAME'));
>
> > But it did not appear^to make any difference,, do i need to restart
> > something to make this happen?
>
> > On 04/04/07, djiize < [EMAIL PROTECTED]> wrote:
>
> > > If you want url like '/cake/index.php/...', you don't use mod_rewrite,
> > > you use Cake rewrite
> > > Have you correctly set the constant BASE_URL in core.php ?
>
> > > On 4 avr, 14:13, "andy corpes" <[EMAIL PROTECTED]> wrote:
> > > > Hi group,
>
> > > > I'm having trouble with the URL's created by the HTML helper, and
> > > perhaps
> > > > mod rewrite.
>
> > > > My urls should look something like this:-
>
> > > >http://ac85489m/cake/index.php/tblallrepositories/index
>
> > > > when i construct a link using the html helper it generates a url like
> > > this:-
>
> > > >http://ac85489m/TblAllrepositories/Browse/PROD
>
> > > > the cake/index.php has disappeared, how can i make the html helper
> > > create a
> > > > url that is valid for me?
>
> > > > --
> > > > Andy
>
> > --
> > Andy
>
> --
> Andy


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



  1   2   >