If you fallow the naming convetion, conditions should be:
'cp.id = CampaignStoreDate.campaign_id'
AND
'Store.id = CampaignStoreDate.store_id'
Can you send us the resulting SQL? (debug level 2)
Thanks
MARTIN
On 06/21/2010 09:21 AM, rakeshyadav rakeshyadav wrote:
Hi All,
i am
An approach
in the controller:
function show_image($recordId) {
$this->set('data', $this->Model->findById($recordId));
$this->layout = 'ajax'
}
the view show_image.ctp:
Configure::write('debug', 0);
header("Content-type: image/jpeg"); //assume jpg image
echo $data['Model']['blob_file'
2 others work around:
- create a view
- select from a subquery instead quering directly to the table.
Hope this helps.
MARTIN
On 04/26/2010 01:05 PM, jharris wrote:
Okay, so I figured out why I can't reference the alias in the WHERE
conditions: it's just a MySQL restriction.
As for using vi
I would say the problem is in static content encoding then.
Assuming the left menu and content is in the same file, try this:
echo 'Mitarbeiter Test Strange_Character' . '';
echo utf8_encode('Mitarbeiter Test Strange_Character') . '';
echo utf8_decode('Mitarbeiter Test Strange_Character') . '';
So, you have no problem with the editor encoding, nor files enconding.
The problem is with data saved in database or with the way you retrieve it.
Assume you are using mysql.
1) Make sure you have add this to database.php default array config:
'encoding' => 'utf8'
2) Make sure the table coll
Your configuration should work, so must reduce the errors source.
Can you see "special characters" hard coded in html correctly in the page?
I mean, do not use the database
Leave just this in the head and make sure the file is correctly utf-8 saved
- inside my default.ctp layout file:
and inside
|Your question is not clear, I guess you need this:
$this->Model1->Behaviors->attach('Containable');
|
$this->Model1->find('first',
array(
'conditions' => array('Model1.id' => $id),
'contain' => array('Model2' => array('fields' =>
array('Model2.title
try
'recursive' => -1
On 03/26/2010 05:23 PM, amarradi wrote:
I have to correct it because in the that have to be an other value
$this->set('variable', $this->Model1->find('first',array(
'conditions' => array('Model1.id' => $id),
'recursive' =>
up a test case and report the issue of DECODE failing to
function properly.
Thanks for your help Martin!
-Tony
On Thu, Feb 18, 2010 at 11:40 AM, Martin Radosta
mailto:martinrado...@gmail.com>> wrote:
Check the text case in this commit for an example:
http://github.com/cakephp
ollow what you mean by "Try using expression for fields." Can
you clarify or give me an example?
On Feb 18, 11:12 am, Martin Radosta wrote:
CakePhp is not correctly parsing the alias for the decode fields, thats
why you see decode... on array keys.
Try using expression for fields
CakePhp is not correctly parsing the alias for the decode fields, thats
why you see decode... on array keys.
Try using expression for fields. If that works, should also fix the data
missmatch.
Regards
MARTIN
On 02/18/2010 02:38 PM, TonyFugere wrote:
I've search this group and Google for a
better than buildStatement for this case I suggest to use expressions.
This also works with pagination
Hope this helps
MARTIN
On 02/15/2010 02:51 PM, blake wrote:
First, I brief table structure overview:
titles (id, name, etc)
users (id, name, etc)
titles_users (id, title_id, user_id, metad
Check the test case for this new feature:
http://github.com/cakephp/cakephp1x/commit/02330b2d9c292110240c606e976e182c973897e9#diff-1
Some people says this kind of things breaks the MVC pattern. I should be
something like
1) get Section lft.
2) add 1 to this
3) save the result in Section rght.
Try this:
Recipe
Recipe
create('MenuRecipe', array('url'=>'/menus/add_recipe'));
echo $form->input('MenuRecipe.recipe_id', array('value'=>
$recipe['Recipe']['id'], 'label'=>false, 'type'=>'hidden'));
echo $form->input('MenuRecipe.menu_id');
A callback in the controller avoid a broken the MVC pattern.
On 01/28/2010 02:20 PM, Jamie wrote:
Well, it's certainly better than importing the component...
If you want to be strict about it (and I'm not exactly sure how the
method I suggests falls outside of the MVC pattern, since session i
Check this mark-story commit:
http://code.cakephp.org/commits/view/332f6add6a97bdf738f8d1d71106834c82a46dc7#highlight
specialy this line (710):
if (in_array($options['type'], array('date', 'datetime'))) {
was changed by this line (710):
if ($options['type'] === 'date' || $options['type'] === 'd
On 09/27/2009 04:31 PM, brian wrote:
> The comment for setAction() says that it "Internally redirects one
> action to another." However, it doesn't really *redirect* so much as
> simply call the action using call_user_func_array(). It amounts to
> about the same thing, more or less, but there's so
On 09/22/2009 07:30 PM, Steppio wrote:
> Thanks for the response. Basically its a bit like a shopping cart. I
> need a primary key just to keep each entry into the Product Inquiry
> List seperate, for example some of the lines i have in the database at
> the moment are:
>
> ID | User ID |
On 08/28/2009 02:44 PM, vidaubannais wrote:
> Hi,
>
> I have setup my pages to be encoded using utf-8, it works on all my
> pages: extended characters are rendered without pbm (é,à,ö ...)
> however I have bits and pieces rendered as Ajax elements; The content
> of those elements does not seem to p
Let's say I have a view that renders an excel file to download. It
presents a download dialog to the user. This user can decide to save the
file to the local drive, to open the file or to cancel the operation.
Now I need to redirect somewhere else after any operation with the
download dialog.
Before posting a ticket let me know your opinion.
Here is a test case about the problem.
http://bin.cakephp.org/view/622164608
Cake is doing two things bad, but maybe this is the "workform".
1) When binded to a hasMany, it adds the id (or primary key) field to
the query instead of just doing
On 07/12/2009 07:16 PM, Martin Radosta wrote:
> On 07/11/2009 02:06 PM, brian wrote:
>> I have a StatsController with which I'd like to make a summary of all
>> logins and all downloads for each month.
>>
>> class Login extends AppModel
>> {
>> publ
On 07/11/2009 02:06 PM, brian wrote:
> I have a StatsController with which I'd like to make a summary of all
> logins and all downloads for each month.
>
> class Login extends AppModel
> {
> public $belongsTo = array('User');
> public $hasMany = array('Download');
> }
>
> class Downloa
On 07/06/2009 12:48 AM, stZen wrote:
> Not using Auth and the security level is low..
>
> Thanks.
>
> On Jul 5, 10:01 pm, Miles J wrote:
>
>> Are you using Auth at all?
>> Also try setting your session security to medium or low if its not.
>>
> >
>
Try this and give us some feedbac
Dave Maharaj :: WidePixels.com wrote:
> I am trying to generate a 6 character unique id using this in my model:
>
> function generateJobKey()
> {
> // creates a 6 digit key
> $key = substr(md5(uniqid(rand(), true)),0,6);
> //checkto make sure its not a duplcate
>
Set::combine
On Fri, Feb 13, 2009 at 8:06 AM, Sensible wrote:
>
> Hi,
>
> $this->Model->find('list')...works perfactly.
>
> But i have model customer which have two fields firstname and last
> name and
> i want to display concatination of firstname and lastname in list.
>
> So, can any one sugge
try adding the connection to the array
public function testIndex() {
$result = $this->testAction('/news/index', array(
'connection'=> 'test',
'fixturize' => true,
'return' => 'vars'
));
debug($result);
}
On Thu, Feb 12, 2009 at 8:12 AM, Raph w
Try this:
function search($item = null) {
$item = $this->params['url']['q'];
$recipes = $this->Banco->find('all',
array('conditions' => array(
'AND' => array(
'OR' =>array(
'Recipe.name LIKE' => '%' . $item . '%',
28 matches
Mail list logo