Re: any way to omit app/webroot when request image file or directory inside it

2011-02-25 Thread Miles J
February 2011 16:40, mohammad Al-Ani alani.moham...@gmail.com wrote: thanks Miles J But on top of that, anyone can see that you are sing Cake by checking your form structure, or that you are using named params. I already get over that by using $this-params['form'] to get the data from

Re: any way to omit app/webroot when request image file or directory inside it

2011-02-24 Thread Miles J
You can try setting up some apache mod_rewrite rules. But on top of that, anyone can see that you are sing Cake by checking your form structure, or that you are using named params. On Feb 24, 9:52 am, mohammad Al-Ani alani.moham...@gmail.com wrote: hi all.. hope you do well I use cakephp

Re: file upload with miles johnsons upload plugin - without model

2011-02-24 Thread Miles J
Your form is posting to a completely different url. Try setting this: echo $form-create('Model', array('type' = 'file', 'url' = array('controller'='pages','action'='display', 'upload'))); On Feb 24, 9:05 am, soymartinus mschenk@gmail.com wrote: Hi i'm new to cakephp and can't get miles

Re: Benchmark

2011-02-23 Thread Miles J
There is a plugin called the DebugKit. It monitors benchmarks, SQL, variables, session, etc. https://github.com/cakephp/debug_kit On Feb 22, 11:36 pm, Chris DB cdbardemori...@gmail.com wrote: I am a new comer and fresh patissier for CakePHP. My Question: CakePHP use the concept of benchmarking

Re: cakephp Messaging sysytem

2011-02-23 Thread Miles J
This is the structure I have used in the past. id user_id - Sending recipient_id - Receiving status userFolder recipientFolder subject content created modified With the following enums (not mysql enums, but class integer/ constants). status = 0 unread, 1 read, 2 replied, 3 forwarded

Re: configuration values in database?

2011-02-20 Thread Miles J
I accomplished this using a model and the Configure class, like so: Configure::write('Forum.settings', ClassRegistry::init('Forum.Setting')-getSettings()); Place that in your bootstrap or AppController. The technique is being used in my 2.0 forum plugin.

Re: Same code in controller, model and view

2011-02-16 Thread Miles J
Or not use a helper, controller or behavior. Just because you are using Cake doesnt mean you have to ditch PHP conventions all together. Just create a static class, include it, and use it statically anywhere in your application. DateFormat::convert(); On Feb 16, 10:01 am, 100rk

Re: Loading components inside components and keeping the initialize() stack order

2011-02-16 Thread Miles J
Why don't you just place the specialMethod() code into initialize()? Since thats basically what you are trying to achieve. On Feb 16, 2:51 am, Pixelastic timcc.pe...@gmail.com wrote: Hello, I'm writing a MainComponent that will need a SecondaryComponent in order to correctly work. I want to

Re: Spot the difference

2011-02-16 Thread Miles J
Its because you are redirecting before setting the data. Try this, assuming you are using the Auth component. function login() { $this-set('error', false); if ($this-Auth-user()) { $this-Session-setFlash('You are logged in!');

Re: $this-Html vs $html

2011-02-15 Thread Miles J
It sounds as if 1.3 isn't really running. I would check your paths and everything to make sure they are correct and are in fact running 1.3. On Feb 15, 10:18 am, Tan Cheng davidtan...@gmail.com wrote: Hi everyone, I'm a newbie to cakePHP, a question I always have is in the tutorial in 1.3

Re: How to define a global constant which is available through whole app?

2011-02-15 Thread Miles J
Like AD7 said, you cant use functions on class properties. Do it in the constructor. On Feb 15, 3:36 pm, Alejandro Gómez Fernández agom...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Another way to do this is using session variables, in this case, a constant. You can

Re: Validate from the controller

2011-02-14 Thread Miles J
I believe you have to use saveAll() in this instance, validates() only supports 1 array dimension. On Feb 14, 9:23 am, Dee Johnson devario...@gmail.com wrote: I'm not 100% sure I understand what you are going for here, but if all you want to do is validate the input THEN save, which is what I

Re: reading new cake book is painful than the old one.

2011-02-13 Thread Miles J
There is a tree structure and search on the left sidebar. It requires JS enabled to work correctly. On Feb 13, 10:36 pm, andy_the ultimate baker anandghaywankar...@gmail.com wrote: hi, i am very sory to say that the new cake book is not helping as it was before, so many issues, its not even

Re: Global Variable

2011-02-09 Thread Miles J
You can use constants or the Configure class. Place the code within your bootstrap file and it should be available everywhere. On Feb 9, 6:50 pm, ShadowCross adri...@jps.net wrote: You can try adding it to your app_model: config/core.php: Configure::write('BRAND_NEW', '-24 hours');

Re: do I need $this-Auth-userModel = 'User'; in every controller beforefilter or not?

2011-02-09 Thread Miles J
Most of those settings are default, so now you do not have to add them as long as you follow conventions. For easier convenience, place in your AppController. However, you do need to allow() in every controllers beforeFilter(). On Feb 9, 12:03 pm, barricades davow...@googlemail.com wrote: I'm

Re: simple page request

2011-02-08 Thread Miles J
could using page request... On Feb 7, 9:54 pm, Miles J mileswjohn...@gmail.com wrote: Anything. On Feb 7, 5:16 pm, cricket zijn.digi...@gmail.com wrote: On Mon, Feb 7, 2011 at 12:23 AM, zer0_gravity zr...@hotmail.com wrote: Using the controller to do a simple page request that show

Re: simple page request

2011-02-07 Thread Miles J
Anything. On Feb 7, 5:16 pm, cricket zijn.digi...@gmail.com wrote: On Mon, Feb 7, 2011 at 12:23 AM, zer0_gravity zr...@hotmail.com wrote: Using the controller to do a simple page request that show the results from find()/read() after passing the $id of the record being queried , what else

Re: Users name / changes

2011-02-03 Thread Miles J
Let them allow changes. I hate Facebooks restriction on name changes. Why should the site owners dictate how a user wants to be known? On Feb 3, 12:14 pm, Ryan Schmidt google-2...@ryandesign.com wrote: On Feb 2, 2011, at 22:06, Jeremy Burns | Class Outfit wrote: I usually make a username an

Re: Cake loads FALSE values as (empty)

2011-02-02 Thread Miles J
Well, why are you even using 2.0? On Feb 2, 8:59 am, euromark dereurom...@googlemail.com wrote: nope, tilen its tinyint(1) !!! ideally unsigned (cant be negative anyway) thats what booleans are stored as tinyint(2) is for pseudo enum fields or small integer values On 2 Feb., 15:05, Tilen

Re: How much is too much?

2011-02-02 Thread Miles J
Just cache the result. Then each time you try to access the data, it grabs from the cache instead of the DB. On Feb 2, 7:41 am, Ed Propsner crotchf...@gmail.com wrote: I'm working on part of my app where I'm harvesting a list of ID's from the db and passing the list to my view. It's a bit of

Re: Problem in simple file upload

2011-02-02 Thread Miles J
View the source of your HTML and make sure the form action is pointing to the right URL. Also what version of the Uploader are you using? You should download the latest version off of Github. Furthermore, your file type must be supported, if it is not, you have to add it to the mime types array.

Re: php statement as to appear replaced in views

2011-01-24 Thread Miles J
Your pages should be on different actions? /resume/add /resume/edit /resume/delete And within each of those you show the context specific links. On Jan 24, 11:10 am, chris...@yahoo.com chris...@yahoo.com wrote: Hi Sam, thanks for help... and how do I do that...? Here is another example,

Re: CakePHP 1.3.7 released

2011-01-20 Thread Miles J
Awesome, great work! I just realized I am on 1.3.4 still, time to upgrade, haha. On Jan 20, 8:12 am, mark_story mark.st...@gmail.com wrote: On Jan 20, 1:22 am, keymaster ad...@optionosophy.com wrote: Firstly, Mark - a tremendous thank you and feelings of admiration for your tremendous

Re: Server Preference?

2011-01-14 Thread Miles J
Nginx is fast in general, who ever said it was for static content? I use Nginx with memcache/apc and get a good 10k hits a day with no speed penalty. Want kind of traffic are you expecting where none of these would suffice? Even the largest of sites use apache. On Jan 14, 2:29 am, Dave Maharaj

Re: Fatal error: Allowed memory size of 134217728 bytes... When calling a simple static text element?

2011-01-13 Thread Miles J
I may be wrong, but it looked like an infinite loop? On Jan 13, 11:48 am, OldWest jason.wy...@gmail.com wrote: I've got this solved by changing the way I was calling in the element. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

Re: Opening controller data in new Window w/ ajax-link call

2011-01-12 Thread Miles J
I personally would just write the links yourself, instead of having to go through Cake. Manual links + event binds = better. On Jan 12, 11:56 am, OldWest jason.wy...@gmail.com wrote: I found a solution that works using Modalbox like: echo $html-link('Benefit Schedule',array('controller' =

Re: Convention: Underscore / Camelcase mixture?

2011-01-12 Thread Miles J
Fields don't have casing conventions that I am aware, the only caveat is that IDs/foreign keys must be underscore: user_id instead of userId. Agreed that underscore file names and tables are weird, I would much rather have them camel case. Especially seeing as how its a great standard to have

Re: Cake source code optimization

2011-01-11 Thread Miles J
The 2.0 branch wont be anytime soon. On Jan 11, 5:15 am, euromark dereurom...@googlemail.com wrote: there is none :) i already asked myself the same question we got to be patient (but since dev is already released in can only be a matter of a few months) On 11 Jan., 10:04, Adrian Arnautu

Re: php echo alternative/shorthand

2011-01-10 Thread Miles J
Dont use: ? Only use: ?php However, shorthand only works if its enabled in your ini settings and should rarely be used (templates are an exception): ?= On Jan 10, 3:45 am, euromark dereurom...@googlemail.com wrote: you should

Re: Explain the empty function

2011-01-07 Thread Miles J
Why are you attempting to do that? !empty() checks to make sure the POST data exists, empty() checks to make sure the POST data is empty. On Jan 7, 9:10 am, zer0_gravity zr...@hotmail.com wrote: function add(){         if(!empty($this-data)){   ///why does this statement works              

Re: Bootstrap access to a model?

2011-01-06 Thread Miles J
Why are you allowing users to define routes? On Jan 6, 8:59 am, majna majna...@gmail.com wrote: http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp But this will break reverse routing, if used. All routes must be connected for reverse routing to work. On Jan 6, 4:57 am,

Re: Bootstrap access to a model?

2011-01-06 Thread Miles J
but want them to be accessed as: /products /products/services /about ...basically i want a way that they can add content to the site, and then arrange the URLs in anyway they see fit. On Fri, Jan 7, 2011 at 4:24 AM, Miles J mileswjohn...@gmail.com wrote: Why are you allowing users

Re: Bootstrap access to a model?

2011-01-06 Thread Miles J
it On Fri, Jan 7, 2011 at 9:44 AM, Miles J mileswjohn...@gmail.com wrote: I guess I still don't understand why a database is needed for this? Are they not going to be editing the PHP files themselves? If they aren't, then just save the routes as a serialized array into the filesystem

Re: Bootstrap access to a model?

2011-01-06 Thread Miles J
, 2011 at 10:44 AM, Miles J mileswjohn...@gmail.com wrote: Saving the routes to a file will probably be much easier and less error prone then trying to connect to the database during the bootstrap process. Most likely less logic required also. On Jan 6, 4:13 pm, Greg Skerman gsker...@gmail.com

Re: CakePHP + nginx + VPS

2011-01-05 Thread Miles J
Ive done this many times, here's my nginx setup: domain1.com/ ---public/ --app/ ---private/ ---logs/ domain2.com/ ---public/ --app/ ---private/ ---logs/ The public folder contains the cake/php app files. Private contains anything that's shouldn't be accessible, and logs is logs. The

Re: How do you guys structure your shared components/behaviors/plugins repository (Subversion)? --psybear

2011-01-04 Thread Miles J
@Joshua - Yes but if you put everything into a single plugin, then the problem is solved. You are *not* including all those files in the app, you are just making them available. They are included once you add them to the $helpers, $components array, etc. A great example is the CakeDC utils plugin:

Re: How to dynamically call model methods?

2011-01-04 Thread Miles J
That looks correct to me. What does $func look like when you echo it? Also, name needs quotes around it: $this-set('name') or $this- set($catfield['name']) On Jan 3, 5:29 am, herly P itssher...@gmail.com wrote: I have a list of functions defined in my model which i want to call dynamically.

Re: IDE

2010-12-21 Thread Miles J
Netbeans all the way. Just download the one without all the java plugins. On Dec 21, 4:07 pm, Felipe Roman roman.fel...@gmail.com wrote: On Tue, Dec 21, 2010 at 2:28 PM, Kristofer krishop...@gmail.com wrote: Ah, I saw NetBeans several years ago but forgot about it!  I will give it another

Re: FormHelper Problem

2010-12-20 Thread Miles J
@Cricket - Since when is that possible? I know you can use action as a parameter, but if you want to define a full route, you must use url. On Dec 20, 12:06 pm, cricket zijn.digi...@gmail.com wrote: You don't need to specify url: echo $this-Form-create(     'ContactRequest',    

Re: Defining php functions in views

2010-12-17 Thread Miles J
@euromark - He answered that in his post. @ojonam - Scope issure for sure, just do. function getLink($view, $x) { return $view-Html-link($x,#.$x); } echo getLink($this, $x); On Dec 17, 4:47 am, euromark dereurom...@googlemail.com wrote: is there a reason why you dont want to stick to the cake

Re: How to disable the previously loaded model

2010-12-14 Thread Miles J
The student() method is not being called since it is another action. Secondly, why should it be disabled? Another object isn't going to slow down your application. On Dec 14, 3:51 am, Amit Badkas amit.sanis...@gmail.com wrote: Hi, Please elaborate what you want to do as from the given code,

Re: using Cake's Form helper in non-Cake apps?

2010-12-09 Thread Miles J
Its not really possible without a lot of hacking of the class. However, I do have something similar written for a stand alone PHP script (the example file is correct, the docs are out of date). https://github.com/milesj/php-formation On Dec 8, 11:16 pm, park park@gmail.com wrote: Hi all,

Re: Cache data question / opinion

2010-12-07 Thread Miles J
Cache anything that shouldn't be dynamic (example pagination is dynamic, or user data). I have some cached files that just represent a number, example: 1234345 Instead of querying the database how many users I have, just cache the number every 24 hours. On Dec 7, 1:27 pm, Dave Maharaj

Re: use APC Memcached at the same tim

2010-12-06 Thread Miles J
it running, the other caching engines need to be configured in core.php, AFAIK! On Mon, Dec 6, 2010 at 5:51 AM, pang y...@tagroup.se wrote: you mean I don't even have to enable apc in core config file ?? On Dec 3, 7:32 pm, Miles J mileswjohn...@gmail.com wrote: Install APC and memcache

Re: SessionComponent not always available

2010-12-06 Thread Miles J
I believe the core Controller class had the session removed, but the AppController within cake still has the Session. You overwrote their AppController so it reset. On Dec 6, 11:58 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 6, 2010, at 08:57, McBuck DGAF wrote: What version are

Re: Saving Whole array to database

2010-12-06 Thread Miles J
There are two ways (assuming this is within a loop). $this-SavedNews-save(array('title' = $title, 'description' = $desc), false); Or you can save the whole array. $this-SavedNews-save($data, false, array('title', 'description')); On Dec 6, 11:53 am, NB r.szta...@gmail.com wrote: 'm out of

Re: Memcache Set up Help

2010-12-05 Thread Miles J
How did you install memcache? Through a package within SSH? On Dec 5, 12:03 pm, cricket zijn.digi...@gmail.com wrote: On Sat, Dec 4, 2010 at 8:59 PM, Dave Maharaj m...@davemaharaj.com wrote: Its just never there. /etc/init.d/memcached restart -bash: /etc/init.d/memcached: No such file or

Re: Memcache Set up Help

2010-12-05 Thread Miles J
I use MT but I run an Ubuntu Lenny installation. I have APC and memcache working fine. On Dec 5, 1:58 pm, Dave Maharaj m...@davemaharaj.com wrote: Thanks for the tip I will try it. Yes I used YUM install. Updated YUM first just for the sake of saying I tried that too, Grabbed the rpgforge

Re: Memcache Set up Help

2010-12-04 Thread Miles J
Check your memcached is running from within SSH. Run: telnet localhost 11211 On Dec 4, 5:48 am, cricket zijn.digi...@gmail.com wrote: On Fri, Dec 3, 2010 at 11:52 PM, Dave Maharaj m...@davemaharaj.com wrote: I have setup memcached on the server. Check php info and its there memcache

Re: Memcache Set up Help

2010-12-04 Thread Miles J
Have you tried running: /etc/init.d/memcached restart Or startup (i think) On Dec 4, 2:45 pm, cricket zijn.digi...@gmail.com wrote: On Sat, Dec 4, 2010 at 4:18 PM, Dave Maharaj m...@davemaharaj.com wrote: Thanks for your help Cricket and Miles...really appreciated! So telnet localhost

Re: What is a__constructor

2010-12-03 Thread Miles J
I would suggest learning the basics of PHP and OOP programming before jumping into something like this. http://php.net/manual/en/language.oop5.php On Dec 3, 9:38 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Dec 2, 2010, at 14:09, João Moura wrote: i dont found a good explanation

Re: Use CakePHP in NetBeans IDE 6.8

2010-12-03 Thread Miles J
No reason to be. People like this need to learn to do things themselves at some point. On Dec 3, 1:31 am, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: I feel a little bad for being harsh with him now... Jeremy Burns Class Outfit

Re: use APC Memcached at the same tim

2010-12-03 Thread Miles J
Install APC and memcache. APC will run automatically and cache your opcode. Use memcache on the CakePHP side to cache query data. On Dec 3, 6:04 am, Ma'moon phpir...@gmail.com wrote: All configuration items that you need to edit takes place in core.php, right there you will have the ability to

Re: Use CakePHP in NetBeans IDE 6.8

2010-12-02 Thread Miles J
Netbeans doesn't have CakePHP support, its just an IDE. I also love how your asking for step by step images on how to do everything, try to figure it out yourself. On Dec 2, 5:48 am, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Sure - I'll drop everything and just knock you up

Re: Validation Rules Help

2010-11-29 Thread Miles J
This is merely off the top of my head and only for the domain part, not the username or the @. /^([a-zA-Z0-9\-]+)\.([a-zA-Z]{2,3})(\.[a-zA-Z]{2,3})?$/ On Nov 28, 4:17 pm, Dave Maharaj m...@davemaharaj.com wrote: This one I have been putting off for a while and finally getting around to trying

Re: Common Punctuation

2010-11-28 Thread Miles J
Off the top of my head: /^[\-\.a-zA-Z]+$/ Regex is probably the easiest approach. Just set it as a custom validation rule. On Nov 28, 1:30 pm, Dave Maharaj m...@davemaharaj.com wrote: I know its not so much Cake question so forgive me ahead of time. But does anyone know a regex for common

Re: Common Punctuation

2010-11-28 Thread Miles J
Forgot spaces: /^[\-\.\sa-zA-Z]+$/ On Nov 28, 4:08 pm, Miles J mileswjohn...@gmail.com wrote: Off the top of my head: /^[\-\.a-zA-Z]+$/ Regex is probably the easiest approach. Just set it as a custom validation rule. On Nov 28, 1:30 pm, Dave Maharaj m...@davemaharaj.com wrote: I know

Re: conversion of mysql query to cakephp query

2010-11-26 Thread Miles J
$this-id = 1; $this-save(array('balance' = $balance - 5)); On Nov 26, 12:58 am, Vivi Vivi vivianbog...@gmail.com wrote: http://book.cakephp.org/view/1031/Saving-Your-Data On Fri, Nov 26, 2010 at 10:19 AM, Biplab Subedi bipla...@gmail.com wrote: Help me in converting this mysql query to

Re: Controller::__mergeVars() automatically adds model class to Controller::uses that doesn't exist! --psybear

2010-11-23 Thread Miles J
Cake automatically adds a model to your controller based on your controllers name. To disable that, pass an empty $uses. public $uses = array(); On Nov 23, 8:47 am, AD7six andydawso...@gmail.com wrote: On Nov 23, 5:02 pm, psybear83 psybea...@gmail.com wrote: Hey everybody Because I need

Re: How to determine whether there's an $id passed to an action? --psybear

2010-11-18 Thread Miles J
Personally, I would just set it on an action basis. public function edit($id) { $this-Model-id = $id; } Your getting into muddy territory going with that approach. On Nov 18, 10:20 am, psybear83 psybea...@gmail.com wrote: Hi all I'd like to have a beforeFilter in my AppController

Re: Trying to test a controller but autoRender=false doesn't seem to stop rendering!

2010-11-17 Thread Miles J
I usually do: $this-autoLayout = $this-autoRender = false; On Nov 17, 1:57 am, psybear83 psybea...@gmail.com wrote: Hi all That's my automatically generated controller test: ?php /* Comments Test cases generated on: 2010-11-17 10:11:59 : 1289987639*/ App::import('Controller',

Re: location of php file where values are posted by jquery file

2010-11-17 Thread Miles J
Like cricket said, you aren't even using Cake correctly, nor a framework correctly. Your auction file should be turned into a controller. On Nov 17, 4:48 pm, cricket zijn.digi...@gmail.com wrote: On Wed, Nov 17, 2010 at 9:10 AM, Biplab Subedi bipla...@gmail.com wrote: i am new to cakephp and

Re: action redirect not working

2010-11-17 Thread Miles J
So whats line 746? It seems you are echoing code before the redirect somewhere. On Nov 17, 5:28 pm, Briko03 nathanrlar...@gmail.com wrote: I have an form/action that I am trying to get to redirect based on submitted values For some reason when I try to get my form to redirect to my url I

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-16 Thread Miles J
Well you're going to hate Cake 2.0 which is getting rid of the error system in place of exceptions :P On Nov 16, 12:47 am, Joshua Muheim psybea...@gmail.com wrote: Thank you for your replies. I was not aware that false is returned, so I'm taking back my accusation that CakePHP is lazy. Still

Re: Why only pass $data to view instead of model instance?

2010-11-16 Thread Miles J
@Cricket - How so? Just because the model has database access? It really doesn't matter if you pass the model to the view if you are using it for convenience methods. I think you are completely missing the point, this isn't about passing data to the view. On Nov 16, 11:24 am, cricket

Re: Why only pass $data to view instead of model instance?

2010-11-16 Thread Miles J
, Nov 16, 2010 at 5:22 PM, Miles J mileswjohn...@gmail.com wrote: @Cricket - How so? Just because the model has database access? It really doesn't matter if you pass the model to the view if you are using it for convenience methods. I think you are completely missing the point, this isn't about

Re: Why only pass $data to view instead of model instance?

2010-11-16 Thread Miles J
I guess it all boils down to personal preference then :P On Nov 16, 8:20 pm, cricket zijn.digi...@gmail.com wrote: On Tue, Nov 16, 2010 at 9:44 PM, Miles J mileswjohn...@gmail.com wrote: Actually that's wrong. If this was a pure OOP framework, then we would be passing the model or some kind

Re: CakePHP Two Step View Pattern

2010-11-15 Thread Miles J
This isn't possible in Cake. You can only have 1 content, which is the HTML rendered based on the action/controller. If you want to display additional content, use an element include or requestAction. On Nov 15, 9:31 am, Rey Philip reyphilipre...@gmail.com wrote: Hi guys I'm new here in

Re: CakePHP should be more strict with unclean configuration, e.g. when specifying missing components! --psybear

2010-11-12 Thread Miles J
It will error out when you try to access a component that doesn't exist. Adding an invalid string to an array should not cause CakePHP to barf errors. On Nov 12, 10:09 am, cricket zijn.digi...@gmail.com wrote: On Fri, Nov 12, 2010 at 5:05 AM, psybear83 psybea...@gmail.com wrote: Hi all I

Re: Is there a reason why I shouln't make $this-Html available in views as $html? --psybear

2010-11-12 Thread Miles J
It was mainly so that user variables don't overwrite helper variables. I ran into this problem a few times during my 1.2 days. If it really bothers you that much. $f = $this-Form; On Nov 12, 5:25 am, Joshua Muheim psybea...@gmail.com wrote: I don't see the big deal, too. I just wondered

Re: Why only pass $data to view instead of model instance?

2010-11-12 Thread Miles J
I dislike this also. Cake really should have more than 1 model type: DAOModel and DataModel. One deals with database interactions, while the other manipulates a dataset for the view. However, there is nothing stopping you creating these extra models. $this-set('data', new

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Components are initialized before they get to beforeFilter(), so beforeFilter() should work fine. https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/controller.php#L525 On Nov 11, 9:24 am, Bogdan Bursuc bogdanbursu...@gmail.com wrote: Why do you need one ? On Thu, Nov 11,

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Also forgot to mention that there is an afterFilter() as well. On Nov 11, 10:30 am, Miles J mileswjohn...@gmail.com wrote: Components are initialized before they get to beforeFilter(), so beforeFilter() should work fine. https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/c

Re: Design Pattern???

2010-11-10 Thread Miles J
Can you be more specific? It does use ActiveRecord and some Observer pattern. On Nov 10, 7:56 am, dr43058 dr43...@gmail.com wrote: What design pattern does CakePHP use in the data access portion of the MODEL? Check out the new CakePHP Questions site http://cakeqs.org and help others with

Re: Simple jquery script

2010-11-08 Thread Miles J
You could just write the Javascript manually. I never found a benefit in using a PHP helper that generates your JS code, when you can just write the JS code. On Nov 8, 9:00 am, Dobrogor alexc...@gmail.com wrote: Yes, I working with jQuery helper that i can use in Cake. Because original jquery

Re: Security Component

2010-11-08 Thread Miles J
Most of the time it will not validate and blackhole (throw a whitepage), it was easiest to just disabled it in AJAX calls. $this-Security-validatePost = false; We dont need validation in AJAX anyways as we usually need some sort of json response. On Nov 8, 2:18 pm, Dave Maharaj

Re: Security Component

2010-11-08 Thread Miles J
with firebug it still submits (my validation returns JSON response error ) so I guess the security component does nothing. So far no blackhole / whitepage errors though. Just curious is all. Thanks, Dave -Original Message- From: Miles J [mailto:mileswjohn...@gmail.com] Sent

Re: Cake without write permission to file systems?

2010-11-08 Thread Miles J
Just change the cache setting in config/core.php Example: Cache::config('default', array( 'engine' = 'Memcache', 'duration' = 86400, 'probability' = 100, 'servers' = array('localhost:11211'), 'compress' = false )); On Nov 8, 7:06 pm, park

Re: Best way to route old fashioned PHP url to cake style

2010-11-07 Thread Miles J
I would do it in the htaccess file. No need to leverage PHP logic for this. On Nov 7, 10:24 pm, pz zhangpe...@gmail.com wrote: Hi All, I am rewriting my old site with Cake 1.2.  The old site has may urls that people bookmarked and search engines indexed.  I want to keep those url working.  

Re: Get the last insert id

2010-11-04 Thread Miles J
@Kevando - If you want the ID of something that happened 20 days ago, you cant get the last insert ID. That only applies when you literally just ran a query and need to get the ID. If you want it from 20 days ago, do a find query and order by DESC limit 1. On Nov 4, 8:36 am, euromark

Re: Can i send email through mysql/cakephp when the users are offline?

2010-11-03 Thread Miles J
No there isn't such functionality. Furthermore, how are you detecting an offline user? On Nov 2, 9:03 pm, Jerin K Alexander jerin.kalexan...@gmail.com wrote: My objective is to send a mail when the users are offline. It depends on a particular row or value inserted in the table. if such an

Re: Help with array

2010-11-03 Thread Miles J
Wouldnt this work? Havent tried. var data = { Model: { username: 'miles'; } } On Nov 3, 6:57 pm, Dave Maharaj m...@davemaharaj.com wrote: I think so! It has a model. Im using a jquery plugin and where the user slides something I have a #id which corresponds to a field and a value so I want

Re: Anything wrong with this?

2010-11-01 Thread Miles J
Just for convenience sake. I do the same thing for a lot of my tables and in most cases the numbers get out of sync. Either a profile fails to create, or creates dupes, or something terrible happens. Its best to just keep inserting rows (and delete broken ones) then to try and fix the table to

Re: Opening New Window from Controller

2010-10-26 Thread Miles J
Why would you ever need to do this? It is impossible anyways, that is a browser feature. On Oct 26, 12:18 pm, Tilen Majerle tilen.maje...@gmail.com wrote: opening new windows from controller???...so you want with php??...impossible :D -- Tilen Majerlehttp://majerle.eu 2010/10/26 Xandornot

Re: Build Query

2010-10-25 Thread Miles J
Why are you setting $results twice? If you want pagination, use paginate(), you dont need the other query. On Oct 25, 11:39 am, Briko03 nathanrlar...@gmail.com wrote: It looks like the first query is working as it should. I  am positive there is a location field. Here is a snapshot of the

Re: A little help with auth. :)

2010-10-20 Thread Miles J
Just check $this-params['action'] and do different logic based on specific actions. On Oct 19, 7:12 pm, xtraorange xtraora...@gmail.com wrote: Is there any way to do that at the action level, rather than the controller level?  Different actions may have different userlevel requirements. On

Re: How can i Optimize i18n ?

2010-10-19 Thread Miles J
I18n already caches the strings after it has been parsed. Make sure you actually have caching enabled. On Oct 19, 10:08 am, Adrian Arnautu arnautu.adr...@gmail.com wrote: Oh, now I see that you gave us the output, my bad :). Thank you. On Tue, Oct 19, 2010 at 8:06 PM, Adrian Arnautu

Re: So methods that are not an action should have a _ in front of it?

2010-10-19 Thread Miles J
The _ is just to make it easier unlike Symfony: function executeIndex() { } Or unlike Zend: function indexAction() { } The callbacks are just restricted internally from being called. On Oct 19, 9:12 am, Joshua Muheim psybea...@gmail.com wrote: Hrhr, as said before, I will just have to accept

Re: Easiest way to get data from a model (better way than $model-data['modelname']['field'])?

2010-10-19 Thread Miles J
You can use read. $this-read('column'); If the data doesnt exist yet, pass an ID. $this-read('column', $id); But usually best to just grab the who result, then use read() afterwards. On Oct 19, 8:40 am, Joshua Muheim psybea...@gmail.com wrote: Accepted. :-) Thanks for your opinion. On Tue,

Re: PersistModel problem

2010-10-18 Thread Miles J
I ran into this problem many times and never found a solution. It only seemed to happen on apps with large sets of models and relations, so I am assuming that the serialization of the objects is causing the model relations to break or not work properly. I had to disable persistModel and just stich

Re: Missing Controller

2010-10-16 Thread Miles J
So what does your controller code look like? And what is the filename? etc. On Oct 15, 8:18 pm, Syed Badar Bin syed...@hotmail.com wrote: HI GUYS i have added a new folder on my server and its has got all the files in it including index but i get this error, Can any one help please Missing

Re: Suggestion for upload large files

2010-10-15 Thread Miles J
If you have upload/memory limit issues, use a flash or java uploader. On Oct 15, 8:11 am, Sanza mass...@creativebrains.it wrote: Hi everybody, anyone can suggest to me a solution to upload large files without change the php.ini setting upload_max_filesize? Thank you Massimo Check out the

Re: Framework benefit?

2010-10-14 Thread Miles J
Easy: fast development. Also, caching will improve everything. For example, my APC can deal with about 120 cache requests per second and my memcache about 90 per second. Site loads blazingly fast. On Oct 13, 11:41 pm, Andrei Mita andrei.m...@gmail.com wrote: Plus, hardware is MUCH cheaper then

Re: Loading a cookie inside a model's constructor

2010-10-14 Thread Miles J
You should be passing the cookie from the controller to the model. $this-Model-cookie = $this-Cookie-read('cookieName'); But to answer your question, you need to initialize the cookie component. $cookie = new CookieComponent(); $cookie-initialize($this, array()); On Oct 14, 4:15 pm, cricket

Re: Help with converting user generated content into cakephp friendly code

2010-10-12 Thread Miles J
My suggestion, don't do any of what you asked in your first post. Either do straight HTML without connecting to Cake, or use a custom markup like BBCode and parse it yourself. On Oct 11, 5:29 pm, Greg Skerman gsker...@gmail.com wrote: Figured it out - well at least the process.. going to have

Re: passing data to controller via POST makes trouble

2010-10-12 Thread Miles J
Ok so whats the URL that saveRating() points to? And what does the action look like. On Oct 12, 2:40 pm, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: hi, when a user clicks on a product link a url like this opens:   products/ show/45 45 is the products id. this id is part of a select

Re: Plug-in Models

2010-10-08 Thread Miles J
That is how you use it. If you want to use plugin models within a plugin, you must define the plugin. public $uses = array('User' = array('className' = 'Member.User')); On Oct 7, 6:46 pm, Dave Maharaj m...@davemaharaj.com wrote: I have various controllers such as confirmations, passwords,

Re: Best way to handle sub-tabs

2010-10-04 Thread Miles J
On Oct 1, 1:49 pm, Miles J mileswjohn...@gmail.com wrote: Just use the default MVC architecture? tabname = controller subtab = action On Sep 30, 12:05 pm, Joey Mukherjee joe...@gmail.com wrote: I have some tabs along the top of my CakePHP site and some sub-tabs along the left

Re: Best way to handle sub-tabs

2010-10-04 Thread Miles J
Furthermore, you can make it the index action with arguments. public function index($subtab) { $this-set('subtab', $subtab); } On Oct 4, 10:15 am, Miles J mileswjohn...@gmail.com wrote: And again, what your saying is exactly what a controller and action is for. How is that different than your

Re: models: fundamental question referring to member variables

2010-10-03 Thread Miles J
Theres no point for getters and setters if they dont do anything to the property. If it just sets and gets without modifying the data in any way, you might as well just use public properties. However, Cake does support the active record approach. $user = new User(); $user-username = 'miles';

<    1   2   3   4   5   6   7   8   9   10   >