Re: CakePHP 1.3.7 released

2011-02-01 Thread Name256
I did that and it worked to some effect. I am currently working on a
way to get around the problem but I hope that in time this feature
will be added to Containable behaviour.

Regards

On Feb 2, 10:15 am, Jeremy Burns | Class Outfit
 wrote:
> Don't forget you can use 'joins' that can give you the results you want. It's 
> just a bit more fiddly.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 2 Feb 2011, at 07:13, Name256 wrote:
>
>
>
>
>
>
>
> > This would be nice as well. I'm just kind of in a dilemma on my
> > current project where I am having problems getting desired results
> > while using containable behaviour. I hope that this change will be
> > effected on future versoins of CakePHP or it is atleast being
> > considered because there are those times that conditions on the
> > hasMany or HABTM side will affect the results of an entire query.
>
> > Kind regards.
> > Abel
>
> > On Feb 2, 9:55 am, Jeremy Burns | Class Outfit
> >  wrote:
> >> I think an option to turn this on or off inside the 'contain' element 
> >> would be fantastic.
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 2 Feb 2011, at 06:52, Name256 wrote:
>
> >>> Fantastic news. I was wondering whether there were going to be any
> >>> changes made to the containable behaviour in the results returned from
> >>> queries where filters applied to child models can be strictly applied
> >>> to the parent model as well to endure that data is filtered
> >>> accordingly (I am aware that containable is designed to filter data i
> >>> related models only and not the parent model of the query).
>
> >>> Kind regards.
>
> >>> Abel
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: SecondController extends FirstController extends AppController: not supported? --psybear

2011-02-01 Thread Joshua Muheim
Thanks Jamie for your interesting thoughts.

On Tue, Feb 1, 2011 at 8:05 PM, Jamie  wrote:
> And since extending controllers beyond the AppController
> relationship isn't really in the docs and not the "official" way to do
> things, there probably hasn't been much impetus to change the
> behavior.

The beauty of modern languages and design patterns is the fact that
many things work "automagically" (when I love something of CakePHP,
then this word!). And beneath the fact that in the official docs
nothing is documented that lies a bit above the very basic
functionalities, I want to point out at least my own situation that
has lead me into wishing an inheritance chain for controllers would be
supported by CakePHP:

I have two kinds of controllers. The first one are the well known
CRUD-controllers that come with a certain model. I need certain
components and helpers for those controllers loaded, and I could be
attempted to place them in the AppController. So for an example, one
of these components "XYZ" takes some action whenever the index()
action is called.
The second kind of controllers are all the other controllers that
deliver non-CRUD-functionality, e.g. PagesController, SearchController
or something like that. Now these controllers don't need the
components of the CRUD-controllers, but when having them placed in
AppController they automatically do! So this is unnecessary overhead,
and also the XYZ component tries to do some action on every
non-CRUD-controller's index() action that could cause problems.
So this leads me to the situation where I have to either load all the
CRUD-components not in the AppController but in every single
CRUD-controller itself, or I have to check within the component
whether the action should be executed or not. Both workarounds aren't
very pretty and lead to duplicated and/or unclean code.

So again: am I the only person who has ever faced this problem? Or is
it another of those situations I pointed to some posts before...?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Jeremy Burns | Class Outfit
Don't forget you can use 'joins' that can give you the results you want. It's 
just a bit more fiddly.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 07:13, Name256 wrote:

> This would be nice as well. I'm just kind of in a dilemma on my
> current project where I am having problems getting desired results
> while using containable behaviour. I hope that this change will be
> effected on future versoins of CakePHP or it is atleast being
> considered because there are those times that conditions on the
> hasMany or HABTM side will affect the results of an entire query.
> 
> Kind regards.
> Abel
> 
> On Feb 2, 9:55 am, Jeremy Burns | Class Outfit
>  wrote:
>> I think an option to turn this on or off inside the 'contain' element would 
>> be fantastic.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
>> On 2 Feb 2011, at 06:52, Name256 wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Fantastic news. I was wondering whether there were going to be any
>>> changes made to the containable behaviour in the results returned from
>>> queries where filters applied to child models can be strictly applied
>>> to the parent model as well to endure that data is filtered
>>> accordingly (I am aware that containable is designed to filter data i
>>> related models only and not the parent model of the query).
>> 
>>> Kind regards.
>> 
>>> Abel
>> 
>>> --
>>> Our newest site for the community: CakePHP Video 
>>> Tutorialshttp://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Name256
This would be nice as well. I'm just kind of in a dilemma on my
current project where I am having problems getting desired results
while using containable behaviour. I hope that this change will be
effected on future versoins of CakePHP or it is atleast being
considered because there are those times that conditions on the
hasMany or HABTM side will affect the results of an entire query.

Kind regards.
Abel

On Feb 2, 9:55 am, Jeremy Burns | Class Outfit
 wrote:
> I think an option to turn this on or off inside the 'contain' element would 
> be fantastic.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 2 Feb 2011, at 06:52, Name256 wrote:
>
>
>
>
>
>
>
> > Fantastic news. I was wondering whether there were going to be any
> > changes made to the containable behaviour in the results returned from
> > queries where filters applied to child models can be strictly applied
> > to the parent model as well to endure that data is filtered
> > accordingly (I am aware that containable is designed to filter data i
> > related models only and not the parent model of the query).
>
> > Kind regards.
>
> > Abel
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Jeremy Burns | Class Outfit
I think an option to turn this on or off inside the 'contain' element would be 
fantastic.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 2 Feb 2011, at 06:52, Name256 wrote:

> Fantastic news. I was wondering whether there were going to be any
> changes made to the containable behaviour in the results returned from
> queries where filters applied to child models can be strictly applied
> to the parent model as well to endure that data is filtered
> accordingly (I am aware that containable is designed to filter data i
> related models only and not the parent model of the query).
> 
> Kind regards.
> 
> Abel
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 1.3.7 released

2011-02-01 Thread Name256
Fantastic news. I was wondering whether there were going to be any
changes made to the containable behaviour in the results returned from
queries where filters applied to child models can be strictly applied
to the parent model as well to endure that data is filtered
accordingly (I am aware that containable is designed to filter data i
related models only and not the parent model of the query).

Kind regards.

Abel

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-01 Thread Dr. Tarique Sani
I will play the devil's advocate here

if I10n/i18n is your priority specifically if you store translated model
content, be ready to optimise your app and cache your views on a per
language basis because the default translate behaviour adds one LEFT JOIN
per model field to be translated to your query - so if you have long table
rows the query gets to be very slow very soon

Also 10 is a small total number but performance depends on number of
concurrent users - this is not cakePHP specific but a general web app rule

But again cake allows you to optimize everything very easily so build with
cake and come back with specific problems

Cheers
Tarique

On Wed, Feb 2, 2011 at 5:15 AM, Salines  wrote:

> Hi,
>
> My next project requires the following:
>
> Social networking
> l10n / i18n
> 60 or more tables in the database
> many tables have multiple associations
> user has many associations
> track user activity
> user has a daily statistics (hits user page, ..)
> RBAC / ACL, user privileges: Guest, registered, premium, translator,
> moderator, admin, ..
> pay per sms, credit card payment gateway
> SLUG
> etc
>
> We want to build a system for potential 100,000 users of our services
> in the first year.
> Content on the site will attract a large number of hits.
>
> For future growth:
> db prepared for load balancing
> separate servers for images and video etc
> Nginx server for application, etc
>
> I want to hear your views, articles on the net does not provide enough
> information, most of them old, others suggest other frameworks,
>
> http://www.google.com/search?q=php+frameworks+large+scale
>
> Thanks
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-01 Thread sanjib dhar
1,0 users is very very small I think.

On Wed, Feb 2, 2011 at 6:09 AM, Louie Miranda  wrote:

> I think, 100,000 users is small.
> --
> Louie Miranda
>
>
>
>
> On Wed, Feb 2, 2011 at 8:26 AM, Larry E. Masters  wrote:
>
>> CakePHP can do it. No other opinion needed.
>>
>> --
>> Larry E. Masters
>>
>>
>> On Tue, Feb 1, 2011 at 5:45 PM, Salines wrote:
>>
>>> Hi,
>>>
>>> My next project requires the following:
>>>
>>> Social networking
>>> l10n / i18n
>>> 60 or more tables in the database
>>> many tables have multiple associations
>>> user has many associations
>>> track user activity
>>> user has a daily statistics (hits user page, ..)
>>> RBAC / ACL, user privileges: Guest, registered, premium, translator,
>>> moderator, admin, ..
>>> pay per sms, credit card payment gateway
>>> SLUG
>>> etc
>>>
>>> We want to build a system for potential 100,000 users of our services
>>> in the first year.
>>> Content on the site will attract a large number of hits.
>>>
>>> For future growth:
>>> db prepared for load balancing
>>> separate servers for images and video etc
>>> Nginx server for application, etc
>>>
>>> I want to hear your views, articles on the net does not provide enough
>>> information, most of them old, others suggest other frameworks,
>>>
>>> http://www.google.com/search?q=php+frameworks+large+scale
>>>
>>> Thanks
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>>> others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php
>>>
>>
>>  --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php
>>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Locale files No such file or directory error apparently causing speed issues.

2011-02-01 Thread #2Will
Hi Thanks for your response AD7six

When you say its not an error, do you mean cake is meant to do this,
as part of looking for files in a set order till finds a default?

I didn't have a locale set (i hadn't really thought to as im not
trying to be international) so i put
Configure::write('Config.language', 'eng'); into my boot strap.  Guess
i need to do this for all my cake projects.

I ran the console i18n thing, and it developed various po files and i
have put them into my eng dir.

Its now looking for core.po and core.mo and can't find them  - Should
i be making those? If so, how do i make the core.po and core.mo
files?

What could be wrong with cache set up? Ive just uncommented the file
cache set up & set disable cache to false in core.php and that seems
to be generating lots of cache files as expected. Is it more
complicated than this? I don't think it is right?

This all seems like a lot of set up for a feature im not using. Which
makes me think its either a non issue or im doing something
fundamentally wrong.




On Jan 28, 8:56 pm, AD7six  wrote:
> On Jan 28, 5:57 am, "#2Will"  wrote:
>
>
>
> > Hi Everyone,
>
> > Im getting quite slow speeds off a small site hosted onMediaTemples
> > Grid service.  The Tech guys there say that my app (a basic cms) is
> > giving this error:
>
> > "There seem to be many failed stats for /app/locale/LC_MESSAGES. An
> > strace of the index.php shows ~216 failed calls for this directory and
> > files within it"
>
> > eg:
>
> > access("/nfs/c03/h01/mnt/45558/domains/soulstarvision.com/html/app/
> > locale//LC_MESSAGES/default.po", F_OK) = -1 ENOENT (No such file or
> > directory)
>
> > Why would cake throw this error?
>
> it's not an error
>
> >  Im not sure where the guy is seeing this as its not in cake's logs or the 
> > server error_log.
>
> He's looking at a strace log (as he states in the 
> messagehttp://en.wikipedia.org/wiki/Strace) showing what files your php app
> is looking for.
>
>
>
> > I notice the double // bit.  Im wondering if there shouls be something
> > like "eng" in there.  Am i barking at the wrong tree?
>
> right tree :)
>
> > If not, why is "eng" missing.
>
> > There isn't anything in my /eng/LC_Messages dir anyway.
>
> Repeatedly looking for the same file is a symptom of not having your
> cache setup correctly. looking for locale//LC_MESSAGES is a symptom of
> something else not being configured correctly - which if you do a bit
> of investigating in the i18n code should either yeild:
>
> * a config issue
> * a bug
>
> in either case - you should be able to figure out what to do about it.
>
> hth,
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Media View related Query

2011-02-01 Thread cricket
On Tue, Feb 1, 2011 at 9:57 PM, newguy  wrote:
> Hi
> I want to download four different files through 4 different links, I
> am using Media View to download file but I have to hardcode the file
> name in the download function in controller:
>
> function download () {
>        $this->view = 'Media';
>        $params = array(
>              'id' => 'example.zip',
>              'name' => 'example',
>              'download' => true,
>              'extension' => 'zip',
>              'path' => APP . 'files' . DS
>       );
>       $this->set($params);
>    }
>
> This works fine for one file, now for link number 2,3,4 do I need to
> create 3 different actions and give different file names in them or is
> there a way in which I can use download() only and depending on which
> link has been clicked respective file is downloaded.

Just pass the file name or slug in the link. I use the latter, where
each downloadable file has a title and slug:

Router::connect(
'/downloads/:slug',
array(
'controller' => 'files',
'action' => 'download'
),
array(
'slug' => '[-0-9a-z]+',
'pass' => array('slug')
)
);

public function download($slug = null) { ... }

Or you could pass the record ID:

Router::connect(
'/downloads/:id',
array(
'controller' => 'files',
'action' => 'download'
),
array(
'id' => '[0-9]+',
'pass' => array('id')
)
);


public function download($id = null) { ... }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: where would you put the container?

2011-02-01 Thread cricket
On Tue, Feb 1, 2011 at 1:14 PM, cake-learner  wrote:
> I want to set up a container so that i can save everything and access
> through that class when getting session variables.
>
> Page A
> $appClass = new AppClass();
> $appClass -> specific_value = 1000;
> $this -> Session -> write( "appclass", appClass );
>
> Page B
> $appClass = $this -> Session -> read( "appclass", appClass );
> echo $appClass -> specific_value;
> echo $appClass -> other_value;
>
> In other frameworks, they have a certain folder for autoload ( all
> classes within that folder will be loaded automatically ) but i am not
> sure if cakephp has one.
> Or I could set up a single class and include it in that top of page

Can you give a more concrete example? It's not really clear to me what
problem you're trying to solve.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Media View related Query

2011-02-01 Thread newguy
Hi
I want to download four different files through 4 different links, I
am using Media View to download file but I have to hardcode the file
name in the download function in controller:

function download () {
$this->view = 'Media';
$params = array(
  'id' => 'example.zip',
  'name' => 'example',
  'download' => true,
  'extension' => 'zip',
  'path' => APP . 'files' . DS
   );
   $this->set($params);
}

This works fine for one file, now for link number 2,3,4 do I need to
create 3 different actions and give different file names in them or is
there a way in which I can use download() only and depending on which
link has been clicked respective file is downloaded.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Uploading Image with MeioUpload and No Table

2011-02-01 Thread cricket
On Mon, Jan 31, 2011 at 9:29 PM, Arak Tai'Roth  wrote:
> Hey there,
>
> So, something I've been stumbling around for a little bit now and
> can't seem to find any references regarding. I am using MeioUpload for
> my image file upload behaviour. It's working great, no issues there.
>
> However, I am now using it on a form that isn't linked to a database,
> as no data is saved in the database. But I want it to upload the file.
> However, I noticed that it's upload file portion is called with a
> beforeSave callback. But I can't call a save function in my controller
> because I'm not saving any data and have no table to save to.
>
> So, I am stuck here trying to puzzle out how to upload this file
> without calling the save method. I did notice in the code for
> MeioUpload that it has a function called upload that in the comments
> is used for "performing a manual upload". I figure that must be what I
> want to use, but I am unaware how to call a function in a behavior
> either from my model or from my controller.
>
> Just wondering if anyone is able to help me out with this. Thanks in
> advance.

You can call a Behavior's methods as if they belonged to the model.
I've never used this MeioUpload so I can't say what you should do, but
I can recommend Nick Baker's FileUpload plugin. It does what you want.
http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Why some classes starts with Cake, others not?

2011-02-01 Thread euromark
its easier to extend them if you ever need a custom class

Route extends CakeRoute etc
would not be possible with "Route" right away

but - in those cases you could then use
AppRoute extends Route

so in the end it probably doesnt matter :)

but since it is part of the core, why not declaring its belonging?
Same thing with other frameworks like "Zend_xyz" or whatever

well, just my 5 cents tonight


On 1 Feb., 22:05, Tilen Majerle  wrote:
> probably because of copyrights toowho knows...
>
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/2/1 red 
>
>
>
>
>
>
>
> > Hello,
> > question of curiosity - why some class names in CakePHP starts with
> > Cake* prefix, but majority not?
>
> > Is the only reason the collision of names with generally used classes
> > in PHP (eg. Session => CakeSession or Log => CakeLog)? If yes, why
> > there is more like CakeRoute or now in developed CakePHP 2.0 - eg.
> > CakeRequest or CakeResponse which would not have a name collision?
>
> > Regards.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Internationlization Doesn't Seem to Work.

2011-02-01 Thread euromark
where did you get that it's "ger" and not "deu"?


On 2 Feb., 00:52, Salines  wrote:
> Do you have other files in the app/locale/ger/LC_MESSAGES/ ??
>
> On 1 velj, 01:21, andrewperk  wrote:
>
>
>
>
>
>
>
> > Hello, I'm trying to get my application to use a different language
> > using cake's i18n. I believe I have my application set up properly.
>
> > core.php
> > Configure::write('Config.language', 'ger');
>
> > Posts Controller Flash message:
> > $this->Session->setFlash(__('You must be registered before you can ask
> > a question.', true), 'error');
>
> > app/locale/ger/LC_MESSAGES/default.po   (created using i18n console
> > then poedit)
> > The translation should be:
> > Sie müssen registriert sein, bevor Sie eine Frage kann fragen.
>
> > But my application is not using the translated version from my .po
> > file. Its still using the english version.
>
> > Am I missing something here? Thanks for any help.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-01 Thread Louie Miranda
I think, 100,000 users is small.
--
Louie Miranda



On Wed, Feb 2, 2011 at 8:26 AM, Larry E. Masters  wrote:

> CakePHP can do it. No other opinion needed.
>
> --
> Larry E. Masters
>
>
> On Tue, Feb 1, 2011 at 5:45 PM, Salines  wrote:
>
>> Hi,
>>
>> My next project requires the following:
>>
>> Social networking
>> l10n / i18n
>> 60 or more tables in the database
>> many tables have multiple associations
>> user has many associations
>> track user activity
>> user has a daily statistics (hits user page, ..)
>> RBAC / ACL, user privileges: Guest, registered, premium, translator,
>> moderator, admin, ..
>> pay per sms, credit card payment gateway
>> SLUG
>> etc
>>
>> We want to build a system for potential 100,000 users of our services
>> in the first year.
>> Content on the site will attract a large number of hits.
>>
>> For future growth:
>> db prepared for load balancing
>> separate servers for images and video etc
>> Nginx server for application, etc
>>
>> I want to hear your views, articles on the net does not provide enough
>> information, most of them old, others suggest other frameworks,
>>
>> http://www.google.com/search?q=php+frameworks+large+scale
>>
>> Thanks
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php
>>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Does the CakePHP ready for 'Large Scale' web applications?

2011-02-01 Thread Larry E. Masters
CakePHP can do it. No other opinion needed.

-- 
Larry E. Masters


On Tue, Feb 1, 2011 at 5:45 PM, Salines  wrote:

> Hi,
>
> My next project requires the following:
>
> Social networking
> l10n / i18n
> 60 or more tables in the database
> many tables have multiple associations
> user has many associations
> track user activity
> user has a daily statistics (hits user page, ..)
> RBAC / ACL, user privileges: Guest, registered, premium, translator,
> moderator, admin, ..
> pay per sms, credit card payment gateway
> SLUG
> etc
>
> We want to build a system for potential 100,000 users of our services
> in the first year.
> Content on the site will attract a large number of hits.
>
> For future growth:
> db prepared for load balancing
> separate servers for images and video etc
> Nginx server for application, etc
>
> I want to hear your views, articles on the net does not provide enough
> information, most of them old, others suggest other frameworks,
>
> http://www.google.com/search?q=php+frameworks+large+scale
>
> Thanks
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Internationlization Doesn't Seem to Work.

2011-02-01 Thread Salines
Do you have other files in the app/locale/ger/LC_MESSAGES/ ??


On 1 velj, 01:21, andrewperk  wrote:
> Hello, I'm trying to get my application to use a different language
> using cake's i18n. I believe I have my application set up properly.
>
> core.php
> Configure::write('Config.language', 'ger');
>
> Posts Controller Flash message:
> $this->Session->setFlash(__('You must be registered before you can ask
> a question.', true), 'error');
>
> app/locale/ger/LC_MESSAGES/default.po   (created using i18n console
> then poedit)
> The translation should be:
> Sie müssen registriert sein, bevor Sie eine Frage kann fragen.
>
> But my application is not using the translated version from my .po
> file. Its still using the english version.
>
> Am I missing something here? Thanks for any help.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Does the CakePHP ready for 'Large Scale' web applications?

2011-02-01 Thread Salines
Hi,

My next project requires the following:

Social networking
l10n / i18n
60 or more tables in the database
many tables have multiple associations
user has many associations
track user activity
user has a daily statistics (hits user page, ..)
RBAC / ACL, user privileges: Guest, registered, premium, translator,
moderator, admin, ..
pay per sms, credit card payment gateway
SLUG
etc

We want to build a system for potential 100,000 users of our services
in the first year.
Content on the site will attract a large number of hits.

For future growth:
db prepared for load balancing
separate servers for images and video etc
Nginx server for application, etc

I want to hear your views, articles on the net does not provide enough
information, most of them old, others suggest other frameworks,

http://www.google.com/search?q=php+frameworks+large+scale

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Problem in simple file upload

2011-02-01 Thread newguy
 I checked the _mime types but couldnt find a error in there, am stuck
guys please suggest something.

On Feb 1, 2:50 pm, Stephen  wrote:
> Nope, you called the field "aiman". So when checking for the file, check the
> field named "aiman" for example $this->data['Model']['aiman']['tmp_name']
>
> On 1 February 2011 22:43, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > Stephen one simple question, this line in upload.cpt
> >     echo $form->input('aiman', array('type' => 'file'));
> > means that I can upload only file named aiman??
>
> > On Feb 1, 2:17 pm, Stephen  wrote:
> > > This error tells me that your form is successfully reaching the correct
> > > action "upload".
>
> > > Check that $this->__mimeTypes is valid, it sounds like it isn't. The
> > syntax
> > > is correct enough.
>
> > > On 1 February 2011 21:55, newguy  wrote:
>
> > > > I tried that, this time no call was made to add action but I got this
> > > > warning:
>
> > > > Invalid argument supplied for foreach() [APP/plugins/uploader/
> > > > controllers/components/uploader.php, line 1084]
>
> > > > This is the foreach in which warning is coming:
> > > >  foreach ($this->__mimeTypes as $grouping => $mimes) {
> > > >            if (isset($mimes[$this->__data[$this->__current]['ext']]))
> > > > {
> > > >                $validExt = true;
> > > >            }
>
> > > > also I could not find the file uploaded in tmp folder under app.
>
> > > > On Feb 1, 1:44 pm, Stephen  wrote:
> > > > > Try
>
> > > > > create('User',array('action' => 'upload',
> > > > > 'type'=>'file')); ?> ?
>
> > > > > On 1 February 2011 21:41, newguy  wrote:
>
> > > > > > Hi I am following this uploader plugin to implement simple file
> > upload
> > > > > > on my site:
>
> > > > > >http://www.milesj.me/resources/script/uploader-plugin
>
> > > > > > but the problem is that when I press the upload button call to a
> > > > > > unknown action add is made, I dont have any action by the name of
> > add,
> > > > > > here is my code:
>
> > > > > > After log in user is directed to index.cpt which has the option to
> > > > > > upload score:
>
> > > > > > /
> > > > > > index.cpt
> > > > > > 
> > > > > > Hello,  > $user['last_name']); ?
> > > > > > >
> > > > > > Welcome to Game Web Site
> > > > > > 
> > > > > >  > $html->link('Downloads',array('action'=>'downloads')); ?
> > > > > > >
> > > > > > link('Upload
> > Score',array('action'=>'upload')); ?
> > > > > > >
> > > > > > link('logout', array('action' => 'logout'));
> > ?> > > > > > li>
> > > > > > 
>
> > > > > > On clicking Upload score link upload action is called
>
> > > > > > 
> > > > > > upload.cpt
> > > > > > //
>
> > > > > >  > > > > >    echo $form->create('User',array('type'=>'file'));
> > > > > >    //echo $form->file('File');
> > > > > >    echo $form->input('aiman', array('type' => 'file'));
>
> > > > > >    //echo $form->submit('Upload');
> > > > > >    echo $form->end('Upload2');
> > > > > > ?>
>
> > > > > > now when I press upload2 button I get the following error:
> > > > > > 
> > > > > > Missing Method in UsersController
> > > > > > Error: The action add is not defined in controller UsersController
>
> > > > > > Error: Create UsersController::add() in file: app/controllers/
> > > > > > users_controller.php.
>
> > > > > >  > > > > > class UsersController extends AppController {
>
> > > > > >        var $name = 'Users';
>
> > > > > >        function add() {
>
> > > > > >        }
>
> > > > > > }
> > > > > > ?>
> > > > > > ///
>
> > > > > > Here is my controller:
>
> > > > > > 
> > > > > > class UsersController extends AppController
> > > > > > {
> > > > > >    var $name = 'Users';
> > > > > >    var $helpers = array('Html', 'Form');
> > > > > >    var $components = array('Uploader.Uploader');
>
> > > > > >    function register()
> > > > > >    {
> > > > > >                if (!empty($this->data))
> > > > > >                {
> > > > > >                        $this->data['User']['password'] =
> > > > > > md5($this->data['User']
> > > > > > ['password']);
> > > > > >                        if ($this->User->save($this->data))
> > > > > >                                {
>
> >  $this->Session->setFlash('Your
> > > > > > registration information was
> > > > > > accepted');
>
> >  $this->Session->write('user',
> > > > > > $this->data['User']['username']);
>
> >  $this->redirect(array('action'
> > > > =>
> > > > > > 'index'), null, true);
> > > > > >                                }
> > > > > >                        else {
>
> >  $this->data['User']['password']
> > > > =
> > > > > > '';
>
> >  $this->Session->setFlash('There
> > > > was
> > > > > > a problem saving this
> > > > > > information');
> > > > > >                                 }
> > > > > >                }
> > > > > >    }
>
> > > > > >   function login()
> > > > > >    {
> > > > > >                if ($this->data)
> > > > > >                {
> >

Re: Problem in simple file upload

2011-02-01 Thread Stephen
Nope, you called the field "aiman". So when checking for the file, check the
field named "aiman" for example $this->data['Model']['aiman']['tmp_name']

On 1 February 2011 22:43, newguy  wrote:

> Stephen one simple question, this line in upload.cpt
> echo $form->input('aiman', array('type' => 'file'));
> means that I can upload only file named aiman??
>
>
> On Feb 1, 2:17 pm, Stephen  wrote:
> > This error tells me that your form is successfully reaching the correct
> > action "upload".
> >
> > Check that $this->__mimeTypes is valid, it sounds like it isn't. The
> syntax
> > is correct enough.
> >
> > On 1 February 2011 21:55, newguy  wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > I tried that, this time no call was made to add action but I got this
> > > warning:
> >
> > > Invalid argument supplied for foreach() [APP/plugins/uploader/
> > > controllers/components/uploader.php, line 1084]
> >
> > > This is the foreach in which warning is coming:
> > >  foreach ($this->__mimeTypes as $grouping => $mimes) {
> > >if (isset($mimes[$this->__data[$this->__current]['ext']]))
> > > {
> > >$validExt = true;
> > >}
> >
> > > also I could not find the file uploaded in tmp folder under app.
> >
> > > On Feb 1, 1:44 pm, Stephen  wrote:
> > > > Try
> >
> > > > create('User',array('action' => 'upload',
> > > > 'type'=>'file')); ?> ?
> >
> > > > On 1 February 2011 21:41, newguy  wrote:
> >
> > > > > Hi I am following this uploader plugin to implement simple file
> upload
> > > > > on my site:
> >
> > > > >http://www.milesj.me/resources/script/uploader-plugin
> >
> > > > > but the problem is that when I press the upload button call to a
> > > > > unknown action add is made, I dont have any action by the name of
> add,
> > > > > here is my code:
> >
> > > > > After log in user is directed to index.cpt which has the option to
> > > > > upload score:
> >
> > > > > /
> > > > > index.cpt
> > > > > 
> > > > > Hello,  $user['last_name']); ?
> > > > > >
> > > > > Welcome to Game Web Site
> > > > > 
> > > > >  $html->link('Downloads',array('action'=>'downloads')); ?
> > > > > >
> > > > > link('Upload
> Score',array('action'=>'upload')); ?
> > > > > >
> > > > > link('logout', array('action' => 'logout'));
> ?> > > > > li>
> > > > > 
> >
> > > > > On clicking Upload score link upload action is called
> >
> > > > > 
> > > > > upload.cpt
> > > > > //
> >
> > > > >  > > > >echo $form->create('User',array('type'=>'file'));
> > > > >//echo $form->file('File');
> > > > >echo $form->input('aiman', array('type' => 'file'));
> >
> > > > >//echo $form->submit('Upload');
> > > > >echo $form->end('Upload2');
> > > > > ?>
> >
> > > > > now when I press upload2 button I get the following error:
> > > > > 
> > > > > Missing Method in UsersController
> > > > > Error: The action add is not defined in controller UsersController
> >
> > > > > Error: Create UsersController::add() in file: app/controllers/
> > > > > users_controller.php.
> >
> > > > >  > > > > class UsersController extends AppController {
> >
> > > > >var $name = 'Users';
> >
> > > > >function add() {
> >
> > > > >}
> >
> > > > > }
> > > > > ?>
> > > > > ///
> >
> > > > > Here is my controller:
> >
> > > > >  >
> > > > > class UsersController extends AppController
> > > > > {
> > > > >var $name = 'Users';
> > > > >var $helpers = array('Html', 'Form');
> > > > >var $components = array('Uploader.Uploader');
> >
> > > > >function register()
> > > > >{
> > > > >if (!empty($this->data))
> > > > >{
> > > > >$this->data['User']['password'] =
> > > > > md5($this->data['User']
> > > > > ['password']);
> > > > >if ($this->User->save($this->data))
> > > > >{
> > > > >
>  $this->Session->setFlash('Your
> > > > > registration information was
> > > > > accepted');
> > > > >
>  $this->Session->write('user',
> > > > > $this->data['User']['username']);
> >
> > > > >
>  $this->redirect(array('action'
> > > =>
> > > > > 'index'), null, true);
> > > > >}
> > > > >else {
> > > > >
>  $this->data['User']['password']
> > > =
> > > > > '';
> > > > >
>  $this->Session->setFlash('There
> > > was
> > > > > a problem saving this
> > > > > information');
> > > > > }
> > > > >}
> > > > >}
> >
> > > > >   function login()
> > > > >{
> > > > >if ($this->data)
> > > > >{
> > > > >$results =
> > > > > $this->User->findByUsername($this->data['User']
> > > > > ['username']);
> > > > >if ($results && $results['User']['password']
> ==
> > > > > md5($this-
> > > > > >data['User']   ['passwo

Re: Problem in simple file upload

2011-02-01 Thread newguy
Stephen one simple question, this line in upload.cpt
echo $form->input('aiman', array('type' => 'file'));
means that I can upload only file named aiman??


On Feb 1, 2:17 pm, Stephen  wrote:
> This error tells me that your form is successfully reaching the correct
> action "upload".
>
> Check that $this->__mimeTypes is valid, it sounds like it isn't. The syntax
> is correct enough.
>
> On 1 February 2011 21:55, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > I tried that, this time no call was made to add action but I got this
> > warning:
>
> > Invalid argument supplied for foreach() [APP/plugins/uploader/
> > controllers/components/uploader.php, line 1084]
>
> > This is the foreach in which warning is coming:
> >  foreach ($this->__mimeTypes as $grouping => $mimes) {
> >            if (isset($mimes[$this->__data[$this->__current]['ext']]))
> > {
> >                $validExt = true;
> >            }
>
> > also I could not find the file uploaded in tmp folder under app.
>
> > On Feb 1, 1:44 pm, Stephen  wrote:
> > > Try
>
> > > create('User',array('action' => 'upload',
> > > 'type'=>'file')); ?> ?
>
> > > On 1 February 2011 21:41, newguy  wrote:
>
> > > > Hi I am following this uploader plugin to implement simple file upload
> > > > on my site:
>
> > > >http://www.milesj.me/resources/script/uploader-plugin
>
> > > > but the problem is that when I press the upload button call to a
> > > > unknown action add is made, I dont have any action by the name of add,
> > > > here is my code:
>
> > > > After log in user is directed to index.cpt which has the option to
> > > > upload score:
>
> > > > /
> > > > index.cpt
> > > > 
> > > > Hello,  > > > >
> > > > Welcome to Game Web Site
> > > > 
> > > > link('Downloads',array('action'=>'downloads')); ?
> > > > >
> > > > link('Upload Score',array('action'=>'upload')); ?
> > > > >
> > > > link('logout', array('action' => 'logout')); ?> > > > li>
> > > > 
>
> > > > On clicking Upload score link upload action is called
>
> > > > 
> > > > upload.cpt
> > > > //
>
> > > >  > > >    echo $form->create('User',array('type'=>'file'));
> > > >    //echo $form->file('File');
> > > >    echo $form->input('aiman', array('type' => 'file'));
>
> > > >    //echo $form->submit('Upload');
> > > >    echo $form->end('Upload2');
> > > > ?>
>
> > > > now when I press upload2 button I get the following error:
> > > > 
> > > > Missing Method in UsersController
> > > > Error: The action add is not defined in controller UsersController
>
> > > > Error: Create UsersController::add() in file: app/controllers/
> > > > users_controller.php.
>
> > > >  > > > class UsersController extends AppController {
>
> > > >        var $name = 'Users';
>
> > > >        function add() {
>
> > > >        }
>
> > > > }
> > > > ?>
> > > > ///
>
> > > > Here is my controller:
>
> > > > 
> > > > class UsersController extends AppController
> > > > {
> > > >    var $name = 'Users';
> > > >    var $helpers = array('Html', 'Form');
> > > >    var $components = array('Uploader.Uploader');
>
> > > >    function register()
> > > >    {
> > > >                if (!empty($this->data))
> > > >                {
> > > >                        $this->data['User']['password'] =
> > > > md5($this->data['User']
> > > > ['password']);
> > > >                        if ($this->User->save($this->data))
> > > >                                {
> > > >                                        $this->Session->setFlash('Your
> > > > registration information was
> > > > accepted');
> > > >                                        $this->Session->write('user',
> > > > $this->data['User']['username']);
>
> > > >                                        $this->redirect(array('action'
> > =>
> > > > 'index'), null, true);
> > > >                                }
> > > >                        else {
> > > >                                        $this->data['User']['password']
> > =
> > > > '';
> > > >                                        $this->Session->setFlash('There
> > was
> > > > a problem saving this
> > > > information');
> > > >                                 }
> > > >                }
> > > >    }
>
> > > >   function login()
> > > >    {
> > > >                if ($this->data)
> > > >                {
> > > >                        $results =
> > > > $this->User->findByUsername($this->data['User']
> > > > ['username']);
> > > >                        if ($results && $results['User']['password'] ==
> > > > md5($this-
> > > > >data['User']   ['password']))
> > > >                                {
> > > >                                        $this->Session->write('user',
> > > > $this->data['User']['username']);
> > > >                                        $this->redirect(array('action'
> > =>
> > > > 'upload'), null, true);
> > > >                                }
> > > >                        else {
> > > >     

Re: Problem in simple file upload

2011-02-01 Thread Stephen
This error tells me that your form is successfully reaching the correct
action "upload".

Check that $this->__mimeTypes is valid, it sounds like it isn't. The syntax
is correct enough.

On 1 February 2011 21:55, newguy  wrote:

> I tried that, this time no call was made to add action but I got this
> warning:
>
> Invalid argument supplied for foreach() [APP/plugins/uploader/
> controllers/components/uploader.php, line 1084]
>
> This is the foreach in which warning is coming:
>  foreach ($this->__mimeTypes as $grouping => $mimes) {
>if (isset($mimes[$this->__data[$this->__current]['ext']]))
> {
>$validExt = true;
>}
>
> also I could not find the file uploaded in tmp folder under app.
>
>
> On Feb 1, 1:44 pm, Stephen  wrote:
> > Try
> >
> > create('User',array('action' => 'upload',
> > 'type'=>'file')); ?> ?
> >
> > On 1 February 2011 21:41, newguy  wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > Hi I am following this uploader plugin to implement simple file upload
> > > on my site:
> >
> > >http://www.milesj.me/resources/script/uploader-plugin
> >
> > > but the problem is that when I press the upload button call to a
> > > unknown action add is made, I dont have any action by the name of add,
> > > here is my code:
> >
> > > After log in user is directed to index.cpt which has the option to
> > > upload score:
> >
> > > /
> > > index.cpt
> > > 
> > > Hello,  > > >
> > > Welcome to Game Web Site
> > > 
> > > link('Downloads',array('action'=>'downloads')); ?
> > > >
> > > link('Upload Score',array('action'=>'upload')); ?
> > > >
> > > link('logout', array('action' => 'logout')); ?> > > li>
> > > 
> >
> > > On clicking Upload score link upload action is called
> >
> > > 
> > > upload.cpt
> > > //
> >
> > >  > >echo $form->create('User',array('type'=>'file'));
> > >//echo $form->file('File');
> > >echo $form->input('aiman', array('type' => 'file'));
> >
> > >//echo $form->submit('Upload');
> > >echo $form->end('Upload2');
> > > ?>
> >
> > > now when I press upload2 button I get the following error:
> > > 
> > > Missing Method in UsersController
> > > Error: The action add is not defined in controller UsersController
> >
> > > Error: Create UsersController::add() in file: app/controllers/
> > > users_controller.php.
> >
> > >  > > class UsersController extends AppController {
> >
> > >var $name = 'Users';
> >
> > >function add() {
> >
> > >}
> >
> > > }
> > > ?>
> > > ///
> >
> > > Here is my controller:
> >
> > >  >
> > > class UsersController extends AppController
> > > {
> > >var $name = 'Users';
> > >var $helpers = array('Html', 'Form');
> > >var $components = array('Uploader.Uploader');
> >
> > >function register()
> > >{
> > >if (!empty($this->data))
> > >{
> > >$this->data['User']['password'] =
> > > md5($this->data['User']
> > > ['password']);
> > >if ($this->User->save($this->data))
> > >{
> > >$this->Session->setFlash('Your
> > > registration information was
> > > accepted');
> > >$this->Session->write('user',
> > > $this->data['User']['username']);
> >
> > >$this->redirect(array('action'
> =>
> > > 'index'), null, true);
> > >}
> > >else {
> > >$this->data['User']['password']
> =
> > > '';
> > >$this->Session->setFlash('There
> was
> > > a problem saving this
> > > information');
> > > }
> > >}
> > >}
> >
> > >   function login()
> > >{
> > >if ($this->data)
> > >{
> > >$results =
> > > $this->User->findByUsername($this->data['User']
> > > ['username']);
> > >if ($results && $results['User']['password'] ==
> > > md5($this-
> > > >data['User']   ['password']))
> > >{
> > >$this->Session->write('user',
> > > $this->data['User']['username']);
> > >$this->redirect(array('action'
> =>
> > > 'upload'), null, true);
> > >}
> > >else {
> > >$this->set('error', true);
> > > }
> > >}
> > >}
> >
> > >   function logout()
> > >{
> > >$this->Session->delete('user');
> > >$this->redirect(array('action' => 'login'), null, true);
> > >}
> >
> > >function index()
> > >{
> > >$

Re: Problem in simple file upload

2011-02-01 Thread newguy
I tried that, this time no call was made to add action but I got this
warning:

Invalid argument supplied for foreach() [APP/plugins/uploader/
controllers/components/uploader.php, line 1084]

This is the foreach in which warning is coming:
 foreach ($this->__mimeTypes as $grouping => $mimes) {
if (isset($mimes[$this->__data[$this->__current]['ext']]))
{
$validExt = true;
}

also I could not find the file uploaded in tmp folder under app.


On Feb 1, 1:44 pm, Stephen  wrote:
> Try
>
> create('User',array('action' => 'upload',
> 'type'=>'file')); ?> ?
>
> On 1 February 2011 21:41, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > Hi I am following this uploader plugin to implement simple file upload
> > on my site:
>
> >http://www.milesj.me/resources/script/uploader-plugin
>
> > but the problem is that when I press the upload button call to a
> > unknown action add is made, I dont have any action by the name of add,
> > here is my code:
>
> > After log in user is directed to index.cpt which has the option to
> > upload score:
>
> > /
> > index.cpt
> > 
> > Hello,  > >
> > Welcome to Game Web Site
> > 
> > link('Downloads',array('action'=>'downloads')); ?
> > >
> > link('Upload Score',array('action'=>'upload')); ?
> > >
> > link('logout', array('action' => 'logout')); ?> > li>
> > 
>
> > On clicking Upload score link upload action is called
>
> > 
> > upload.cpt
> > //
>
> >  >    echo $form->create('User',array('type'=>'file'));
> >    //echo $form->file('File');
> >    echo $form->input('aiman', array('type' => 'file'));
>
> >    //echo $form->submit('Upload');
> >    echo $form->end('Upload2');
> > ?>
>
> > now when I press upload2 button I get the following error:
> > 
> > Missing Method in UsersController
> > Error: The action add is not defined in controller UsersController
>
> > Error: Create UsersController::add() in file: app/controllers/
> > users_controller.php.
>
> >  > class UsersController extends AppController {
>
> >        var $name = 'Users';
>
> >        function add() {
>
> >        }
>
> > }
> > ?>
> > ///
>
> > Here is my controller:
>
> > 
> > class UsersController extends AppController
> > {
> >    var $name = 'Users';
> >    var $helpers = array('Html', 'Form');
> >    var $components = array('Uploader.Uploader');
>
> >    function register()
> >    {
> >                if (!empty($this->data))
> >                {
> >                        $this->data['User']['password'] =
> > md5($this->data['User']
> > ['password']);
> >                        if ($this->User->save($this->data))
> >                                {
> >                                        $this->Session->setFlash('Your
> > registration information was
> > accepted');
> >                                        $this->Session->write('user',
> > $this->data['User']['username']);
>
> >                                        $this->redirect(array('action' =>
> > 'index'), null, true);
> >                                }
> >                        else {
> >                                        $this->data['User']['password'] =
> > '';
> >                                        $this->Session->setFlash('There was
> > a problem saving this
> > information');
> >                                 }
> >                }
> >    }
>
> >   function login()
> >    {
> >                if ($this->data)
> >                {
> >                        $results =
> > $this->User->findByUsername($this->data['User']
> > ['username']);
> >                        if ($results && $results['User']['password'] ==
> > md5($this-
> > >data['User']   ['password']))
> >                                {
> >                                        $this->Session->write('user',
> > $this->data['User']['username']);
> >                                        $this->redirect(array('action' =>
> > 'upload'), null, true);
> >                                }
> >                        else {
> >                                        $this->set('error', true);
> >                                 }
> >                }
> >    }
>
> >   function logout()
> >    {
> >                $this->Session->delete('user');
> >                $this->redirect(array('action' => 'login'), null, true);
> >    }
>
> >    function index()
> >    {
> >                $username = $this->Session->read('user');
> >                if ($username)
> >                {
> >                        $results = $this->User->findByUsername($username);
> >                        $this->set('user', $results['User']);
> >                }
> >                else {
> >                        $this->redirect(array('action' => 'login'), null,
> > true);
> >                         }
> >    }
>
> >    function downloads()
> >    {
> >    }
>
> >   function upload()
> >    {
>
> >                if (!empty($this->data))
> >           

Re: Problem in simple file upload

2011-02-01 Thread Stephen
Try

create('User',array('action' => 'upload',
'type'=>'file')); ?> ?

On 1 February 2011 21:41, newguy  wrote:

> Hi I am following this uploader plugin to implement simple file upload
> on my site:
>
> http://www.milesj.me/resources/script/uploader-plugin
>
> but the problem is that when I press the upload button call to a
> unknown action add is made, I dont have any action by the name of add,
> here is my code:
>
> After log in user is directed to index.cpt which has the option to
> upload score:
>
> /
> index.cpt
> 
> Hello,  >
> Welcome to Game Web Site
> 
> link('Downloads',array('action'=>'downloads')); ?
> >
> link('Upload Score',array('action'=>'upload')); ?
> >
> link('logout', array('action' => 'logout')); ?> li>
> 
>
> On clicking Upload score link upload action is called
>
> 
> upload.cpt
> //
>
> echo $form->create('User',array('type'=>'file'));
>//echo $form->file('File');
>echo $form->input('aiman', array('type' => 'file'));
>
>//echo $form->submit('Upload');
>echo $form->end('Upload2');
> ?>
>
> now when I press upload2 button I get the following error:
> 
> Missing Method in UsersController
> Error: The action add is not defined in controller UsersController
>
> Error: Create UsersController::add() in file: app/controllers/
> users_controller.php.
>
>  class UsersController extends AppController {
>
>var $name = 'Users';
>
>
>function add() {
>
>}
>
> }
> ?>
> ///
>
> Here is my controller:
>
> 
>
> class UsersController extends AppController
> {
>var $name = 'Users';
>var $helpers = array('Html', 'Form');
>var $components = array('Uploader.Uploader');
>
>function register()
>{
>if (!empty($this->data))
>{
>$this->data['User']['password'] =
> md5($this->data['User']
> ['password']);
>if ($this->User->save($this->data))
>{
>$this->Session->setFlash('Your
> registration information was
> accepted');
>$this->Session->write('user',
> $this->data['User']['username']);
>
>$this->redirect(array('action' =>
> 'index'), null, true);
>}
>else {
>$this->data['User']['password'] =
> '';
>$this->Session->setFlash('There was
> a problem saving this
> information');
> }
>}
>}
>
>
>
>   function login()
>{
>if ($this->data)
>{
>$results =
> $this->User->findByUsername($this->data['User']
> ['username']);
>if ($results && $results['User']['password'] ==
> md5($this-
> >data['User']   ['password']))
>{
>$this->Session->write('user',
> $this->data['User']['username']);
>$this->redirect(array('action' =>
> 'upload'), null, true);
>}
>else {
>$this->set('error', true);
> }
>}
>}
>
>
>
>   function logout()
>{
>$this->Session->delete('user');
>$this->redirect(array('action' => 'login'), null, true);
>}
>
>
>function index()
>{
>$username = $this->Session->read('user');
>if ($username)
>{
>$results = $this->User->findByUsername($username);
>$this->set('user', $results['User']);
>}
>else {
>$this->redirect(array('action' => 'login'), null,
> true);
> }
>}
>
>
>
>function downloads()
>{
>}
>
>
>
>   function upload()
>{
>
>if (!empty($this->data))
>  {
>if ($data = $this->Uploader->upload('nam'))
> {
>// nam is the file name
>//var_dump($this->data); print '';
>
>  $this->redirect(array('action'=>'login'),null,true);
>}
>  }
>
>}
>
> }
> ?>
>
>
> Please Help me to uplaod this file .
>
> Thanks
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>



-- 

Problem in simple file upload

2011-02-01 Thread newguy
Hi I am following this uploader plugin to implement simple file upload
on my site:

http://www.milesj.me/resources/script/uploader-plugin

but the problem is that when I press the upload button call to a
unknown action add is made, I dont have any action by the name of add,
here is my code:

After log in user is directed to index.cpt which has the option to
upload score:

/
index.cpt

Hello, 
Welcome to Game Web Site

link('Downloads',array('action'=>'downloads')); ?
>
link('Upload Score',array('action'=>'upload')); ?
>
link('logout', array('action' => 'logout')); ?>


On clicking Upload score link upload action is called


upload.cpt
//

create('User',array('type'=>'file'));
//echo $form->file('File');
echo $form->input('aiman', array('type' => 'file'));

//echo $form->submit('Upload');
echo $form->end('Upload2');
?>

now when I press upload2 button I get the following error:

Missing Method in UsersController
Error: The action add is not defined in controller UsersController

Error: Create UsersController::add() in file: app/controllers/
users_controller.php.


///

Here is my controller:

data))
{
$this->data['User']['password'] = 
md5($this->data['User']
['password']);
if ($this->User->save($this->data))
{
$this->Session->setFlash('Your 
registration information was
accepted');
$this->Session->write('user', 
$this->data['User']['username']);

$this->redirect(array('action' => 
'index'), null, true);
}
else {
$this->data['User']['password'] = '';
$this->Session->setFlash('There was a 
problem saving this
information');
 }
}
}



   function login()
{
if ($this->data)
{
$results = 
$this->User->findByUsername($this->data['User']
['username']);
if ($results && $results['User']['password'] == 
md5($this-
>data['User']   ['password']))
{
$this->Session->write('user', 
$this->data['User']['username']);
$this->redirect(array('action' => 
'upload'), null, true);
}
else {
$this->set('error', true);
 }
}
}



   function logout()
{
$this->Session->delete('user');
$this->redirect(array('action' => 'login'), null, true);
}


function index()
{
$username = $this->Session->read('user');
if ($username)
{
$results = $this->User->findByUsername($username);
$this->set('user', $results['User']);
}
else {
$this->redirect(array('action' => 'login'), null, true);
 }
}



function downloads()
{
}



   function upload()
{

if (!empty($this->data))
  {
if ($data = $this->Uploader->upload('nam'))
 {
// nam is the file name
//var_dump($this->data); print '';

$this->redirect(array('action'=>'login'),null,true);
}
  }

}

}
?>


Please Help me to uplaod this file .

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Why some classes starts with Cake, others not?

2011-02-01 Thread Tilen Majerle
probably because of copyrights toowho knows...


--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/2/1 red 

> Hello,
> question of curiosity - why some class names in CakePHP starts with
> Cake* prefix, but majority not?
>
> Is the only reason the collision of names with generally used classes
> in PHP (eg. Session => CakeSession or Log => CakeLog)? If yes, why
> there is more like CakeRoute or now in developed CakePHP 2.0 - eg.
> CakeRequest or CakeResponse which would not have a name collision?
>
> Regards.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Why some classes starts with Cake, others not?

2011-02-01 Thread red
Hello,
question of curiosity - why some class names in CakePHP starts with
Cake* prefix, but majority not?

Is the only reason the collision of names with generally used classes
in PHP (eg. Session => CakeSession or Log => CakeLog)? If yes, why
there is more like CakeRoute or now in developed CakePHP 2.0 - eg.
CakeRequest or CakeResponse which would not have a name collision?

Regards.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


RE: Has anyone used Geonames without webservice?

2011-02-01 Thread Dave Maharaj
If you have root access to your server it only takes 5 mins to download and
install the db, it's a monster in size but other than that no issues.

 

Basically all I want to do is have user enter "City: when registering. This
will load the correct State / Province / Area and Country automatically. I'm
forcing them to be honest. So they can't enter that they live in Los
Angeles, Alberta, Africa. ( a non existent place)

 

 

 

From: Shinya Koizumi [mailto:sh.koiz...@gmail.com] 
Sent: Monday, January 31, 2011 6:43 PM
To: cake-php@googlegroups.com
Subject: Re: Has anyone used Geonames without webservice?

 

I think it's difficult to download all the stuff in local and how do you
maintain?

I think google map api is your best choice. What you can do is save the
unique query( keyword and resolved lat,lon ) in database so that for popular
places you don't always have to go to  web service
.

On Mon, Jan 31, 2011 at 12:32 PM, Dave Maharaj  wrote:

Just wondering is anyone has used the geonames database with cake but with
own database, not thru webservices?

 

I know it's a monster database in size but I do not like the idea of using a
service that's not on my own server. If it goes down then it affects my site
so just curious if anyone has implemented it?

 

I have the db setup and basic model / controller to test out queries, but my
way takes much longer than the webservices version so just curious if anyone
has had any success?

 

Thanks,

 

Dave

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
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

 

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.
 
 
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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: SecondController extends FirstController extends AppController: not supported? --psybear

2011-02-01 Thread Jamie
Well, for better or for worse the core developers don't spend a ton of
time writing on this mailing list. I'd like to know the rationale
behind certain decisions too, but sometimes we just have to take a
hard look at the code ourselves. :)

If I had to guess about __mergeVars() in particular (after a cursory
read of the code), it's probably restricted to AppController and the
plugin app controller (if applicable) just to make controller loading
easier. Since you can't easily deduce the plugin a controller is in
just by looking at the name, that makes it harder to load the
controller on demand. For example, if you have
AdministratorsController in your 'admin' plugin that extends
PeopleController in your 'users' plugin, it's nearly impossible to
guess which plugin PeopleController is from. And if you don't know the
plugin you can't load the controller. I know that's a pretty bad
pratice (extending classes between plugins), but it's a possibility
nonetheless. Since __mergeVars() restricts itself to AppController and
the AppController for the current plugin, then there's no guess work
needed. And since extending controllers beyond the AppController
relationship isn't really in the docs and not the "official" way to do
things, there probably hasn't been much impetus to change the
behavior.

Again, just me throwing a guess out there, but it does make sense (I
think).

- Jamie

On Feb 1, 4:32 am, Joshua Muheim  wrote:
> Thanks, guys (especially to Tilen for his constructive feedback on my
> posting habits ;-) ).
>
> It seems to me I often run into limitations of CakePHP that I hope I
> can't be the only one who faced them yet and that there's a well known
> work-around already. In fact, I often seem to be the  only person who
> had the need for them yet, and that's sometimes a bit surprising to
> me, because I'm definitely not creating very high-end-featured
> websites with CakePHP yet, and in those cases I'm just interested in
> knowing the reason why those features aren't available in CakePHP (for
> which I'm sure there are diligent thoughts behind these decisions).
> I'm just the kind of person who's not satisfied with only the fact
> that something IS or ISN'T, but rather is interested in WHY IT IS or
> ISN'T.
>
> So to get back to my question I'd really like to know WHY
> __mergeVars() only supports "pseudo inheritance" from AppController
> and doesn't do it e.g. recursively through the whole inheritance-chain
> down to AppController. Maybe it's a performance issue? Maybe it's
> planned for a next release? Sadly the inline documentation of CakePHP
> codes isn't very exhaustive which is pitty because THERE's the place
> to put such "business decisions" when there's no other place for such
> informations (or maybe I haven't found this resource yet?).
>
> Anyway, no offense to anybody. I don't want to bother anyone or strain
> this mailing list, so if my questions really don't fit here I'm happy
> somebody's telling me this and I will think about what I could change
> in my habits so everybody is happy. I'm using forums and similar
> communities for quite a long time now, and I never had problems of any
> sort, but maybe things run a little different here. Thanks, Tilen, for
> subtly pointing me to this problem with your comment. ;-)
>
>
>
>
>
>
>
> On Tue, Feb 1, 2011 at 4:04 AM, Ryan Schmidt  
> wrote:
> > On Jan 31, 2011, at 08:24, psybear83 wrote:
>
> >> I'm refactoring an application with some controllers and wanted to
> >> "divide" them into a group X (that needs some components) and a group
> >> Y that needs some other components. My idea:
>
> >> class AppController {
> >>  var $components = array('Html', 'Form');
> >> }
>
> >> class XController extends AppController {
> >>  var $components = array('X1', 'X2');
> >> }
>
> >> class YController extends AppController {
> >>  var $components = array('Y1', 'Y2');
> >> }
>
> >> Now every other controller should inherit from XController or from
> >> YController like this:
>
> >> class SomeXController extends XController {
> >>  var $components = array('Bla');
> >> }
>
> >> I expected XController now to have loaded the following components:
> >> Html, Form, X1, X2, and Bla. But sadly it doesn't have all of them! It
> >> seems CakePHP doesn't allow controller inheritance over more than only
> >> 1 level. Is this true? Is there any known work-around?
>
> > From a purely PHP standpoint, your XController's var $components is 
> > overwriting your AppController's var $components, and so on. Not knowing 
> > about __mergeVars() which Jamie talked about, I'd have suggested you 
> > implement a constructor in each of your classes, which calls the parent 
> > constructor and then takes care of merging your newly-desired components 
> > into the existing components array. PHP has some array functions that 
> > should do the trick.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions siteh

Re: Select Box - Table or Tinyint?

2011-02-01 Thread Stephen
Just an update.

I implemented this method just now and it works a charm, the only thing I
need to comment on (because I'm fussy).

In my "create" action for the model related to these array_sources, I need
to load around 10 list select boxes.

In my controller this means having 10x $var = $this->Model->Model2->find()
lines, and then use $this->set(compact(...

I hate repetition, is there a better way to do this, or should I just accept
my data requires it?


-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


where would you put the container?

2011-02-01 Thread cake-learner
I want to set up a container so that i can save everything and access
through that class when getting session variables.

Page A
$appClass = new AppClass();
$appClass -> specific_value = 1000;
$this -> Session -> write( "appclass", appClass );

Page B
$appClass = $this -> Session -> read( "appclass", appClass );
echo $appClass -> specific_value;
echo $appClass -> other_value;

In other frameworks, they have a certain folder for autoload ( all
classes within that folder will be loaded automatically ) but i am not
sure if cakephp has one.
Or I could set up a single class and include it in that top of page

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Select Box - Table or Tinyint?

2011-02-01 Thread Stephen
 class Income extends AppModel {
>
> var $name = 'Income';
> var $useDbConfig = 'array_db';
>
> var $records = array(
> array('id' => 1, 'name' => 'Do not disclose'),
> array('id' => 2, 'name' => '£15,000 - £25,000'),
> array('id' => 3, 'name' => '£25,000 - £35,000'),
> );
>
> var $hasMany = array(
> 'OtherModel' => array(
> 'className' => 'OtherModel',
> 'foreignKey' => 'income_id',
> )
> );
> }
> ?>
>
>
This is exactly what I needed, I am glad to have discovered this gem, thanks
LipeDjow


Also Joshua, I agree that your idea is much more user friendly, thanks.


-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Strange names in cached views

2011-02-01 Thread faem...@gmail.com
Jeremy thanks a lot, I'll see that post and report here any result.

Israel

On 1 feb, 17:02, Jeremy Burns | Class Outfit
 wrote:
> This has come up before, but the answer is not obvious. Here's a stolen reply 
> from an earlier post:
>
> This is actually caused by a bug in the PCRE library on Centos / Red Hat. See 
> thishttp://blog.echothis.com/2011/01/27/fixing-cakephp-1-3s-cache-key-err...blog
>  post  for how to fix it.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 1 Feb 2011, at 15:58, faem...@gmail.com wrote:
>
> > Hi to all,
>
> > I've enabled cache in all actions of one controller and it works right
> > in the developer server (local). But in production (MediaTemple) the
> > filename of cache files generated always is strange, like kt_u_o_.php
> > and because of it sometimes some pages don't show it right.
>
> > I have the same problem like:
> >http://groups.google.com/group/cake-php/browse_thread/thread/9ccd140d...
>
> > I have the same version of CakePHP (1.3.7) in both servers.
> > Local server (Ubuntu 10.10, PHP 5.2.15
> > Production server (CentOS 4, PHP 5.2.6
>
> > Anyone known something about that?
>
> > Thanks for advance.
>
> > Israel
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Select Box - Table or Tinyint?

2011-02-01 Thread Joshua Muheim
Maybe this is even better:

Up to 25'000
Up to 35'000

... :-)

On Tue, Feb 1, 2011 at 5:37 PM, Joshua Muheim  wrote:
> Off-topic, but maybe important once in a while: you should provide
> disjunctive options in a selectbox:
>
> 15'000 - 24'999
> 25'000 - 34'999
>
> etc. More user friendly could be:
>
> < 25'000
> < 35'000
>
> ...or something like that. :-)
>
> On Tue, Feb 1, 2011 at 5:19 PM, LipeDjow  wrote:
>> The same way if you were using a database, but the records remaing in the
>> model.
>> Ex.:
>> -- database.php
>> 
>> var $array_db = array('datasource' => 'ArraySource');
>> 
>> -- income.php
>> > class Income extends AppModel {
>>     var $name = 'Income';
>>     var $useDbConfig = 'array_db';
>>     var $records = array(
>>         array('id' => 1, 'name' => 'Do not disclose'),
>>         array('id' => 2, 'name' => '£15,000 - £25,000'),
>>         array('id' => 3, 'name' => '£25,000 - £35,000'),
>>     );
>>     var $hasMany = array(
>>         'OtherModel' => array(
>>             'className' => 'OtherModel',
>>             'foreignKey' => 'income_id',
>>         )
>>     );
>> }
>> ?>
>> Then you can use Income model as usual.
>> $this->OtherModel->Income->find('list');
>> or, save/find the relation in the database (you may need to create the
>> income_id field manually).
>> I'm sorry if this is not what you were looking for, I may not have
>> understood your question. =)
>> best regards,
>> LipeDjow
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> 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
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Select Box - Table or Tinyint?

2011-02-01 Thread Joshua Muheim
Off-topic, but maybe important once in a while: you should provide
disjunctive options in a selectbox:

15'000 - 24'999
25'000 - 34'999

etc. More user friendly could be:

< 25'000
< 35'000

...or something like that. :-)

On Tue, Feb 1, 2011 at 5:19 PM, LipeDjow  wrote:
> The same way if you were using a database, but the records remaing in the
> model.
> Ex.:
> -- database.php
> 
> var $array_db = array('datasource' => 'ArraySource');
> 
> -- income.php
>  class Income extends AppModel {
>     var $name = 'Income';
>     var $useDbConfig = 'array_db';
>     var $records = array(
>         array('id' => 1, 'name' => 'Do not disclose'),
>         array('id' => 2, 'name' => '£15,000 - £25,000'),
>         array('id' => 3, 'name' => '£25,000 - £35,000'),
>     );
>     var $hasMany = array(
>         'OtherModel' => array(
>             'className' => 'OtherModel',
>             'foreignKey' => 'income_id',
>         )
>     );
> }
> ?>
> Then you can use Income model as usual.
> $this->OtherModel->Income->find('list');
> or, save/find the relation in the database (you may need to create the
> income_id field manually).
> I'm sorry if this is not what you were looking for, I may not have
> understood your question. =)
> best regards,
> LipeDjow
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Select Box - Table or Tinyint?

2011-02-01 Thread LipeDjow
The same way if you were using a database, but the records remaing in the 
model.

Ex.:

-- database.php

var $array_db = array('datasource' => 'ArraySource');


-- income.php
 1, 'name' => 'Do not disclose'),
array('id' => 2, 'name' => '£15,000 - £25,000'),
array('id' => 3, 'name' => '£25,000 - £35,000'),
);

var $hasMany = array(
'OtherModel' => array(
'className' => 'OtherModel',
'foreignKey' => 'income_id',
)
);
}
?>

Then you can use Income model as usual.
$this->OtherModel->Income->find('list');
or, save/find the relation in the database (you may need to create the 
income_id field manually).

I'm sorry if this is not what you were looking for, I may not have 
understood your question. =)

best regards,
LipeDjow

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Strange names in cached views

2011-02-01 Thread Jeremy Burns | Class Outfit
This has come up before, but the answer is not obvious. Here's a stolen reply 
from an earlier post:

This is actually caused by a bug in the PCRE library on Centos / Red Hat. See 
this 
http://blog.echothis.com/2011/01/27/fixing-cakephp-1-3s-cache-key-error-on-red-hat-and-centos/
 blog post  for how to fix it.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 1 Feb 2011, at 15:58, faem...@gmail.com wrote:

> Hi to all,
> 
> I've enabled cache in all actions of one controller and it works right
> in the developer server (local). But in production (MediaTemple) the
> filename of cache files generated always is strange, like kt_u_o_.php
> and because of it sometimes some pages don't show it right.
> 
> I have the same problem like:
> http://groups.google.com/group/cake-php/browse_thread/thread/9ccd140d82b56f5d/3a7b1d85549f4e22?lnk=gst&q=cache+names+file#3a7b1d85549f4e22
> 
> I have the same version of CakePHP (1.3.7) in both servers.
> Local server (Ubuntu 10.10, PHP 5.2.15
> Production server (CentOS 4, PHP 5.2.6
> 
> Anyone known something about that?
> 
> Thanks for advance.
> 
> Israel
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Strange names in cached views

2011-02-01 Thread faem...@gmail.com
Hi to all,

I've enabled cache in all actions of one controller and it works right
in the developer server (local). But in production (MediaTemple) the
filename of cache files generated always is strange, like kt_u_o_.php
and because of it sometimes some pages don't show it right.

I have the same problem like:
http://groups.google.com/group/cake-php/browse_thread/thread/9ccd140d82b56f5d/3a7b1d85549f4e22?lnk=gst&q=cache+names+file#3a7b1d85549f4e22

I have the same version of CakePHP (1.3.7) in both servers.
Local server (Ubuntu 10.10, PHP 5.2.15
Production server (CentOS 4, PHP 5.2.6

Anyone known something about that?

Thanks for advance.

Israel

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Allow empty selection for relationship id (NULL)

2011-02-01 Thread euromark
I agree that I once felt the same way
After a few months I came to a different point of view, though.

You totally misunderstood the message behind my article if you state
that i was arguing in your direction.
What I really meant was that the default templates are quite useless
for the final project. That you MUST create your own bake templates.
For a serious cake app there is no way around it.  Simply, because it
is not possible to cover all possible use cases, you must adjust it
yourself. And i gave some hints how to create the most powerful
templates covering a lot of use cases and automatically handling a lot
of stuff.
Of course I would love to have those in the default templates. But it
will never happen, because others have totally different ideas of how
the template should be "enhanced".
Thats way everybody creates his own :) and doesnt use the default
templates. This little bit of work should not hurt too much -
considering the beautiful results.

And no, the bake templates should NOT necessarily be as complex as
possible.
that would have to be the case if they could not be overridden. but
since they can, they don't have to be.
They must at least cover the basic aspects of usability and security.
Thats way I filed a ticket regarding the missing h() escaping which is
now in the core :)


you can certainly open a ticket for it. for selected boxes, it should
then append array("empty"=>true) in the options param.

I do see the advantage of it - most times the first record is selected
automatically which can be annoying (especially if there is no "empty"
value to switch back to).
So even with required select boxes the default value should be "empty"
instead of selecting the first one.

Since this is probably still controversial you should provide a
complete "patch" in order to get your ticket approved without lots of
debating.
but you would have my vote.

mark


On 1 Feb., 14:35, Ryan Schmidt  wrote:
> On Jan 24, 2011, at 17:37, euromark wrote:
>
> > On 25 Jan., 00:14, Ryan Schmidt wrote:
> >> Well, I don't want all belongsTo relations to allow NULL selections; 
> >> logically, I only want this allowed for those defined in the database as 
> >> allowing NULL values. So my question is how can I do that, and my second 
> >> question is why the default cake baking templates don't already do that.
>
> > debug your bake scripts variables - especially the content of the
> > schema
> > it might be in there somewhere if NULL is allowed or not
> > then you can easily change the default behavior
>
> Thanks for the suggestion. If I have a moment, maybe I'll see if I can find 
> that.
>
> > well, because its not that important - at least not for anybody
> > else :)
> > but as the core team would say: "feel free to provide a patch"
> > if you do that they might put it in. and you are happy.
>
> Believe me, I'm aware of how open-source projects work. I've worked with the 
> MacPorts project for many years, and wearing that hat, I have many times 
> encouraged people to supply patches for things. With CakePHP, however, I am a 
> beginner, do not have an understanding of how it all works under the hood, 
> and do not feel confident in my ability to craft major patches just yet. 
> Moreover, since CakePHP has been around for years, I would assume that all of 
> the basics have been long taken care of by the framework. So when something 
> that I consider basic (like this issue) does not appear to be taken care of, 
> I must necessarily come to this list first to ask why, since my first 
> assumption is that I have misunderstood something and that the feature I seek 
> does exist but I'm just doing it wrong. But in this case it sounds like it 
> really doesn't exist -- that "bake" really doesn't have this capability right 
> now.
>
> I reject entirely the notion that this issue is not important for anybody 
> else. Certainly you will grant that there are use cases for having a related 
> field where not all records have a related record. You need only consider a 
> previous example I gave, that of having a library tracking who has checked 
> out what book, using a books table that has a user_id column. Not every book 
> is checked out to a user; some are on a shelf in the library. These books 
> would have their user_id column set to NULL. If using a standard baked edit 
> view, I would certainly want the User drop-down menu to allow me to select 
> that this book is not checked out to anybody. Certainly you will acknowledge 
> that database engines like MySQL have been specifically designed with this 
> capability in mind.
>
> The purpose of "bake" is to get me up and running with my project as quickly 
> as possible. That does not mean "bake" should be as simple as possible; it 
> means "bake" should be as complex as possible, accommodating as many common 
> use cases as possible, so that I don't have to spend a lot of time fixing the 
> baked templates afterward. You yourself have argued for this in your blog 
> post 

Re: Allow empty selection for relationship id (NULL)

2011-02-01 Thread Ryan Schmidt
On Jan 24, 2011, at 17:37, euromark wrote:
> On 25 Jan., 00:14, Ryan Schmidt wrote:
>> Well, I don't want all belongsTo relations to allow NULL selections; 
>> logically, I only want this allowed for those defined in the database as 
>> allowing NULL values. So my question is how can I do that, and my second 
>> question is why the default cake baking templates don't already do that.
> 
> debug your bake scripts variables - especially the content of the
> schema
> it might be in there somewhere if NULL is allowed or not
> then you can easily change the default behavior

Thanks for the suggestion. If I have a moment, maybe I'll see if I can find 
that.


> well, because its not that important - at least not for anybody
> else :)
> but as the core team would say: "feel free to provide a patch"
> if you do that they might put it in. and you are happy.


Believe me, I'm aware of how open-source projects work. I've worked with the 
MacPorts project for many years, and wearing that hat, I have many times 
encouraged people to supply patches for things. With CakePHP, however, I am a 
beginner, do not have an understanding of how it all works under the hood, and 
do not feel confident in my ability to craft major patches just yet. Moreover, 
since CakePHP has been around for years, I would assume that all of the basics 
have been long taken care of by the framework. So when something that I 
consider basic (like this issue) does not appear to be taken care of, I must 
necessarily come to this list first to ask why, since my first assumption is 
that I have misunderstood something and that the feature I seek does exist but 
I'm just doing it wrong. But in this case it sounds like it really doesn't 
exist -- that "bake" really doesn't have this capability right now.

I reject entirely the notion that this issue is not important for anybody else. 
Certainly you will grant that there are use cases for having a related field 
where not all records have a related record. You need only consider a previous 
example I gave, that of having a library tracking who has checked out what 
book, using a books table that has a user_id column. Not every book is checked 
out to a user; some are on a shelf in the library. These books would have their 
user_id column set to NULL. If using a standard baked edit view, I would 
certainly want the User drop-down menu to allow me to select that this book is 
not checked out to anybody. Certainly you will acknowledge that database 
engines like MySQL have been specifically designed with this capability in mind.

The purpose of "bake" is to get me up and running with my project as quickly as 
possible. That does not mean "bake" should be as simple as possible; it means 
"bake" should be as complex as possible, accommodating as many common use cases 
as possible, so that I don't have to spend a lot of time fixing the baked 
templates afterward. You yourself have argued for this in your blog post about 
extending the bake templates so that they format different kinds of fields 
properly (date/time, Boolean):

http://www.dereuromark.de/2010/06/22/cake-bake-custom-templates/

Now I'm arguing for it with regard to properly representing select menus for 
related fields which could be NULL.

Is it appropriate for me to file a feature request in the CakePHP issue tracker 
at this point, or what would be the proper procedure to get this request 
considered?



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Thanks for your support

2011-02-01 Thread Joshua Muheim
Thanks for your support, Ryan. It's a relief to hear I'm not the only
one facing these unexpected challenges with CakePHP.

Let's see whether this discussion gives some enlightment... :-)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


some error with ARO/ACO ACL

2011-02-01 Thread hoss7
i use cakephp(v1.3.7) ACL i have this error:

Warning (512): DbAcl::check() - Failed ARO/ACO node lookup in
permissions check. Node references:
Aro: Array
(
[User] => Array
(
[id] => 1
[username] => root
[group_id] => 1
[created] => 2011-02-01 07:19:20
[modified] => 2011-02-01 07:50:36
)

)

Aco: Pages/display [CORE\cake\libs\controller\components\acl.php, line
273]
Code | Context


if (empty($aroPath) || empty($acoPath)) {
trigger_error(__("DbAcl::check() - Failed ARO/ACO node lookup in
permissions check. Node references:\nAro: ", true) . print_r($aro,
true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);

$aro = array(
"User" => array(
"id" => "1",
"username" => "root",
"group_id" => "1",
"created" => "2011-02-01 07:19:20",
"modified" => "2011-02-01 07:50:36"
)
)
$aco = "Pages/display"
$action = "*"
$permKeys = array(
"_create",
"_read",
"_update",
"_delete"
)
$aroPath = array(
array(
"Aro" => array()
),
array(
"Aro" => array()
)
)
$acoPath = false

DbAcl::check() - CORE\cake\libs\controller\components\acl.php, line
273
AclComponent::check() - CORE\cake\libs\controller\components\acl.php,
line 92
AuthComponent::isAuthorized() - CORE\cake\libs\controller\components
\auth.php, line 527
AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 445
Component::triggerCallback() - CORE\cake\libs\controller
\component.php, line 186
Controller::startupProcess() - CORE\cake\libs\controller
\controller.php, line 523
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 187
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83

Warning (2): Cannot modify header information - headers already sent
by (output started at D:\xampp\htdocs\cakeacl\cake\libs\debugger.php:
673) [CORE\cake\libs\controller\controller.php, line 742]
Code | Context

$status = "Location: http://localhost/cakeacl/users/login";

header - [internal], line ??
Controller::header() - CORE\cake\libs\controller\controller.php, line
742
Controller::redirect() - CORE\cake\libs\controller\controller.php,
line 721
AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 450
Component::triggerCallback() - CORE\cake\libs\controller
\component.php, line 186
Controller::startupProcess() - CORE\cake\libs\controller
\controller.php, line 523
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 187
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83

how can i fix it?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: SecondController extends FirstController extends AppController: not supported? --psybear

2011-02-01 Thread Ryan Schmidt

On Feb 1, 2011, at 06:32, Joshua Muheim wrote:

> It seems to me I often run into limitations of CakePHP that I hope I
> can't be the only one who faced them yet and that there's a well known
> work-around already. In fact, I often seem to be the  only person who
> had the need for them yet, and that's sometimes a bit surprising to
> me, because I'm definitely not creating very high-end-featured
> websites with CakePHP yet, and in those cases I'm just interested in
> knowing the reason why those features aren't available in CakePHP (for
> which I'm sure there are diligent thoughts behind these decisions).
> I'm just the kind of person who's not satisfied with only the fact
> that something IS or ISN'T, but rather is interested in WHY IT IS or
> ISN'T.

I am feeling EXACTLY the same way, e.g.

http://groups.google.com/group/cake-php/browse_thread/thread/23b3b42a7a0136e5/531acf9d5a4b47ad

http://groups.google.com/group/cake-php/browse_thread/thread/20bdc0529d6c971c/c9f0eebc681df81d

CakePHP is a mature well-regarded 5-year-old PHP framework; I'm a little 
surprised at the issues that I'm running into pretty much right away. I have to 
believe I can't be the only person running into these issues; what I'm doing 
(or wanting to do) seems completely common-sense to me, something anyone would 
try to do immediately upon starting to use the framework. Yet the responses I 
get seem to suggest that nobody else has ever wanted to do anything like that 
before. I continue to stick around and hopefully let the collective knowledge 
seep slowly into my brain and help me to see how to do things the right way, or 
at least the way the designers envisioned.




-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable Results

2011-02-01 Thread Name256
Thanks for your reply,

I have had a look at this and tried out a few options on how best to
implement pagination functionality using options and I came up with
something that works 99%. Because of the join that I am doing, It
means that in the event that I have a Transaction with more than one
TransactionDetail returned, an extra Transaction record is created.
Below is a snippet of the code;

$options['joins'] = array(
array(
'table' => 'transaction_detail',
'alias' => 'TransactionDetail',
'type' => 'LEFT',
'conditions' => array(
'Transaction.id =
TransactionDetail.transaction_id'
)
)
);
$options['conditions']=array(
'Transaction.matched'=>true,
'TransactionDetail.shop_id'=>$this->getUserShops()
);

$this->paginate = array(
'conditions'=>$options['conditions'],
'joins'=>$options['joins'],
'order'=>'Transaction.unix_time_stamp DESC',
 //Commented
'group'=>'TransactionDetail.transaction_id',
);

This code works as I have described above but with the group option
uncommented (returns the correct number of Transaction records),
pagination breaks once again and the pagination links are disabled. I
was wondering whether there is a way around this, maybe a custom way
of doing pagination where I can set variables such as number of
records because as much as there is a count query run to find the
number of records, this is not being passed to the pagination
function.

Kind regards.

On Feb 1, 2:57 pm, Jeremy Burns | Class Outfit
 wrote:
> This is (regrettably) how it is supposed to work as it is using outer joins. 
> To achieve what you want to do you need to use the 'joins' options, where you 
> can specify inner joins, which will filter your results 
> correctly.http://book.cakephp.org/view/1047/Joining-tables
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 1 Feb 2011, at 11:18, Name256 wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I have been trying out the containable behaviour and it seems that the
> > applied filter on "contained" models only apply to them and not the
> > parent model.
>
> > For example I have a model Transaction and TransactionDetail where
> > Transaction hasMany TransactionDetail. If I apply a condition on the
> > TransactionDetail, the result still returns all the transactions. I
> > did an override of the afterFind method to further filter the data but
> > it ended up breaking pagination in the view.
>
> > I have had a look at the many posts where containable has been
> > discussed but I'm at a loss as to whether there is another way of
> > retrieving paginated data with all conditions applying for all models
> > present.
>
> > Kindly assist.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: SecondController extends FirstController extends AppController: not supported? --psybear

2011-02-01 Thread Joshua Muheim
Thanks, guys (especially to Tilen for his constructive feedback on my
posting habits ;-) ).

It seems to me I often run into limitations of CakePHP that I hope I
can't be the only one who faced them yet and that there's a well known
work-around already. In fact, I often seem to be the  only person who
had the need for them yet, and that's sometimes a bit surprising to
me, because I'm definitely not creating very high-end-featured
websites with CakePHP yet, and in those cases I'm just interested in
knowing the reason why those features aren't available in CakePHP (for
which I'm sure there are diligent thoughts behind these decisions).
I'm just the kind of person who's not satisfied with only the fact
that something IS or ISN'T, but rather is interested in WHY IT IS or
ISN'T.

So to get back to my question I'd really like to know WHY
__mergeVars() only supports "pseudo inheritance" from AppController
and doesn't do it e.g. recursively through the whole inheritance-chain
down to AppController. Maybe it's a performance issue? Maybe it's
planned for a next release? Sadly the inline documentation of CakePHP
codes isn't very exhaustive which is pitty because THERE's the place
to put such "business decisions" when there's no other place for such
informations (or maybe I haven't found this resource yet?).

Anyway, no offense to anybody. I don't want to bother anyone or strain
this mailing list, so if my questions really don't fit here I'm happy
somebody's telling me this and I will think about what I could change
in my habits so everybody is happy. I'm using forums and similar
communities for quite a long time now, and I never had problems of any
sort, but maybe things run a little different here. Thanks, Tilen, for
subtly pointing me to this problem with your comment. ;-)

On Tue, Feb 1, 2011 at 4:04 AM, Ryan Schmidt  wrote:
> On Jan 31, 2011, at 08:24, psybear83 wrote:
>
>> I'm refactoring an application with some controllers and wanted to
>> "divide" them into a group X (that needs some components) and a group
>> Y that needs some other components. My idea:
>>
>> class AppController {
>>  var $components = array('Html', 'Form');
>> }
>>
>> class XController extends AppController {
>>  var $components = array('X1', 'X2');
>> }
>>
>> class YController extends AppController {
>>  var $components = array('Y1', 'Y2');
>> }
>>
>> Now every other controller should inherit from XController or from
>> YController like this:
>>
>> class SomeXController extends XController {
>>  var $components = array('Bla');
>> }
>>
>> I expected XController now to have loaded the following components:
>> Html, Form, X1, X2, and Bla. But sadly it doesn't have all of them! It
>> seems CakePHP doesn't allow controller inheritance over more than only
>> 1 level. Is this true? Is there any known work-around?
>
> From a purely PHP standpoint, your XController's var $components is 
> overwriting your AppController's var $components, and so on. Not knowing 
> about __mergeVars() which Jamie talked about, I'd have suggested you 
> implement a constructor in each of your classes, which calls the parent 
> constructor and then takes care of merging your newly-desired components into 
> the existing components array. PHP has some array functions that should do 
> the trick.
>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Containable Results

2011-02-01 Thread Jeremy Burns | Class Outfit
This is (regrettably) how it is supposed to work as it is using outer joins. To 
achieve what you want to do you need to use the 'joins' options, where you can 
specify inner joins, which will filter your results correctly. 
http://book.cakephp.org/view/1047/Joining-tables

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 1 Feb 2011, at 11:18, Name256 wrote:

> Hello,
> 
> I have been trying out the containable behaviour and it seems that the
> applied filter on "contained" models only apply to them and not the
> parent model.
> 
> For example I have a model Transaction and TransactionDetail where
> Transaction hasMany TransactionDetail. If I apply a condition on the
> TransactionDetail, the result still returns all the transactions. I
> did an override of the afterFind method to further filter the data but
> it ended up breaking pagination in the view.
> 
> I have had a look at the many posts where containable has been
> discussed but I'm at a loss as to whether there is another way of
> retrieving paginated data with all conditions applying for all models
> present.
> 
> Kindly assist.
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> 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

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Containable Results

2011-02-01 Thread Name256
Hello,

I have been trying out the containable behaviour and it seems that the
applied filter on "contained" models only apply to them and not the
parent model.

For example I have a model Transaction and TransactionDetail where
Transaction hasMany TransactionDetail. If I apply a condition on the
TransactionDetail, the result still returns all the transactions. I
did an override of the afterFind method to further filter the data but
it ended up breaking pagination in the view.

I have had a look at the many posts where containable has been
discussed but I'm at a loss as to whether there is another way of
retrieving paginated data with all conditions applying for all models
present.

Kindly assist.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: $html->image no show

2011-02-01 Thread ugarch
Thank you all for your comments ... I had to start using host instead
of just the image name. Is not good! Does not make sense but nothing
is perfect.

Have a good baking,

A.

On Feb 1, 3:21 am, Sam Sherlock  wrote:
> I had cake working in a windwow 2k dir ages ago
> but twice on xp and currently windows 7 users dir cake
> just does not work for me
>
> when I nearly had it once paths to images would be tricky so
>
> sticking with vhosts :)
>
>  - S
>
> On 1 February 2011 02:11, cricket  wrote:
>
>
>
> > On Mon, Jan 31, 2011 at 8:23 PM, ugarch  wrote:
> > > Thank you very much for your response ... I liked the element idea but
> > > my problem is that sometimes in the banner div i need to place images
> > > and sometimes videos or a picture slider.
>
> > You could set a variable, eg. $banner_type, in the controller and
> > check that in the element.
>
> > > That is why I decided to set the $banner from the controller the way I
> > > did. But my problem is more related to paths and links because when I
> > > set $banner = $html->image('Foo.jpg'
> > > array('class'=>'banner','title'=>"Foo")); from the
> > > pages_controller.php it works fine. However when I set the $banner
> > > from the informations_controller.php the image does not shows up. I
> > > can see in the html source code the image but the path needs to be
> > > changed from 'img/Foo.jpg' to '../img/Foo.jpg' ... Do you have an
> > > idea, why do i need to change the image path to ../ so I can see the
> > > picture?
>
> > No, sorry. I know others have run into these problems before but I
> > never have and am unsure what the cause is.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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