also this assumes you have your categories table with a name field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from
I use even shorter keys id and pid since I like short names. I was
writing out long names to make them obvious in the source as to what
they are.
Use whatever names you want. Just make sure to use cake conventions or
make sure you set the table and all of the keynames in the model
Martin Schapendonk wrote:
On 10/11/06, AD7six [EMAIL PROTECTED] wrote:
However, strictly speaking it does not provide any way to prevent an
Address to belong to a Person and an Organization at the same time.
?
If on the address table there are 2 fields 'class' and 'foreign_id'
If I create a model with a relationship to itself ie a nested
categories model with a belongs to and has many relationship I can
easily enough get a set of nested categories data.
The problem for me is that if I wish to reference the content related
to that category I must either reference it
I have thought of all of this before and none of these solutions quite
seems to solve my problem.
I need to be able to recover the id for the category entry in order to
reference various related models to generate the content.
The number of parameters in the url needs to be dynamic and must
this shouldn't be a problem. you just need to split the args in the
categories index () function. You then build you complexity in there,
perhaps limiting your depth to 4 /cat/subcat/subsubcat/id
The limit is absolutely not an option. I think perhaps a arg count on
the parameters could be
I solved this differently than suggested.
This thread has my solution for those interested.
http://groups.google.com/group/cake-php/browse_thread/thread/6c7cdd0cc5160a19/ac0466a2764df27f?lnk=gstq=gremlinrnum=2#ac0466a2764df27f
--~--~-~--~~~---~--~~
You received
gwoo that is the model I used. Nothing I have found works to lookup the
id of a category when the category tree is passed via the url as
params. The function crazylegs wrote is logically sound but why would I
execute N queries to get to the id only to use it to do lookups against
other tables?
you need to include screen, then print, then ie *in conditional
comments* then the fancytype.
On Sep 27, 6:30 pm, Sam Sherlock [EMAIL PROTECTED] wrote:
no reason why it should not work unless your css is not found blueprint has
a llib directory and plugins (perhaps not any more) which I
There is nothing in the core having to do with a Calendar. That might
explain why you failed to find one.
More importantly, you seem to be under the impression that because you
saw something somewhere having to do with a Calendar ( I assume you
mean a javascript date picking widget ) referenced
Toby - you seem to be using the google groups as a source for all your
answers. Might I reccomend that you learn to use the api.cakephp.org
pages and the book.cakephp.org pages as a reference before posting
here?
On Sep 22, 7:17 am, RichardAtHome [EMAIL PROTECTED] wrote:
Note:
div
I already answered your question Toby.
The datepicker class is added to the date input element. That is all
that cake has to do with it. After that it is purely javascript. The
javascript is then using the classname to attach a behavior to the
element. The javascript is not a part of the CakePHP
beforeValidate runs before validation, but doesn't actually prevent
saving. If there is something you need to check that prevents saving a
record, you should put the logic in beforeSave
-Abba
On Sep 21, 8:34 am, Novice Programmer [EMAIL PROTECTED]
wrote:
got that... Need to set soem field as
Don't wrap the DS with curly braces if you are going to use the
concatenation operator.
Just do 'uploadDir' = img.DS.shirts
On Sep 21, 9:05 pm, Wanna be baker ray.crawf...@gmail.com wrote:
I have a Shirt which has many different images
- shirt_image
- thumb_on_image
- thumb_off_image
-
What about a custom routing prefix ( ie. admin routing ) - just add
'reports' to the prefix array and then in the sales controller do a
reports_index function and in the customers controller define a
reports_index function and cakes default routing will give you the 2
urls you used as an example.
The edit form should include either a hidden field for id, or pass the
current id in the url via the action param.
On Jan 9, 12:06 pm, manas gajare manas.prince...@gmail.com wrote:
I am facing an issue about 'id' field in the regular *
localhost/project/comments/edit/5* structure.
Let's say I
Use firebug / Safari inspector / Chrome inspector
View source is the tool of last resort - I honestly haven't hit view
source in a decent browser for years now.
On Jan 14, 12:05 pm, Dave Maharaj m...@davemaharaj.com wrote:
Thanks Miles.
I am sure any of the servers would work fine but each
I already answered this guy on StackOverflow telling him exactly this.
He didn't listen then and I doubt he will now...
On Feb 16, 8:16 pm, Dr. Tarique Sani tariques...@gmail.com wrote:
Just for day names and format you need helpers/behavior and components?
Pray why?
How you display a date
You should ask that question somewhere *NOT SPECIFIC TO CAKEPHP*
On Feb 21, 7:02 pm, johnlaw johnnugroh...@gmail.com wrote:
Hi,,
I'm a newbie in php..
I have xml files from which i want to extract it into information
in .txt file...
can anyone show me how to convert this,
Maybe write it as a console script? Or find some way to batch through
the requests using multiple http requests.
On Feb 21, 7:30 pm, Dr. Tarique Sani tariques...@gmail.com wrote:
Web servers are simply not designed to have such long single requests
The best would be to use shell with short php
Oops - Tarique beat me to it.
On Feb 21, 7:30 pm, Dr. Tarique Sani tariques...@gmail.com wrote:
Web servers are simply not designed to have such long single requests
The best would be to use shell with short php scripts and some sort of a
queue system, which allows you to stop and resume your
Speaking of moot points, it's moot not mute
On Feb 11, 3:09 am, Sam Sherlock sam.sherl...@gmail.com wrote:
FWIW the suggestions made by Ryan Jeremy are better than using the Model
Query method
as you lose out on the cake auto magic with the method
$this-Video-doIncrement($id);
vs
App::build( array(
'controllers' = array(
DS . join( DS, array( 'parts', 'to', 'your', 'path' ) . DS,
... other paths for controller lookup
),
));
should work for you. I am not sure if you need to set the normal
path as one of the array items or not. Play around and let us
29, 8:00 pm, Miles J mileswjohn...@gmail.com wrote:
Yeah but if you are going to do that, you might as well just use
plugins, lol.
On Apr 29, 6:38 pm, gremlin abba.bry...@gmail.com wrote:
App::build( array(
'controllers' = array(
DS . join( DS, array( 'parts', 'to', 'your
Also *I* sometimes want my controllers in sub-folders as an easy way
to use the File / Folder classes and folder locations to act as a
quick way to generate a filtered list of controllers. I have one
project with simple controllers in a widgets folder that all inherit
from a different parent
The point here is that you obviously haven't read the manual. Why
should we be helping someone who hasn't bothered to read the excellent
materials provided? Second, your question is answerable with a quick
google search. Google for cakephp complete application tutorial and
*READ THE ENTIRE MANUAL*
I think something similar to the form input syntax would be good. Have
it return nothing but links, all in one string and allow some options
i.e. : around, before, first, between, last as keys to input html
around, before the first item, between all items ( meaning between
consecutive links - not
Make sure if you are passing id's for edit actions that the edit
action is in the forms action attribute ie
array( 'url'=array( 'controller'='foo', 'action'='bar',$foo['Foo']
['id'] ))..
Also, if you use char(36) for id's then you get UUID's - and it would
be really unlikely that a user will
Portland OR, San Francisco CA, Sacramento CA, San Jose CA so that some
of us West Coasters can get some love. Corporate travel is expensive
and difficult to get approved these days so something for us Left
Coasters would be appreciated this time around.
On Jan 7, 7:18 pm, Chris Roush
As long as the field is a date field in the database you should be
able to simply use $form-input( 'Model.datefieldname' , ... ) as
usual. I believe it autocreates a number of select boxes.
Good luck._
On Mar 28, 3:53 pm, shabba [EMAIL PROTECTED] wrote:
I'm trying to use the form helper to
'rule' = VALID_NOT_EMPTY,
'required' = true
On Apr 7, 10:21 am, Duro [EMAIL PROTECTED] wrote:
Furthermore...The solution I mentioned in my previous post does not
quite work the way I'd hoped. It allows single words (ie. test123),
but if you put spaces in the field (ie. test 123) it doesn't
You should use add a field i.e 'change_password' to the model's
validation array. You can then use the Security::hash to hash that
value for saving in the action.
http://www.littlehart.net/atthekeyboard/2008/01/22/simple-user-registration-in-cakephp-12-part-ii/
should help you somewhat.
The
Also
var $validate = array(
'fieldName1' = array(
'rule' = 'ruleName', // or: array('ruleName', 'param1',
'param2' ...)
'required' = true,
'allowEmpty' = false,
'on' = 'create', // or: 'update'
'message' = 'Your Error Message'
)
);
from the book -
in the case of a password field - where the field should *always* be
cleared when the view loads - all of the clearing logic should be at
the view level.
Using the form helper
e( $form-input( 'User.password', array( 'type' = 'password', 'value'
= '' ) ) );
I believe that should do the trick for
Both are capable of internationalizing your email campaigns I believe.
As for european solution, I don't know of any of the top of my head.
Both services are quite cheap. I think campaignmonitor is $5.00 U.S. +
$0.05 U.S. for each email recipient beyond the first 5 ( they let you
set up a 5
You can call a script the same way, just use $( #quote p ).load( /
contoller/action );
Make sure your controller handles ajax requests. If you don't know
what that means look up requestAction or parseExtensions in the
groups.
On Jul 2, 10:12 pm, Jim Newfer [EMAIL PROTECTED] wrote:
I have been
PROTECTED] wrote:
Gremlin, thank you so much for your reply! So far it isn't working but
in the top of my javascript I have arequestAction, and in my
controller I set something like this
if(isset($this-params['requested'])) {
return array('stories' = $getstories, 'school
All of the workflow issues are DOMAIN SPECIFIC PROBLEMS and should *
NOT * be in the framework. If you need a workflow solution you could
use CakePHP to * MAKE * one that did exactly what you needed - or even
better make a general workflow solution and release it as a Behavior /
Component /
I have had good success by using a model function to generate a custom
query from the url. Search for other posts on nested categories for
some solutions. I generally resolve the id of the article/category -
whatever is nested - using a recursive function in the model and then
pass that along to
What you need to do is write an index action for your users_controller
like you would if you were NOT using ajax or reusing that action at
all.
Once you have that done, modify that function to check isset( $this-
params['requested'] ) to see if the view action if being called via
the
into the #element.
Remember you need to play with the RequestHandler component and either
extension parsing or request handling code to serve the ajax view in a
blank layout.
Again have fun with this stuff. Let us know what you come up with.
On Aug 17, 1:41 pm, gremlin [EMAIL PROTECTED] wrote:
What you
The awful thing is I read it all and I think I may have actually
understood what he was saying..
Please don't ever post an esoteric rant again - this is a list for
asking questions about how things work, not to brag about how long you
have been in the DaVinci fan club while blaming developers for
I tend to define conditions in associations on very few occasions. One
good use is for polymorphic models (you need to define the field =
modelName mapping) and for models that have a enum field (or similar)
that determines some behavior of the model. IE log models and for
defining self
More important - why are you trying to use lua scripts for lighthttpd
when you seem to be working on a MAMP install? (apache)
On Mar 21, 4:08 am, AD7six andydawso...@gmail.com wrote:
On Mar 21, 1:27 am, axel9641 axell9...@gmail.com wrote:
Hi Folks
I am new to CakePHP. I am going through
Do you have debug set to 0? If you are seeing the query log then you
likely don't and with a setting of anything higher than 0 the cache is
cleared on each call to the action.
On Mar 22, 2:27 pm, André von Arx avon...@gmx.net wrote:
I've tried to cache a controller action without success.
Just a guess - is there a routes file in the plugin that you didn't
copy over to your config/routes.php? A route mapped from /users/add
to /users/register would make sense for this sort of error.
On Mar 22, 10:15 am, Ryan Schmidt google-2...@ryandesign.com wrote:
Perhaps I should be asking: is
Are you using the 'with' key in the model relationship? Are you doing
it in both directions? I don't know if it will help but I vaguely
remember something along these lines.
On Apr 3, 11:41 am, Krissy Masters naked.cake.ba...@gmail.com
wrote:
Nothing. I simply want to first make sure no more
Look into EAV structures. Basically you build tables that map data
types (field types) to their values and the owning model by name and
id. A polymorphic behavior would do most of the work. There are a few
of on github that google finds pretty easily.
This of course doesn't do the form building
Actually - he asked for http basic digest authentication. Meaning all
of his protected pages will pop up the browser credential window
instead of the html form based login that auth promotes. Before you
criticize the poster for making zero sense and not having read your
own question maybe you
You need to edit your view file. You can do a debug( $variableName )
on the data you are sending to the view. You will notice a different
array structure for hasMany as compared to hasOne.
On Apr 24, 9:34 am, taq taqman...@gmail.com wrote:
databasehttp://upic.me/i/v4/database.jpg
book
You need to read the manual:
Try the following - it seems you are confusing the $name property with
the $uses property of the controller.
?php
class MembersController extends AppController
{
$name = Members;
$uses = array( Member, Myprofile ); // notice these are
model
@Otavio - that has nothing to do with the question.
On May 2, 7:51 pm, Otavio Martins Salomao otaviosalo...@gmail.com
wrote:
u try this!
foreach($test as $element)
$result = $element['Deep1']['Deep2']['extract'];
2011/5/2 Gluckens danny30...@gmail.com
Hi everyone,
I'm trying
You didn't follow the instructions correctly.
You have to attach a behavior to the Post model. From the very
beginning of the documentation you linked :
public $actsAs = array('Search.Searchable');
On May 16, 10:19 am, Alonso edaloicar...@gmail.com wrote:
Hi, folks.
I've trying to use the
var $helpers = array( ); // Notice it is plural - you have $helper
On May 16, 7:10 am, Carachi carach...@gmail.com wrote:
Hi,
I try to use the Ajax Helper to receive data for an html select and to
send the form to a page, but I have this problem, in the view compare:
Notice (8): Undefined
Personally I dislike all the methods mentioned.
This is configuration data - load it from a config file. In your
bootstap.php do a Configure::load( 'forms' ); somewhere near the
bottom.
Then in /app/config/forms.php
put the configuration information for the select options.
$config[ 'Forms' ][
the id and the value, making it hard to
interpret:
What does '3' mean? Let's go and look in the code - oops, I don't know how
to.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.comhttp://www.classoutfit.com
On 19 May 2011, at 15:19, gremlin wrote:
Personally I dislike all
Is there a plugin / controller action doing some sort of resizing of a
profile image or something? If there is do you have auth set to allow
un-authorized users to hit that action?
On May 18, 5:54 am, Foroct forrestfraz...@gmail.com wrote:
It appears that the problem is related to David
@Jeremy:
I think you misunderstood me. My point was that both the array-source
and a db-table are good solutions to the problem and that you don't
*need* to have your unique key be meaningless in either. You can use a
'slug' type of key in the array source or a unique key constraint on
the data
You could create a custom helper that extends the formhelper and write
an input function that merges the keys you need instead of resetting
them. Use the helper's existing input function as a starting place.
The portions handling the use of options is pretty clear.
On May 24, 1:42 pm, Tomek Mazur
UUID is char(36) not BINARY(36)
On Jun 3, 10:11 am, adgranados adgrana...@gmail.com wrote:
Estoy manejando un modelo llamado canal, y para la llave primaria,
estoy utilizando, como tipo de dato, binary(36), para que cakephp
genere un UUID. el problema, es que cuando, intento correr el test,
I answered your other thread also - Binary(36) does nothing to
generate UUID - try char(36) instead. Why would you want your UUID to
be only 0's and 1's? The correct column type is in the documentation -
maybe try reading it.
On Jun 3, 10:03 am, adgranados adgrana...@gmail.com wrote:
I am
Also - the frontend (player) has nothing at all to do with your
backend (cakephp)
On Jun 8, 3:40 am, mi...@brightstorm.co.uk wrote:
Hi guys,
I wanna know abt good music player for my new web site, it should be
worked
with cake php 1.38 and it should be capable of playing list of song
If the fpdf libraries are at all recent you shouldn't have to use the
goofy php4 constructor. I think if you add your custom pdf class to
your vendors folder and instantiate it from a custom helper as a
member variable you could do a lot more, much more easily.
I actually enjoyed this question so
You can also use a virtualField in the DepartmentBook model. The
virtualFields end up indexed into the correct array as if they were
real fields - this means you don't have to shuffle your results around
before using the data.
I put together a little gist showing what I mean.
Try setting the loginRedirect to the Controller::referer( ) function
i.e. 'loginRedirect' = $this-referer( )
On Jul 12, 6:09 am, pushpa nc.pus...@gmail.com wrote:
I am having trouble getting the Auth component redirect.
I have a login form and I want to keep the user on the page he logs in
Start with breaking the chunks out into smaller private functions. See
if that helps.
On Jul 5, 1:59 pm, Zeu5 kimc...@gmail.com wrote:
Hi there,
the beforeFilter function in my app_controller over time has grown
into a monstrous 300 line code.
in that beforeFilter, i do things like
There is no set function in the Model class so the line $this-Contact-
set( $this-data) is obviously not going to work.
The controller has a Controller::set function for sending data to the
views. If you want to load the Contact model and prefill it with data
use $this-Contact-read( $this-data[
Why not use a custom passed key = value pair in the original element
call and handle the logic in your element itself.
ie
echo $this-element( 'element_name', array( 'birds' = $birds,
'controller' = $this-controller ));
On Jul 21, 1:53 am, OldWest jason.wy...@gmail.com wrote:
I was recently
It also looks like in at least your sample code you were sending
$Practicioner to the view and trying to loop over $Practicioners
(notice one is plural - one is singular)
On Jul 21, 10:46 am, mthabisi mlunjwa mmlun...@gmail.com wrote:
Thanks Jeremy!
I used $practitioner['Practice'][0]['town']
What is being said is that you have some conventions you didn't
follow. As a result, you are writing overly-complicated code to handle
what should be automatic within the framework.
Do this:
1) move / rename your users_links table and data to a links_users
table inside mysql.
2) remove
If your UserType table has some a name or title field cake will
automatically use it when populating drop down lists created with
Model::find( 'list' ).
If you have a field that you use as a group name or title - which it
seems you do - that isn't called name or title you have to set the
First, passing 'product.id' to the parent_id param isn't going to work
unless you have a field literally named parent.id in your images
table.
Second, unless you are going to relate images to each other using a
parent-child structure you do not need a tree - and using the tree
behavior for
Or use a virtual field.
On Aug 15, 11:44 am, Roland Pish rolandp...@gmail.com wrote:
Thanks Jeremy.
I looked at the cookbook with the link you provided and I realized
that I'm having the same output as the example showed there, the
'MIN(Product.price) as price' field is returned in the array
I think you are likely over-complicating the issue.
What you seem to really need is an event dispatching system that can
fire off events that your models, controllers, etc can simply respond
to.
Interestingly enough - there is a plugin for that.
https://github.com/m3nt0r/eventful-cakephp
This
You can't do that in *any* php class - you have to already have the
class constructed before $this-name is set - so how would your class
know how to set $this-name inside a property before instantiation?
You *can* do this in the __construct( ... ) function.
On Sep 9, 10:28 am, lyba
Keep in mind - when you are doing $this-set from an element: You
aren't calling View::set - you are calling Element::set. Why would you
expect that to behave as if it was an instance of the View class when
it isn't? Also, the two pass rendering of CakePHP means that in order
for what you propose
I originally thought this error had to do with my path setup - I had
separated the core from the app so I could work more easily with git
submodules, so I ignored it. I just did a fresh checkout from the git
repo / a download of the RC2 source / and a cakeinit install of the
2.0 package (also uses
Looks as it you are using a named field syntax to pass the hash #
param.
Try this:
$this-redirect( array(
'controller' = 'pages',
'action' = 'display',
#{$this-params['pass'][0]}
));
Notice that I don't use quotes around the numeric array index - that
isn't needed and is actually
I would first recommend that you use a list less than 4 years old.
On Nov 22, 12:16 pm, david mitchell shadowdavid...@googlemail.com
wrote:
Hi, Coders.
I am currently studying Website Development at the University of
Bolton and am doing my final dissertation on the features, usability
and
Yeah, pay attention to what was shown above your reply - you are
setting the facebook helper's name to be the key of the array but the
code above your reply is very clearly not setting the key to the
helpers name but using a normal numeric index.
On Dec 9, 2:52 am, Toby G
Is your form created with the form helper and did you remember to do
type='file' in the options? This error happens when the form isn't
set to multipart/form-data as the file field returns an array of keys
with info about the uploaded file.
On Dec 9, 2:45 am, Elizabeth Pardede
Or - load your jquery with the normal html tag and not the helper and
reserve your use of the helper to include scripts that are strictly on
a controller/action/view basis.
Then your jquery can be the very first thing loaded always - also you
could modify the helper by passing in a configurable
Oops bad reply
On Dec 9, 10:35 am, Abba Bryant abba.bry...@gmail.com wrote:
Elements included in the layout have known limitations in what they can add
to the scripts_for_layout variable.
On Fri, Dec 9, 2011 at 8:56 AM, cake-php@googlegroups.com wrote:
Today's Topic Summary
Use the 1.3 ArrayDatasource and set the $records member variable to the
part of the array you need to use as if it came from a DB in the
constructor. Then you can do whatever you want with it. It should be pretty
straightforward.
On Saturday, April 28, 2012 5:49:30 AM UTC-7, Jeremy Burns
Try this:
http://stackoverflow.com/questions/3594823/mime-type-for-woff-fonts
Also didn't HTML5BoilerPlate have something in their (rather long) htaccess
file that handled this issue? Might check there.
On Thursday, May 10, 2012 3:16:23 AM UTC-7, phpMagpie wrote:
On Monday, 9 April 2012
Try this -
https://github.com/sams/linkable
It is a newer version of the old linkable behavior - uses relationships to
create joins as well as allows you to create joins on non-default keys.
This might be a fairly straightforward drop in replacement for containable
in your case. It might
Am Dienstag, 17. Juli 2012 01:11:31 UTC+2 schrieb gremlin:
Try this -
https://github.com/sams/linkable
It is a newer version of the old linkable behavior - uses relationships
to create joins as well as allows you to create joins on non-default keys.
This might be a fairly straightforward
Even using the worst hosting in the world you still should only ever have
to upload the core one time. If you have to wait 5 minutes for your isp to
move the files to the remote server each time then you are uploading your
app and a fresh copy of the core every time you update the site? That is
Here is a link cleaning up the general idea and using some class methods to
get, set the values and a member variable to store the results keyed by
extension, valued by type. I whipped this up blind so it isn't tested *at
all* but it should be pretty understandable.
89 matches
Mail list logo