Try first retrieve your saved data from session in login action, then
do login, and on success write your data back to session (maybe on
fail too - don't know). Looks like session is re-created on login.
On Aug 12, 5:03 am, LS wrote:
> Er...
> Sorry, you're right.
> My code example was wrong, bu
i found my problem but need solution !
my layout and view file contain some Asian (persian) Character and i
must save my file with UTF8 encode instead
ANSI . when i save my view file with ANSI encode everything goes Right
way and css appear in head tag and don't show
unwanted white spaces but w
Check cache.php - looks like massive expired files deletion occurs on
file cache engine start.
On Aug 11, 10:50 pm, zonium wrote:
> Any insight everyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" gro
Thanks for your help guys.
Cheers
David
On Aug 12, 3:20 pm, "Brendon Kozlowski (Realm)"
wrote:
> That actually has recently been added (clarified) to the cookbook
> documentation.http://book.cakephp.org/revisions/view/9876/Automagic-Form-Elements
> "Besides the specific input options found bel
Hi,
How can i get the SQL query generated by the framework. It does get
saved in the log, but in that case along with that lot of other
information is saved.
I need to store just the SQL query generated as it is in a database so
that i can retrieve them later
and run them.
Any idea how do i go a
i set my css link with your parameters but now don't insert css link
in my html document !
only with this format : $html->css('screen'); work but with above
bugs .
also cakephp don't show any Error and i confuse with this problem :(.
On Aug 13, 1:52 am, brian wrote:
> You're not passing the p
Thanks brian! I finally got around to testing this in our production
environment tonight. Sure enough, the path wasn't right. I added
APP . to the front of my path and it fixed the problem. Thanks for
the advice. It's still odd to me that it works in our test
environment fine without it, but
I have a simple form:
input('Platform', array('multiple'=>'checkbox','label'=>false,
'div' => false));
echo $form->input('Addition.aplatform');
?>
The 'Platform', array('multiple'=>'checkbox','label'=>false, 'div' =>
false)); is a HABTM relationship
the 'Addition.aplatform'); is a hasOne
The new CakePHP code site, http://code.cakephp.org/source, says to use
"git clone d...@code.cakephp.org:cakephp.git" to get a copy of the code
(I assume that's the latest 1.2 stable code). However, when I try to
do that, I get the following error:
Permission denied (publickey).
fatal: The remote
I will try your solutions and i if i still have prob i 'll let you know.I
really appreciate your knowledge and time of you.
Ty very much.
2009/8/13 brian
>
> I think this might work alright:
>
> $data = $this->Location->find(
>'all',
>array(
>'conditions' => array
Seriously now my brains are all over the wall!!
Thank you very much! I was ready to give up with that!
On 13 Αύγ, 01:59, brian wrote:
> That error occurs when Cake doesn't recognise a function/method, so it
> passes it directly to the DB query. The problem is that you have
> $actAs; it should be
That error occurs when Cake doesn't recognise a function/method, so it
passes it directly to the DB query. The problem is that you have
$actAs; it should be $actsAs. A fairly common error, I think.
As for the model being passed as a param, you can ignore it. The
behavior takes care of that. The d
You're not passing the param correctly. Try this:
echo $html->css('screen', 'stylesheet', null, false);
On Wed, Aug 12, 2009 at 4:30 PM, persianshadow wrote:
>
> hi brian
>
> yes ! my css links insert in body tag !
>
> now i change these :
>
> 1 - add to head tag
>
> 2 - and my css tags in head
I think this might work alright:
$data = $this->Location->find(
'all',
array(
'conditions' => array(
'Location.id' => array(1,2,3,4)
),
'recursive' => -1
)
);
/* there's probably an elegant way to do
Hi 2 all,
I'm building a web app and a I have to store some data in hierarhical
order (parent - child) similar to the 'categories example' in the
documentation. So I decided to use the Tree behaviour.
To practice a little bit with the TreeBehaviour, I tried to follow the
example but without any l
Hi all,
I'm looking at taking an existing PHP library (that acceses external
data through SOAPish requests) and creating a Model for it (accessible
to my Controller). I'm not sure if this is the best approach though.
I thought I would look to you all for some thoughts.
The goal is to : Simply a
Ok i get it.i had that idea on my mind.Now if i want to copy rows with the
id 1,2,3,4... in locations table to destinations table i should do something
like that?
$this->Destination-=$this->Location;
$this->Destination->save($this->data) ??
I mean what's the appropriate query to database to implem
hi brian
yes ! my css links insert in body tag !
now i change these :
1 - add to head tag
2 - and my css tags in head tag :
css('screen');
echo $html->css('custom');
?>
and i do this : $html->css('screen', $inline=false) but don't work and
css links stay in body tag.
please help me for rig
Ahhh... passing a handle as an argument. It seems so obvious now.
Thanks
I have actually already moved things to a helper, which makes more
sense anyway. The helper I have will suit my needs fine this time
around. It will be easy to wrap tags around the menu elements when I
get around to the CSS
Sorry, I forgot to get back to you; I was in the middle of a crisis.
cake/../img/picturename.gif
That path doesn't look right. I think there's something deeper wrong.
And what about that in your view? Is it so, or is that actually
in your layout?
And, what I meant about rollovers is that, whe
So the locations data is not kept? I think what I'd do is not bother
with a relation between the two models but use both models in the
locations_controller:
var $uses = array('Location', 'Destination');
Then you could do $this->Destination->etc.
On Wed, Aug 12, 2009 at 2:45 PM, paulos nikolo wr
Nevermind, I finally figured out the location of the images.
I set the 'address' of the alt pictures to:
cake/../img/picturename.gif
so it would have been:
element.src = cake/../img/picturename.gif
:)
--~--~-~--~~~---~--~~
You received this message because you
Ty Brian for you reply.I have 2 models destination,location and 2
controllers destinations and locations_controller.I dont have set a relation
yet between them (i wasn't sure if it is necessary),but here is the idea.The
initial data are saved in locations_controller,which contain some search
data d
Vijay, thanks, but mod_rewrite is not available on this server.
I'm sure now that this is not a Cake problem.
On Wed, Aug 12, 2009 at 1:59 PM, Vijay Kumbhar wrote:
> Hello Brain,
>
> Please edit the .htaccess in the root folder & app folder.
> Add the app/webroot instead of webroot.
>
> On Wed,
The function h($text) in /cake/basics.php has changed and is causing
the problem for me. It now uses htmlspecialchars which escapes the
single quotes. In the beta version it didn't do this.
Without modifying that code, how can I solve my problem so that it
does not escape the single quote?
On Au
Hello Brain,
Please edit the .htaccess in the root folder & app folder.
Add the app/webroot instead of webroot.
On Wed, Aug 12, 2009 at 9:37 PM, brian wrote:
>
> @Robert, the .htaccess files were already removed and the App.baseUrl
> line uncommented.
>
> @Jonathon, I'm not completely certain w
Just clone from git. Packaging every fix into a tar.gz is impossible
and will not be done. But for now you can either sit tight until
another tar is packaged, or clone from git.
-Mark
On Aug 12, 3:36 am, Reijer wrote:
> Hello Mark,
>
> is it possible to download the 1.3 branch with the fix, w
Sorry, typo error, is:
Articles hasandBelognsToMany Tags
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group,
On 12 Aug., 19:00, brian wrote:
> Why not just use find()? Can a User belong to so many Groups that you
> need to paginate them?
Normally, a user will belong to about 10 groups, but the "moderators"
belong to much more (30-50). Also groups are used only for one year
tops and I would like to keep
Im using the following structure:
User hasMany Listing
Listing hasMany Contacts
Listings hasAndBelongsToMany Articles
Articles hasMany Tags
When i delete a User or a Listing all their associated Listings and
Articles are successfully deleted. But not their Tags. Listings and
Articles are deleted
Hi, folks!
I'm having a problem with Scaffolding with data in different
PostgreSQL schemas.
There are 2 different PostgreSQL schemas with related tables:
- dme
- habitacao
Some habitation's tables has foreign key to dme's tables.
There are 2 different Cake application each one with your own m
I just upgrade from an old 1.2beta version to 1.2.3.8166 but I'm
having a problem with using the remoteFunction now.
This is the code I have:
function new_heading(heading) {
var name = prompt("Enter a heading name", "");
Which controller are you working with? Do you have both Location &
Destination models? How are they associated? What fields/columns do
they have?
If you set up the $data correctly, you should be able to do, eg:
$this->Location->Destination->set($data);
$this->Location->Destination->save();
On
Why not just use find()? Can a User belong to so many Groups that you
need to paginate them?
On Wed, Aug 12, 2009 at 8:49 AM, sunertl wrote:
>
> Hey there,
> after hours of googling and reading tutorials I am desperate now and
> seek your help.
>
> I am working with Cake 1.2.4.8284, I have two mod
Those are really great answers and give me a direction to look to do
more research. Thanks very much for comments!
On Aug 12, 8:53 am, Bart wrote:
> Frederick,
>
> There are many options. To get the best feel you are probably looking
> at some ajax. You can use many different list controls that
It looks to me like a CSS issue. Newlines in the source shouldn't have
any affect at all on how the page renders. Look at the HTML tab in
Firebug and hover the cursor over the surrounding elements in the
source to see the margin/padding. If you click on the tag, you can see
the style rules on the
Hi Josoroma,
Is the error coming from imagick or gd? It would help if you could
post the complete error message and explain with which kind of image
files the error is triggered (or even upload the image somewhere so
that I can reproduce the issue).
Adapters are tried in the order: BasicImage, I
Pass a handle to the helper to your function:
outputMenu($html, $linkTree, $level);
function outputMenu(&$html, $array, $level) {
Even better, have a look at Andy Dawson's TreeHelper. I think it's
precisely what you need for this.
http://bakery.cakephp.org/articles/view/tree-helper-1
Let me k
How are your directories structured? Specifcally, app, webroot, and
the cake (libs) dir.
Look in webroot/index.php for the line:
$Dispatcher = new Dispatcher();
Just above that, put:
die(CAKE_CORE_INCLUDE_PATH);
On Mon, Aug 10, 2009 at 11:15 PM, RAAJ wrote:
>
>
> i have gotten this messege
I doubt that it's a good idea to leave that commented. Try putting
this just above those lines:
die(debug($pathname));
Set debug to 2 and see what that shows. Maybe the path is wrong somehow.
On Wed, Aug 12, 2009 at 12:57 AM, leafchild
book wrote:
> I'm trying to upload to /webroot/img/uploads/
You are missing a few OR in your below text, I have tried it out and
get all the needed OR, did you just keft it out below or what is the
issue?
Oh and by the way of course you will need a WHERE aswell in the first
part $sql = "SELECT * FROM table";
I forgot that one.
On 12 Aug., 17:00, "Dave Ma
@Robert, the .htaccess files were already removed and the App.baseUrl
line uncommented.
@Jonathon, I'm not completely certain what you mean, but I know that
it *was* working. PHP, that is.
I'm actually quite sure that the problem is not with Cake, though. It
probably is due to something else wit
Yeah that's the basic idea to build the "Post.title LIKE '%" . $value. "%'
OR Post.description LIKE '%" . $value . "%' "; string from the user
submitted text
So if there are 3 words it ends up "Post.title LIKE '%" . $value. "%' OR
Post.description LIKE '%" . $value . "%' ";"Post.title LIKE '%" .
I can tell you from experience that you will NOT experience any
significant slowdown. I did just this for a CMS I made with CakePHP
(I'm in the middle of writing a blog post about the process).
Basically, I had a core library with "cms_" prefixed versions of my
controllers and models - so CmsUser
Model::saveField() still requires a valid primary key, which I suspect
he is setting to NULL at the beginning of his method.
On Aug 12, 9:30 pm, eusef wrote:
> If you know which field you need to update perhaps you could try
> using :
>
> saveField(string $fieldName, string $fieldValue, $vali
HI
5.2.4-2ubuntu5.6
Cakephp 1.2.1.8004
I'm confused by a behaviour that cake is exhibiting. I have a site
which some users access from behind a proxy server.
Those users behind the proxy report that they are seing personal
information for users other than themselves.
I examined the headers of
If you know which field you need to update perhaps you could try
using :
saveField(string $fieldName, string $fieldValue, $validate = false)
From
: http://book.cakephp.org/view/75/Saving-Your-Data
GL - Phil
On Aug 11, 8:03 pm, tron wrote:
> I have a problem with one specific controller
Thanks - that worked spot on. In fact I shortened it a bit to:
echo $form->input('listname', array('options'=>array('Please choose a
value') + $mylist));
So simple when you know the answer!
Thank you.
On Aug 12, 4:08 pm, Marcelo Andrade wrote:
> > On Aug 11, 9:21 am, arif hossen wrote:
> >>
hi
i design my html code with XHtml and CSS and add to my cakephp
application but in html view
i have two unwanted white space that don't have any codes in source
view of html output
view image of my page with unwanted white space :
http://s1d4.turboimagehost.com/sp/ec096e69ec1f5ec9d0f5939bf
@James - The code I have up there should produce the error. Throw the
$this-> object reference in front of the html->link() to get the
reference to a non-object error
@Martin - Are you sure you can do that with an object? I think Global
can only be applied to variables, no? I'll try it out of cur
> On Aug 11, 9:21 am, arif hossen wrote:
>> You can use below code cakephp format.
>>
>> >
>> echo $html->input('listname',array('options'=>$mylist,'Selected'=>'Please
>> select a value));
Cake 1.1?
On Wed, Aug 12, 2009 at 2:51 AM, jburns wrote:
>
> This doesn't add a new value to the list, j
I have a properties (as in houses) table and a users table. I have a
number of tables that join these two, for example property_viewings,
property_favourites and property_ratings. The table structures are
quite simple; an id column, property_id, user_id and occasionally some
additional fields. I'd
My first thought, is "would it be possible to upgrade to CakePHP
v1.2.4 to possibly remove any lingering effects of an older code
base?" My second thought is, "If upgrading is out of the question,
did you try 'baking' a very simple MVC based on a test table in your
DB that you can attempt to dupl
That actually has recently been added (clarified) to the cookbook
documentation.
http://book.cakephp.org/revisions/view/9876/Automagic-Form-Elements
"Besides the specific input options found below you can specify any
html attribute (for instance onfocus). For more information on
$options and $htm
I agree with you. It seems the post.id will be better than a none friendly
URL in my case. I will choose the other way to implement this and it really
wast me a lot of time. Robert, thanks for your suggestion.
On Wed, Aug 12, 2009 at 9:44 PM, Robert P wrote:
>
> If a character is not URL-friendl
Hi Dave,
Maybe not the nicest solution, but this should work:
$i=0; // This is your counter
// Now build your SQL String
$sql = "SELECT * FROM table";
foreach ($string as $key => $value)
{ $value = trim($value);
//strip white space befor and
Sure, it's (afaik) undocumented, but it can be done:
create('Bacon');
$colours = array(
array('name' => 'Red', 'value' => '#F00', 'style' => 'background-
color: #F00'),
array('name' => 'Green', 'value' => '#0F0', 'style' => 'background-
color: #0F0'),
array('name' => 'B
you should take a look at my ideas a couple of weeks ago
http://www.cakephpforum.net/index.php?showtopic=1588
i am almost finished with this plugin
(as i had the same intention you have - keeping the work at a minimum,
especially with multiple sites to work with)
my ideas go a little bit further
Yes that was what I meant, but I probably wasn't clear enough.
But I don't understand why it should do even that. clearCache() with
no filename does that already. Why would I want the "fallback"
behavior of - if 'cachefile' does not exist then delete every other
cache file - in the view directory
That doesn't look too bad... quite nice actually. I might have to give
it a try some day soon.
thanks.
On Aug 12, 9:45 am, David wrote:
> Thanks for the tip Martin - I think I've worked it out.
>
> First I overrode the Debugger class in a new class called TDebugger,
> which I saved in app/ven
Frederick,
There are many options. To get the best feel you are probably looking
at some ajax. You can use many different list controls that will give
you the browse feel. As far as using html there are options there
too.
For example, you could turn your title or name field into an edit
link. Ju
nothing easier than that with jquery:
$("td.clickMe").dblclick(function() {
...
});
On 12 Aug., 15:41, Ian R wrote:
> On Aug 12, 9:02 am, FrederickD wrote:
>
> > I'm sorry my post was not more clear. I know in things Internet-
> > related there is no double-click like in a local application. H
If a character is not URL-friendly without being encoded, then in my
mind it serves no purpose in a clean URL. If you are running an
internationalised multi-lingual website then is it not feasible to
rely on something other than a localised URL segment to serve the
content?
Surely something like
On Aug 12, 9:02 am, FrederickD wrote:
> I'm sorry my post was not more clear. I know in things Internet-
> related there is no double-click like in a local application. However,
> I cannot figure out how to have a row in a list of users (from /users/
> index.ctp), or even an attribute within that
Not out of the box, no.
There's nothing stopping you creating a ColourPickerHelper of your own
though.
On Aug 12, 1:45 pm, DavidH wrote:
> Hi
>
> Is there any way of passing style settings for each select option when
> using $form->select?
>
> I've a drop down that allows users to choose a col
Hi,
i have to get back to this topic, since I still have not found the
solution. When I print out the $this->data array, i get the below.
So now not forget,
recipe HABTM subcategories
recipe hasMany ingredients
Array
(
[Recipe] => Array
(
[id] => 6
[RecipeUI
I'm sorry my post was not more clear. I know in things Internet-
related there is no double-click like in a local application. However,
I cannot figure out how to have a row in a list of users (from /users/
index.ctp), or even an attribute within that row (perhaps 'username'),
be a hot spot so tha
Yeah what I am trying is the 'LIKE statement with OR between them'. I split
the terms @ ',' into an array , trim the spaces around each word so I am
left strictly with the values. But having a hard time making the search
string to create.
//create an array of search terms if more than 1 was enter
Hey there,
after hours of googling and reading tutorials I am desperate now and
seek your help.
I am working with Cake 1.2.4.8284, I have two models, User (table
users) and Group (table group) where User HABTM Group. The join table
is called groups_users, it contains user_id and group_id and an
a
Hi
Is there any way of passing style settings for each select option when
using $form->select?
I've a drop down that allows users to choose a colour from a long
list. It would be cool(ish) if the each option in the select had the
background-color set to the actual colour.
Thanks
David
--~--~--
I got what you say. Consider multi-language case.
For English, I use following code to make the friendly url
[code]
$string = strtolower($string);
// Any non valid characters will be treated as _, also remove
duplicate _
$string = preg_replace('/[^a-z0-9_]/i', '-
Hello Mark,
is it possible to download the 1.3 branch with the fix, without
Developer Access?
Reijer
On 6 aug, 19:46, mark_story wrote:
> No problem, sorry there was an issue at all. It seems that gwoo has
> pushed the fix, so it should be working now.
>
> -Mark
>
> On Aug 5, 9:09 pm, Isak Ri
Hello,
building multilingual websites is an ongoing process because content
of websites often change.
Therefore translations have to be done for every new release.
Instead of extracting the po files and then translation the file
content I wish to do something smarter.
- keep translations in a db
I use eclipse-pdt. I add cake like a library and I the IDE provide
code completation and phpdoc preview of the selected function or
variable.
If you want to have code completation for a model in the controller
you must declare the variable explicity like $person = new Person();
and comment the lin
That URL looks extremely unfriendly to me. I can understand urlencode
(), but why addslashes() as well?
This has been covered many, many, many times before. For friendly &
clean URLs use:
Inflector::slug($url, '-');
On Aug 12, 8:17 pm, joshua wrote:
> I want to make a friendly url in my app
I want to make a friendly url in my app.
So assume the url likes following:
[code]
var $url = "what's the project name is?";
[/code]
Before I insert this url into database, I want to encode it firstly.
[code]
$url = urlencode(addslashes($url)); //$url
='what%26%23039%3Bs+the+project+name+is%3F'
[/
Hi Josh,
With that sort of code, you'd be better off putting it in your own
helper. That helper can load its own helpers, so doing links wouldn't
be a problem.
This thread:
http://groups.google.com/group/cake-php/browse_thread/thread/f3a8243e2226c696
deals with this approach, but for radio boxe
Thank you very much.
On Aug 11, 8:25 pm, CobaltShark wrote:
> It would be helpful if you posted the actual code of your find(), but
> it would appear that you are not forming your conditions array
> correctly. I haven't had any issues using LIKE, and maybe this link
> will help :http://book.cake
As soon as you have more than one word, for which to make a search for
within a text, it becomes more complex!
You can do as JamesF wrote, write the find, so each word is included
in a LIKE statement with OR between them.
You can also do as Smelly Eddie wrote, use tags instead, but the
problem is
On Aug 11, 11:06 am, leafchild wrote:
> How can I get "$this->data" has "recursive = 6" data to avoid getting
> "undefined index" error?
I believe i had the same problem as you. Or in my case it was an
overbelief in cakephp :P
What you need to do is to ether re-read the original-data and then
m
Thanks hugely delocalizer and bert and anyone else who reads this. I
am trying to get the site working on Apache locally (I did have it but
the hard disk crashed a couple months ago and I'm struggling hence the
delay).
I hadn't come across debugging PHP before - sounds very useful. What
is the ge
better yet avvoid storing multiplee values in one field. Create a
reference table (tags) and add those values one per record. It. Will
save the code maintainers sanity down the road
On Aug 11, 11:32 pm, JamesF wrote:
> some fancy combos 'LIKE' and 'OR' in your find conditions array should
> get
Hi ppl,
I have a problem with my app.In particular i have a
locations_controller where i receive some xml data ,which i parse them
and save them in the locations table.The locations table usage is for
cache reasons so i use a 2nd table destinations to save final choices
of user.How can i get the d
I have two tables restaurants n cuisines which are related to each other as
HATBM table
cusinies have certain fixed entries - 54 number
i restarurant can hve any number of cuisines. on baking the application this
came with a multiple select.
since i wanted check boxes i used array( 'type' => 's
No problem :)
For your information - if you do not specify an action in the form-
>create statement, cakePHP default to the add action, which is why
your register form invokes the add action in your controller!
Enjoy,
John
On Aug 12, 11:46 am, armen wrote:
> Thank you man.
> Im a newbie as
Thank you man.
Im a newbie as you could tell.
-Armen
On Aug 12, 1:07 am, John Andersen wrote:
> Thanks Armen,
>
> Your register.ctp is missing the action parameter in the form->create
> statement! Compare it with the login.ctp, where it is correctly
> specified!
>
> As soon as you specify the re
Perfect - thank you.
On Aug 12, 8:26 am, Robert P wrote:
> After reviewing /cake/libs/view/helpers/number.php try:
>
> $number->currency($property['Property']['price'], 'GBP', array
> ('places' => 0));
>
> If the documentation doesn't answer your question, the source will.
>
> On Aug 12, 1:5
Thanks Armen,
Your register.ctp is missing the action parameter in the form->create
statement! Compare it with the login.ctp, where it is correctly
specified!
As soon as you specify the register action in the form->create
statement, it will invoke the register action in your controller!
Best wi
I don't know how you do it James. I just did a quick test in a view
and defining a function inline in the view will not provide that
function with access to the local variables outside the function
($html, $form...)
One ugly way of making it work is to make a global reference to the
html helper (
Thanks for the tip Martin - I think I've worked it out.
First I overrode the Debugger class in a new class called TDebugger,
which I saved in app/vendors:
App::import('Core', 'Debugger');
class TDebugger extends Debugger {
function handleError($code, $description, $file = null, $line = n
If it's showing the correct values when viewing but not when saving,
then the form might be submitting to /employees/edit and not to /
employees/edit/:id as you're presuming.
1. Does it work if you remove the line ($this->Employee->id = $id)?
2. Replace pr() with debug(). What is the output in ea
I don't think that will slow things down significantly. Cake caches
paths (in debug=0) and locations of classes.
Logically the more directories php has as include paths the more time
an include will take but that is also very little extra time and
probably hardly measurable in this case.
/Martin
After reviewing /cake/libs/view/helpers/number.php try:
$number->currency($property['Property']['price'], 'GBP', array
('places' => 0));
If the documentation doesn't answer your question, the source will.
On Aug 12, 1:56 pm, jburns wrote:
> I'd like to take a number and display it as curre
Excellent, that will really help to keep my code clean.
Thanks a lot for your answers,
nIcO
On 11 août, 17:13, Martin Westin wrote:
> If you start adding more functions you may want to put them into a
> separate file.
> The top of my bootstrap.php looks like this:
>
> // This would mess things
94 matches
Mail list logo