Re: cakephp dynamic databases.

2010-10-05 Thread Alexandru Ciobanu



Wish I know same way to initialize Session but I don't.


ClassRegistry::init('SessionComponent', 'Component');

The Sessions constructor doesn't like something here, but this gives you 
a starting point. :-)


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Extremely slow > 5000 ms response time with Cake PHP, please help

2010-10-02 Thread Alexandru Ciobanu

 On 10/1/2010 1:05 PM, eJobba wrote:

It's taking the script more than 5000 ms to load from a blank page,
whereas afterwards it instantly loads (our developer managed to
improve this, but did not find the reason for the slow response time).


For the CakePHP Core processing speed a good start is Matt's article[1] 
on Xdebug.

For web performance you'll have to check the usual suspects[2][3].
For everything else there's google :-)

[1] 
http://www.pseudocoder.com/archives/2007/04/24/how-to-really-use-xdebug-to-speed-up-your-app/

[2] http://code.google.com/speed/page-speed/docs/rules_intro.html
[3] http://developer.yahoo.com/performance/rules.html

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: What's the "@" in front of @$this->params['controller']?

2010-09-16 Thread Alexandru Ciobanu

 On 9/16/2010 6:27 PM, psybear83 wrote:

Hi all

I haven't done PHP coding for several years now, and I wonder what's
the "@" in front of some statements I found in the view of our web
application:

@$this->params['controller']

Thanks a lot for help
Josh



http://www.php.net/manual/en/language.operators.errorcontrol.php

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Can't find post

2010-07-29 Thread Alexandru Amititeloae
Hello, i've starded a post a few days ago and i can't seem to find it. It
was something related to time helpers nice() function, and i was looking
forward to other users responses cand u help me ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Last.FM API, DataSource

2010-07-13 Thread Alexandru Ciobanu

 On 7/12/2010 1:46 PM, Linuus wrote:

Hi!

I found this today: http://github.com/m3nt0r/last.fm-datasource-for-cakephp
and wanted to try it out. I'm very new to CakePHP.

I just can't get this datasource to work. I keep getting this error:
"Fatal error: Call to undefined method HttpSocket::buildUri() in /
Applications/MAMP/htdocs/app/models/datasources/lastfm_source.php on
line 573"


I think you're trying this on CakePHP 1.3.x.

buildUri in 1.3.x has an _ (underscore) in front to denote it's 
protected,  so the line 573 should read $sock->_buildUri.


Open up cake/libs/http_socket.php for details.

Other changes might be needed too, I haven't read the entire Last.FM class.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Relevance of PHP5.2 / 5.3 to Cake 1.2/1.3

2010-07-04 Thread Alexandru Ciobanu

On 7/4/2010 6:19 PM, CapeTownGuy wrote:

  However PHP 5.3 is a pre requisite
in order to make the leap to CakePHP 1.3.  It is unfortunate that alot
(probably the majority) of Cake users will be tied to 1.2 for yet
another while, while the future is really happening at Cake 1.3
onwards and this creates a rift between the two.

   


PHP 5.3 is not required to run CakePHP 1.3.x

http://book.cakephp.org/view/908/Requirements

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Problem with form creation after upgrade to 1.2.7

2010-06-19 Thread Alexandru Ciobanu



So let me rephrase the question : how can I override the
controller is used in the form's url  ?
   


create('CautareProduseVechi',array('url'=>'/new_admin/
cautare_produse_vechis/cautareProduseVechi',  'id' =>  
'CautareProduseVechiAddForm'));


http://api.cakephp.org/class/form-helper#method-FormHelpercreate

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Find all Posts WITHOUT Tags (habtm)

2010-06-03 Thread Alexandru Ciobanu

On 5/24/2010 5:55 PM, designv...@gmail.com wrote:

Hi All,

I'm currently finding all Posts without Tags by querying the join
table and getting the unique Post id's then using them in a second
query on the Posts table to find all Posts with an id NOT in the first
array.

What I was wondering is if there was a neater/caker way of doing this?
   


Stumbled upon the same thing, here's my solution... cake friendly.

Project HABTM Invoice

$projects = $this->Project->find('list', array(
'conditions' => array('InvoicesProject.invoice_id' => null),
'joins' => array(
array('table' => 'invoices_projects',
  'alias' => 'InvoicesProject',
  'type' => 'left',
  'conditions'=> array('InvoicesProject.project_id 
= Project.id'))

)
  ));

Using 1.3.0 btw.

HTH

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: migrate from 1.2.3 -> 1.2.6

2010-02-05 Thread Alexandru Ciobanu

On 2/4/2010 9:18 PM, Alexandru wrote:

i sow some migration guided for 1.2.4 and 1.2.5 but now i can't find
them anymore because track cake move to another platform.
anyone know where are the old migration guides?

   
Alex, you don't need migration guides. Anyone on this list can confirm 
that such an upgrade is painless.

Make a backup and give it a try.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: migrate from 1.2.3 -> 1.2.6

2010-02-04 Thread Alexandru
i sow some migration guided for 1.2.4 and 1.2.5 but now i can't find
them anymore because track cake move to another platform.
anyone know where are the old migration guides?

On Feb 4, 4:41 pm, Alexandru Ciobanu  wrote:
> On 2/4/2010 3:28 PM, Alexandru wrote:> i want to migrate from 1.2.3 ->  1.2.6 
> but i do not find anymore the
> > migration guides for 1.2.3 ->  1.2.4 and 1.2.4 ->  1.2.5
>
> > can anyone help me ?
>
> Assuming you have a standard CakePHP installation here are the steps I
> would take:
>
> 1. Backup
> 2. Switch debug to 2
> 3. Replace cake folder with new one and see what breaks.
> 4. Fix issues.
> 5. Write an article about my experience and post it on bakery. :-)
>
> If you didn't hack the cake core you'll have no problem.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: migrate from 1.2.3 -> 1.2.6

2010-02-04 Thread Alexandru Ciobanu

On 2/4/2010 3:28 PM, Alexandru wrote:

i want to migrate from 1.2.3 ->  1.2.6 but i do not find anymore the
migration guides for 1.2.3 ->  1.2.4 and 1.2.4 ->  1.2.5

can anyone help me ?
   
Assuming you have a standard CakePHP installation here are the steps I 
would take:


1. Backup
2. Switch debug to 2
3. Replace cake folder with new one and see what breaks.
4. Fix issues.
5. Write an article about my experience and post it on bakery. :-)

If you didn't hack the cake core you'll have no problem.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


migrate from 1.2.3 -> 1.2.6

2010-02-04 Thread Alexandru
i want to migrate from 1.2.3 -> 1.2.6 but i do not find anymore the
migration guides for 1.2.3 -> 1.2.4 and 1.2.4 -> 1.2.5

can anyone help me ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


migration guide 1.2.3 -> 1.2.6

2010-02-04 Thread Alexandru
when 1.2.4 was lunched i sow a migration guide from 1.2.3 -> 1.2.4,
same when 1.2.5 i sow one for 1.2.4 -> 1.2.5
and i was planing to move to 1.2.5 from 1.2.3 folowing those 2 quides
but when i wanted 1.2.6 was released and now i do not find anymore
migration guide for 1.2.3 -> 1.2.4 and 1.2.4 -> 1.2.5.

anyone can tell me where i have to look for migrate from 1.2.3 to
1.2.6 ?
tks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: return tree node from find('threaded')

2010-01-29 Thread Alexandru Ciobanu

On 1/29/2010 8:35 AM, cricket wrote:

But I surely do not have the last word on this. Maybe someone else
knows a better way.

My best advice: go with MPTT.
   



The same table is used in another part of the application (non-CakePHP), 
and has to remain exactly like it is.

I cannot go MPPT, hence this thread.

Thanks for the array of ids idea. I'll give it a try.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: return tree node from find('threaded')

2010-01-28 Thread Alexandru Ciobanu

On 1/29/2010 1:51 AM, cricket wrote:

http://book.cakephp.org/view/812/find-threaded

Is that what you're looking for?
   

Sort of, but not quite.
The book example uses nested set model, my tree is the basic adjacency 
list (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html).


In other words, I want the same result as the book example having to 
have 'left' and 'right' fields.


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: [HELP PLEASE] Question: HABTM

2010-01-28 Thread Alexandru Ciobanu

On 1/27/2010 2:06 PM, Douglas Pacheco Cardoso wrote:

I have 3 tables:
  - Users
  - Locals -> access locals of the system.
  - Permissions -> Table N:M with the fields (id, user_id, local_id, 
_add, _read, _delete, _update)


I created a page for managing permissions, but I have a problem, 
because when I execute saveAll method, is saving only the fields: 
user_id and local_id, not the specific fields.


Anybody have a tip for me?



http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


return tree node from find('threaded')

2010-01-28 Thread Alexandru Ciobanu

Hi guys,

I have a Category model with the following table setup:

http://bin.cakephp.org/view/657815570

Doing a $this->Category->find('threaded') returns the categories tree.

Is there a non-hackish way to return just a tree node?

E.g. return  all children for Category.id='3'


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Eclipse + PDT 2.1 - How to include the Cake core application

2010-01-14 Thread Alexandru Ciobanu

On 1/14/2010 12:03 PM, hasentopf wrote:


Can anyone explain how I can include the Cake core application in my
projects???

Many thanks!
   


I'm using Build id: 20090920-1017.
Project -> PHP Include PATH -> Libraries -> Add External Source 
Folder... -> select Core location -> Done.


HTH.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Accessing Parent Record Data

2010-01-14 Thread Alexandru Ciobanu

On 1/14/2010 8:08 AM, emptywalls wrote:

That did it! Thanks so much! Took a little figuring out, but I see
what ya did there.
   

After you get a hang of the Containable behavior you'll never use 
anything else.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Accessing Parent Record Data

2010-01-13 Thread Alexandru Ciobanu

Use containable in your song model:

var $actsAs = array('Containable');

 var $belongsTo = array(
'ParentSong' => array(
'className' => 'Song',
'foreignKey' => 'parent_id',
));

When retrieving records contain ParentSong.

E.g.

$this->find('all', array('contain' => array('ParentSong')));

http://book.cakephp.org/view/474/Containable
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: ORM Help -> Unable to save related table information

2010-01-13 Thread Alexandru Ciobanu

On 1/13/2010 4:10 AM, koala kid wrote:


$this->Rental->saveAll($this->data)

   

http://book.cakephp.org/view/75/Saving-Your-Data

It's all there.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to setup 3 distinct Layouts: Public / UserLoggedIn / AdminLoggedin ?

2010-01-11 Thread Alexandru Ciobanu

On 1/9/2010 10:16 PM, kyle wrote:


LAYOUT1: (public no auth required): Homepage + BlogArticles + Login
LAYOUT2: (user logged into system): User Homepage + Links to the parts
of the backend System
LAYOUT3: (admin user): Admin Homepage + Links to edit and manage all
aspects of system


   

This is actually very simple in cake.

Write your layouts in views/layouts/ .
In your app_controller beforefilter() check for logged in user and set 
the desired layout:


E.g.
$user = $this->Auth->user('group_name'); // or whatever

if($user == 'user'){
$this->layout = 'layout3';
}elseif($user == 'admin'){
$this->layout = 'layout2';
}else{
$this->layout = 'layout1';
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: html->link() and html tags

2009-11-04 Thread Alexandru Ciobanu

On 11/4/2009 12:23 PM, kicaj wrote:
> $html->link(''. __('text', true) .''), '#');
- you're not echoing this;
- you have a syntax error there;
- you're escaping the link title;

For CakePHP 1.2 use:
echo $html->link(''. __('text', true) .'', '#', array(), 
false, false);

For CakePHP 1.3 use:
echo $html->link(''. __('text', true) .'', '#', 
array('escape' => false), false);

http://api.cakephp.org/class/html-helper#method-HtmlHelperlink

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with advanced setup

2009-10-14 Thread Alexandru Ciobanu

On 10/14/2009 8:37 AM, Dave Maharaj :: WidePixels.com wrote:
> I am trying to re-arrange the folders on the server
>
> I would like to place cake folder outside www directory
>
Here's my setup:

I've placed the 'cake' folder in /usr/share/cakephp-1.2.5/

And edited app/webroot/index.php:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
 define ('CAKE_CORE_INCLUDE_PATH', 
DS.'usr'.DS.'share'.DS.'cakephp-1.2.5');
}

This way I can use same CakePHP for multiple application, over multiple 
accounts;

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: I have problem in search.

2009-10-14 Thread Alexandru Ciobanu


> Hi,I have problem in search.
> // in the model
> function doSomething() {
> $this->query('select * from basicdetail');
> }
>
> // in the controller
> function searchtry(){
> return $this->MyModel->doSomething();
> }
> but in searchtry.ctp I can't get my data, I've checked through
> logerror and I got that my for loop is running under .ctp but I'm not
> getting data
>
>

You have to set your data for your view.

This would make more sense in CakePHP:

Model:

function search(){
 $results = $this->find('all', array(...));
 return $results;
}

Controller:

function searchtry(){
 $this->set('results', $this->Model->search());
}

View:

foreach($results as $result){
 echo $result['Model']['field0'];
 ...
}

See:
http://book.cakephp.org/view/10/Understanding-Model-View-Controller
http://book.cakephp.org/view/73/Retrieving-Your-Data
http://c7y.phparch.com/c/entry/1/art,mvc_and_cake


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP sites for pitching the CakePHP framework

2009-10-06 Thread Alexandru Ciobanu

On 10/6/2009 5:47 PM, foldiman wrote:
> I have a chance to pitch using CakePHP as the framework for a very
> large project. However, I'm being asked to provide real world examples
> of commercial Cake sites. I found the "Cake in the wild list".
> However, I'm curious if there are any more high-profile sites like
> rockstargames.com, addons.mozilla.org, missuniverse.com, etc.
>

hotscripts.com

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: paginator

2009-10-01 Thread Alexandru Ciobanu

On 10/1/2009 11:08 AM, persianshadow wrote:
> hi
>
> i use paginator in my view but  $paginator->numbers() method only show
> 9 number in view
>
> i want increase number in view.i change numbers options but don't get
> anything.
>
>

http://api.cakephp.org/class/paginator-helper#method-PaginatorHelpernumbers


$pagination->numbers(array('modulus' => 12));

This will display 12 pages on each side of the current page instead of 
the default 8.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Sort returns 1?

2009-10-01 Thread Alexandru Ciobanu

On 10/1/2009 5:28 AM, Dave Maharaj :: WidePixels.com wrote:
> My bad
>
> The array is more complex than I originally posted.
>
> So I need Program and Skill sorted alphabetically
>
> Array
> (
>
>  [Program] =>  Array
>  (
>  [0] =>  After School Studies
>  [1] =>  Gym
>  [2] =>  Creative Writing
>  )
>
>  [Skill] =>  Array
>  (
>   [0] =>  Cohghol
>   [1] =>  Shit
>   [2] =>  Thfghfdgh
>   [3] =>  Zoo
>   [4] =>  Alfred
>   [5] =>  Michelle
>  )
>
>
>
> )
>
> How can I do this?
>
> Program and Skill are merged arrays. I tried sorting them after the merge
> but same thing... Still produced 1
>
> $sorted = array_merge ($new_data, $selected);
> //$area is the array value Program or Skill in this case so it inserts the
> data into Program or Skill
> $new_selections = Set::insert($all_selections, $area, $sorted);
>
>
>
$program = array('After School Studies', 'Gym', 'Creative Writing');
$skill = array('Cohghol', 'Shit', 'Thfghfdgh', 'Zoo', 'Alfred', 'Michelle');

$merged = array_merge($program, $skill);

natsort($merged);

var_dump($merged);

Sort functions return boolean. In your case:
$sorted = sort($merged);

After this line $sorted will be boolean and $merged will be sorted.

php.net/sort
php.net/natsort

HTH


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using too much memory/cpu/resource

2009-09-20 Thread Alexandru Ciobanu

On 9/20/2009 9:55 PM, Miles J wrote:
> On my current host I was on a shared environment and would constantly
> get an "internal error" message. After contacting my host they said I
> was using way too many resource/memory/cpu on the shared environment.
> So I upgraded to a dedicated private server and can now see my usage
> graphed.
>
> On average my CPU uses 100mb, while it does spike up to 200/250mb.
> However my memory usage on average is 300-400mb and spikes up to
> 600mb, and has even reached 900mb. Its costing me quite a bit of money
> to keep running these servers for these resource amounts.
>
> Anyone have any ideas how to optimize cake? Or fix memory leaks? Or
> which caching engine would be a good fit to fix this problem? Etc?
>
>
Matt has a great set of tips just for that:
http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/

He also has a great Lazy Loader plugin for cakephp which I've started to 
use on all my projects:
http://github.com/mcurry/lazy_loader

If you still have problems after applying the above you most certainly 
have to tweak your sql server: queries without indexes, slow queries, etc.
This requires a bit of reading, but it's worth it.

Fast googleing I've found this bash script which (teoretically) helps 
you tune your MySQL configuration. (I haven't used it.)
http://www.day32.com/MySQL/tuning-primer.sh
http://www.day32.com/MySQL/

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Top Contributors

2009-09-20 Thread Alexandru Ciobanu
On 9/20/2009 7:33 PM, Dave Maharaj :: WidePixels.com wrote:
> How can this be done.
> Users create Posts...now I want to get a list of top 10 Posters (users 
> who have made the most posts).
> How would you do the conditions => array() for this? How can I get a 
> list of Users when the User.id is unknown or all of them?
>
Assuming that Post BelongsTo Users and that you have a user_id field in 
the posts table, your posts model will have this method:

function top_posters($count = 10){
 return $this->find('all', array('fields' => 
array('Post.user_id', 'COUNT(Post.user_id) AS posts_count'),
 
 
'conditions' => array('Post.user_id NOT' => ''),

 'group' => array('Post.user_id'),

 'order' => array('posts_count DESC'),

 'limit' => $count));
 }

This method will return an array containing user ids and posts count 
order by post count, but you already figured that out.

HTH,
Alex.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to bake the cake in windows ?

2009-09-17 Thread Alexandru Ciobanu

On 9/17/2009 5:02 AM, Barney wrote:
> all I found is under command line,how to bake the views in windows?
>
>
The bake script is a command line utility. See the screencast on how to 
set it up on windows OS.

http://cakephp.org/screencasts/view/6

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Saving data when many models are in use.

2009-09-08 Thread Alexandru Ciobanu

On 9/8/2009 9:08 PM, hmvrulz wrote:
>
> i am using many models on the same controller. i have to save the data to the
> db.
>
> this is the view.
>
> http://pastebin.com/mbbb68f
>
> as u can see am using many models like [B]Rating[/B], [B]Timing[/B]
> [B]Review[/B] etc. This is just a small part of the form.
>
> In the controller i have added a add() method like this. which is kinda
> crooked code :(  is there a better way of saving these ?
>
> http://pastebin.com/d9d90df3
>
teknoid has enlighten me about a similar issue.

http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-working-with-multiple-models/
http://teknoid.wordpress.com/index.php?s=saveall

I believe you're looking for something like it.

HTH.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: architecture question

2009-09-08 Thread Alexandru Ciobanu

On 9/8/2009 9:23 PM, brian wrote:
>
> Anyway, so, if I have members, non_members, and meetings tables, I
> figure that I can then create a meetings_attendees table. Basically,
> the attendee can be either a member or a non_member. Should I go with
> a schema like this?
>
> This seems like a kludge, at best (if not broken). Can anyone suggest
> a better approach?
>
> -
>
Hi brian,

I would go with something like User -> belongsTo -> Group, Meeting -> 
HABTM or HasMany -> Users.
I would create 2 groups (members & visitors) and add users accordingly.

HTH
P.S.: Email me off list if you want a hands on example.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Complex model associations, pagination and containable

2009-09-03 Thread Alexandru Ciobanu

On 9/3/2009 9:04 PM, martinp wrote:
> Hello
>
> Is this possible?
>
>   $this->paginate['Model1'] = array(
>   'contain' =>  array(
>   'Model2' =>  array(
>   'Model3',
>   'Model4'
>   )
>   ),
>   'conditions' =>  $conditions
>   );
>   $rows = $this->paginate('Model1');
>
> And if it is why is my code not working?
>
> Model2 belongs to Model1
> Model3 and Model4 belong to Model2
>
>
Yes, it's possible. Here's an example I'm using:

$this->paginate = array('conditions' => array('Ad.status' => 1, 
'category_id' => $category['Category']['id']),
  'contain' => array('Image', 'State', 
'Country', 'Child' => array('Image')));
$this->set('ads',$this->paginate('Ad'));

Ad HABTM Child
Image belongsTo Child

Everything you need to know is in the manual ;-)

HTH

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hi, my server admin in not loving changes.

2009-08-27 Thread Alexandru Ciobanu

On 8/26/2009 1:27 PM, Cosmin Paul wrote:
> Hi,
>
> I am a programmer from a 7 gays team, and I have recently finisher my module.
> When I uploaded my work to "stage one server", I have a bug in sql
> query generated by cake:
>
"guys", right? :-)
> It appends the model name to an alias
> MortgageDetail`.(`interest_only_rate + 0 `) as interest_only_rate,
> . This is wrong but it is fixed on latest releases of Cake.
>
> On the server we got  1.2.1.8004 and I use on my devel machine 1.2.4.8284.
>
> This is a common bug, or my code is not ok ?!
>
I haven't seen your code; I can't say.
>
> Can some one give me some argument why we should keep the old release
> ?! and haw can I resolve this problem in the old release ?
>
>
>
I don't see any argument to keep 8004.

https://trac.cakephp.org/wiki/changelog/1.2.x.x/8120
https://trac.cakephp.org/wiki/changelog/1.2.x.x/8166
https://trac.cakephp.org/wiki/changelog/1.2.x.x/8284

Show your sysadmin the above changelogs. There are way too many fixes 
and improvements to mention them in one e-mail.

P.S.:  CakePHP code has been moved to git. Details here: 
http://code.cakephp.org/


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why do users keep redirecting to the home page on login?

2009-08-25 Thread Alexandru Ciobanu

On 8/25/2009 3:14 PM, DavidH wrote:
> Hi All
>
> I'm still trying to put together a login system of admin and normal
> users. It's pretty much working OK; but for some reason I can't fathom
> when a user logs in they don;t get refdirected to the page specified
> in Auth->loginRedirect(). Instead they end up back at the app root
> page.
>
Set autoRedirect to false, it defaults to true.

e.i. $this->Auth->autoRedirect = false;

http://api.cakephp.org/class/auth-component


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: internationalization in model

2009-08-11 Thread Alexandru Ciobanu

On 8/11/2009 10:16 PM, tobi_one wrote:
> Hi,
>
> for future reference, this is IMHO the most elegant solution for this
> problem:
>
> http://cake.eizoku.com/blog/?p=30#comment-8
>
> Cheers,
> tobi_one
>
> On Jul 29, 4:07 am, "Dr. Loboto"  wrote:
>
>> With Model::invalidate() method reload you do not have such problems
>> at all.
>>
>> On Jul 29, 12:17 am,tobi_one  wrote:
>>
>>  
>>> Hi,
>>>
>>  
>>
>>> It works great, but there is one problem. I set the language of the
>>> app in the beforefilter of the app_controller. Apparently the models
>>> are loaded before this and so the models always return the default
>>> language.
>>>
>>  
>>> Where do you guys set the language of the app? Especially if you are
>>> using the __contruct method as mentioned in the post from above.
>>>
>
Why not use 'error' in the input() option array?
http://api.cakephp.org/class/form-helper#method-FormHelperinput

I believe it was designed for this purpose. Perhaps a cake developer can 
confirm/infirm this.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cPanel shared hosting

2009-08-11 Thread Alexandru Ciobanu
On 8/11/2009 9:23 AM, brian wrote:
> That seems like a good method for this instance, where there isn't
> (likely) to be a bunch of other Cake apps floating around. So, no need
> to make the libs shareable.
>
FYI:
For shared cake libs I use the setup described in the book.
http://book.cakephp.org/view/35/Advanced-Installation
Basically I just edit the |CAKE_CORE_INCLUDE_PATH.
|

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cPanel shared hosting

2009-08-10 Thread Alexandru Ciobanu

On 8/10/2009 6:03 AM, brian wrote:
>
>
> To complicate things, I need to access this other site through an IP,
> not a domain. If anyone has done this, could you please post some
> hints?
>
>
Hi Brian,

I've deployed several cake apps on cPanel shared hosting. Nothing to be 
customized, just drop the entire application in public_html or www ( in 
most cases a symlink to public_html).

Resulting tree:

$ ls public_html/
app/
cake/
.htaccess
index.php



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Web hosting company advice

2009-08-06 Thread Alexandru Ciobanu

On 8/5/2009 4:05 AM, Veoempleo wrote:
> Hello,
>
> I'm developing an app with cake. Now I have the app in a web hosting
> of Cirtex company, but the latency is very high.
>
> What is your experience with your web hosting company? Could you
> advice me a web service company?
>
>
>
If you're looking for a VPS/collocated/dedicated server:
I've been using GalaxyVisions services for over 3 years now. Excelent 
service, great tech support and really nice guys overall.
http://www.galaxyvisions.com



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Internal error always

2009-08-03 Thread Alexandru Ciobanu

On 8/3/2009 11:15 PM, Miles J wrote:
> Yeah I am. Besides that does anyone know the reasoning behind it?
>
When I had these issues tech support always said 'heavy load'. Please 
note that I'm only relaying my case here... this may not apply to you.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Shared code in models

2009-08-03 Thread Alexandru Ciobanu

On 8/3/2009 3:13 PM, ge...@dinnerbooking.com wrote:
> Is there an easy way to share code in models.
>
> I have some common code that most of my models use. I like to have a
> single file with that code.
>
> How can I do that?
>
>
>
Place it in your app_model, all model classes extend it.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change default start opage with cakephp

2009-08-03 Thread Alexandru Ciobanu

On 8/3/2009 4:21 PM, Abraham Boray wrote:
> Exactly what I needed ,but in this case I'm not dealing with Apache
> Server , I want to achieve that with CakePHP core !!
> It may be there some function or trick to perform in order to make
> INDEX.HTML my startup page  =)
>
Custom route perhaps?

Router::connect('/index.html', array('controller' => 
'your_controller_here', 'action' => 'your action'));

More detailed info about what you're trying to do would be nice too :-)

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Change default start opage with cakephp

2009-08-02 Thread Alexandru Ciobanu

On 8/3/2009 12:15 AM, Abraham Boray wrote:
> How Can I change the default start page default.php to
> default.html ,so my html page will load first
>
> nb:my html page is located in webroot the same as default.php of cake
> php that notify users about database status and ...
>
>
I'm not sure of this but I'm taking a wild guess. You want change your 
DirectoryIndex order. If so you'll have to edit your apache config. and 
change the "DirectoryIndex" directive to fit your needs.

See http://httpd.apache.org/docs/2.2/mod/mod_dir.html for more info.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Internal error always

2009-08-02 Thread Alexandru Ciobanu

On 8/3/2009 1:19 AM, Miles J wrote:
> So on one of my sites, www.sc2armory.com, myself and the users would
> always get the internal error error about 5 times a day. Anyone know
> why this is caused and how I can prevent this?
>
This is a dreamhost account, right?
I used to get this error from dreamhost and netfirms accounts. I moved 
my business to other hosters and haven't seen that error since.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session time out automatically

2009-08-02 Thread Alexandru Ciobanu

On 8/2/2009 12:24 PM, arif hossen wrote:
>
> Dear All,
>
> How i can set session time in cakphp.Because my site session time out 
> automatically .I can not understanding ,how i will solve it. .Please 
> give me suggestion
>

http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables

[quote]Session.timeout Base session timeout in seconds. Actual value 
depends on Security.level.
Security.level The level of CakePHP security. The session timeout time 
defined in 'Session.timeout' is multiplied according to the settings 
here.[/quote]

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Render Xml

2009-07-15 Thread Alexandru Ciobanu

On 07/14/2009 04:29 PM, Paulos23 wrote:
>
> How i can take these data from the array[] and print them like this
> for example?
> name:Barcelona
> lat:...
> lng...
>
Given $i is the name of your array.

foreach($i['Geoname'] as $parent){
 foreach($parent as $key => $child){
 echo $key, ': ', $child;
 }
}

PS: Look into arrays; lots of resources available.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Containable grabbing too much data

2009-06-26 Thread Alexandru Ciobanu

On 06/26/2009 12:59 AM, Miles J wrote:
> 'dependent' =>  true,
>
Try setting dependent to false.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Deep find, how to tell cake to follow all relations?

2009-06-11 Thread Alexandru Ciobanu

On 06/11/2009 03:27 PM, doze wrote:
> Could you give me an example based on my situtation?
>
Something like this.

$serviceTypeFieldList = $this->ServiceTypeField->find('all', 
array('conditions' => array('your conditions array here'),
'contain' => 
array('ServiceType' => array('Service'),
   
'ServiceTypeFieldValue')));

Please note that this is just an example, adjust to your needs.



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Deep find, how to tell cake to follow all relations?

2009-06-11 Thread Alexandru Ciobanu

On 06/11/2009 02:15 PM, doze wrote:
>
> and that does not work as the Service table isn't bound to the
> relations and it cannot find Service.id or Service.name. What I'm
> doing wrong? How can I tell cake to join Service to the find too?
>
>
>
Looks like a Containable job.

http://book.cakephp.org/view/474/Containable

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Add global function to parse content

2009-05-26 Thread Alexandru Ciobanu

On 05/26/2009 08:10 PM, Benedikt R. wrote:
> Hmm... I forgot to mention, that I want to read seperate templates
> from files and place them at this position. So this will be too much
> code. I need a seperate function that does that.
>
Global function should go in your bootstrap.php.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Add global function to parse content

2009-05-26 Thread Alexandru Ciobanu

On 05/26/2009 07:57 PM, Benedikt R. wrote:
> Hey!
>
> Is there a way to add a global function (which can be called either
> from the layout, a view or a controller) that parses a string?
>
> For example:
> I have a string that contains an article: "Lorem ipsum dolor sit amet,
> consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
> labore et dolore magna aliquyam erat, sed diam voluptua."
>
> Now I want to create a function, that replaces the word 'consetetur'
> in this string. How do i accomplish that?
>
>
str_replace not good enough?

http://php.net/str_replace


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Poll: what do you hate about CakePHP?

2009-05-20 Thread Alexandru Ciobanu

On 05/20/2009 10:20 AM, Constantin Botnari wrote:
> Smelly i totally agree with you :) and for all haters of php4 support
> in cake : people php4 support is vital for an framework !!! that means
> i can develop my cake app for any php version starting from php4 an
> ending with php5! its a real pain for an developer if he has to
> develop an web app and production server is built with php4..
>
PHP4 support was nice (not vital) one year ago, now it's pretty much 
useless...
As of 2008-08-08 the PHP team completely ignores PHP4; this means not 
even critical security fixes.
If you still use PHP4 on production servers your framework might not be 
your biggest problem :-)


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: generating slug from title - must be unique! (using sluggable-1.1.3)

2009-05-13 Thread Alexandru Ciobanu

On 05/13/2009 06:23 PM, mig_akira wrote:
>
>
> $conditions = array($Model->alias . '.' .
> $this->__settings[$Model->alias]['slug'] =>' LIKE ' . $slug . '%');
>
>
I can't recall when the change was made but your code won't work with 
any recent cakephp releases.

It should be:

$conditions = array($Model->alias . '.' . 
$this->__settings[$Model->alias]['slug'].  ' LIKE ' => $slug . '%');

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Poll: what do you hate about CakePHP?

2009-05-08 Thread Alexandru Ciobanu

On 05/08/2009 01:29 AM, Nate wrote:
> I'll get us started: PHP 4 support.
>
>
+1  PHP 4

Library independent AJAX helper (i've noticed it's under development in 
the 1.3 branch)








--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: debugger.php errors when $persistentModel = true

2009-04-28 Thread Alexandru Ciobanu

On 04/28/2009 09:11 AM, gianpaulo wrote:
> Hi,
>
> I tried including $persistentModel = true as suggested here :
> http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/comment-page-1/
>
> Well it did increase the speed of my app (about 200%) but I'm
> receiving this error when debug != 0
>
> Catchable fatal error: Object of class __PHP_Incomplete_Class could
> not be converted to string incake\libs\debugger.php on line 451
>
>

I had a similar issue with PHP > 5.2.
This is a result of the fact that in 5.2 it is no longer possible to 
print an object e.g. "print $myObject". Instead, this will call to 
__toString(), which, if it does not exist, will cause the code to die 
with a catchable fatal error.

I've fixed it by adding a __toString() to my app_controller

E.i.
 public function __toString(){
 return "Needed to print an object";

 }
Googleing your error will help you more :-)

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tips for cutting queries and load time?

2009-04-24 Thread Alexandru Ciobanu

On 04/24/2009 05:08 PM, Dave Maharaj :: WidePixels.com wrote:
>
> Can someone provide info on how to speed things up beyond what I have been
> doing?
>
I don't know what you have been doing but here's Matt's '8 Way for speed'
http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to generate .mo file

2009-03-13 Thread Alexandru Ciobanu

K3 wrote:
> What i would like to do is to allow the client to change msgid and
> msgstr in the .po file and geneerate .mo file. This way they can
> update translation withouth asking me to change .po/.mo files manualy.
> While .po file is plain text and its easy to update it, i coudlnt find
> a way to generate .mo file from updated .po file.
>
>   
Hi K3,

If you're hosting on a GNU/Linux server you can install gettext and use 
something like:

exec('/path/to/msgfmt /path/to/input/default.po -o 
/path/to/output/default.mo');

I did not actually tried this, but it should work.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Twitter - component / model / datasource

2009-03-08 Thread Alexandru Ciobanu

hellfish wrote:
> @teknoid
>
> Good example, actually it's the only one I've seen of a Datasource but
> I'm affraid that it's a bit to much for me.
>   
Hello hellfish,

After playing around with the Twitter component from bakery I decided to 
write a twitter datasource based on it.
http://bakery.cakephp.org/articles/view/twitter-datasource

HTH.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: routes regex

2009-03-06 Thread Alexandru Ciobanu

Alfredo Quiroga-Villamil wrote:
> Btw, I think I might have missed a digit in that regex:
>
> /\w+-\w+-\w+-\d+-\+-\d+-\w+-\w+/
>
>
>   
Thanks Alfredo.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



routes regex

2009-03-05 Thread Alexandru Ciobanu

Hi guys,

I'm having some trouble with custom routes.

I'm trying to match /asus-eee-pc-900-+-2-gb-ram/1521

My line for this in routes.php is:
Router::connect('/product-details/:slug/:id', array('controller' => 
'store', 'action' => 'view_product', 'id', 'slug'), array('id' => 
'[0-9]+','slug' => '[A-Za-z0-9_\-\.\,\+]+', 'pass' => array('id', 'slug')));

For some reason "\+" (literal plus sign) is ignored.

Can anyone shed some light?

Thanks.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Tracking Element Views

2009-02-26 Thread Alexandru Ciobanu

Jesse wrote:
>
> My initial though was to put the tracking code on the controller, but
> there is a possibility that I or another developer could miss putting
> the function call in before it was sent to the view. If it's in the
> element there is no way it will every be missed.
>
> Advice?
>
>   
Hi Jesse,
I did something similar using the IncrementBehavior from bakery.
http://bakery.cakephp.org/articles/view/increment-behavior

HTH.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Twitter - component / model / datasource

2009-01-29 Thread Alexandru Ciobanu

hellfish wrote:
> Interacting with twitter and services like these using cake should be
> done
> Using a model, datasource or component?
>   

Component.
http://bakery.cakephp.org/articles/view/twitter-component

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to count users login?

2009-01-21 Thread Alexandru Ciobanu

Henrique Machado wrote:
> I need to provide an access count to my users
>
> Like "This is you 4 time here"
>
> I'm using the Auth component, my doubt is where put my
>
> $this->User->updateAll(array('User.access'=> 'User.access+1'), 
> array('User.id' => $user['User']['id']));
>
> I need to be sure that the user is logged successfull to increment the 
> access.
>
Perhaps an increment behavior will help you.

http://bakery.cakephp.org/articles/view/increment-behavior

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: new to cakephp

2009-01-16 Thread Alexandru Ciobanu

sasikumar a wrote:
> my upcoming projects all cakephp so i want to learn cake plz anyone
> guide me.
>
>   
http://book.cakephp.org/view/4/Beginning-With-CakePHP

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Updating AROS for USER when changing the User Group.

2009-01-14 Thread Alexandru Ciobanu

sijo jose wrote:
> Hi all,
>
> I have been stuck at two places.
>
> 1. This is regarding User and his corresponding.
> Actually I have a User who is assigned a Group 'xx' while he is 
> created. But at a later stage I would like to regroup him to a Group 
> 'yy'. Simply changing the User group is not working sice I think the 
> corresponding AROS is not getting updated. How would I  update the 
> AROS regarding this.
>
> 2. I would like to populate the database with some Users when my site 
> gets to production. This is also because AROS is not being populated.
>
http://book.cakephp.org/view/641/Simple-Acl-controlled-Application

Everything you need it's right here.

Acl behavior will help you with the updates: 
http://book.cakephp.org/view/645/Acts-As-a-Requester


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



plugin schema generation

2009-01-13 Thread Alexandru Ciobanu

I'm trying to get my plugins schema into SVN. Is there a way to 
accomplish this?
Can one generate schema files for plugins?




--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Working with cakePHP on Eclipse - PDT 2.0

2009-01-08 Thread Alexandru Ciobanu

RichardAtHome wrote:
> I've never needed a build path for PHP :-)
>
> Here's how I do CakePHP dev with PDT:
>
> 1) Unzip cake to c:\htdocs\projects\my_project
>
> 2) Open up eclipse
>
> 3) Select workspace: c:\htdocs\projects\
>
> 4) Create a new project called "my_project"
>
> 5) Get coding.
>
>   
I use the same method. You can get different 'tweaks' (autocomplete for 
models/views, ) on bakery:
http://bakery.cakephp.org/articles/view/setting-up-eclipse-to-work-with-cake

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Deleting from multiple models

2009-01-03 Thread Alexandru

yes it is. check http://book.cakephp.org/view/80/hasOne for dependent
key
dependent: When the dependent key is set to true, and the model’s
delete() method is called with the cascade parameter set to true,
associated model records are also deleted. In this case we set it true
so that deleting a User will also delete her associated Profile.

On Jan 3, 9:56 pm, "rhythmicde...@gmail.com" 
wrote:
> I have a model Recipe that has a one to many relationship with a model
> IngredientList
>
> I want to delete a single recipe from the Recipe model which should
> also delete all the records from the IngredientList model that have
> the recipe's ID.
>
> I would have thought that there would be a single line command like
> there is for insert.
>
> if ($this->Recipe->saveAll($this->data))
>
> But this is only way I could find to do it:
>
>         function delete($id)
>         {
>                 $this->IngredientList->deleteAll("IngredientList.recipe_id = 
> $id",
> true);
>                 $this->Recipe->del($id);
>                 $this->flash('The recipe with id: '.$id.' has been deleted.', 
> '/
> recipes');
>         }
--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom Query Result

2008-12-30 Thread Alexandru Ciobanu

piyushsharmajec wrote:
> I have Project model in which function is as 
>
> function getMsgCount($id)
>   {
>   $this->id = $id;
>   
>   return $this->query("SELECT count(*) as countval FROM 
> messages where
> project_id=$id AND status='1'");
>   }
>
>   
function getMsgCount($id){
$this->find('count', $conditions);
}
> In Project Controller code is..
>
> function getCount($id = null)
>   {
>  $numval = $this->Project->getMsgCount($id);
>$this->set('numval',$numval);  
>  $this->redirect(array('action'=>'index'));
>   }
>   
function getCount($id){
$this->set('numval', $this->Project->getMsgCount());
}
> How to get result in view file? if i can pass numval through url or directly
> access variable. Please help! 
>
>
>   
Not tested. Might not work but will get you started.
http://book.cakephp.org/view/73/Retrieving-Your-Data


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: count no of rows.

2008-12-27 Thread Alexandru Ciobanu

majna wrote:
> tipo :(
> $count = $this->Project->Message->findCount(array
> ('Message.project_id'=>$MyProjectId));
>   

findCount() is deprecated. Use find('count') instead.
http://book.cakephp.org/view/73/Retrieving-Your-Data

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



auth::redirect rc4 bug RFC

2008-12-25 Thread Alexandru

they changed the code of redirect function in rc4 and now u get a
notice when u use this method to set a new redirect for auth .
i think the corect line 676 should be : return $this->Session->write
('Auth.redirect', $url);
because if no return is there u will get a notice for undefined $redir
for return Router::normalize($redir);
--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: png background images

2008-12-22 Thread Alexandru Ciobanu

remy wrote:
> The page of pathf refers to the twinhelix site which I already
> mentioned in my first post, but the solution of Google works for me.
>   
I used IE7 js, but not for backgound images, so I wasn't sure :-)
I'm glad you solved your issue.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: png background images

2008-12-21 Thread Alexandru Ciobanu

remy wrote:
> Hi all,
>
> I'm looking for a solution to use png background-images in cakephp for
> IE6.
>
>   
http://code.google.com/p/ie7-js/
http://www.pathf.com/blogs/2008/04/hacking-transpa/

HTH


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: basic email via contact form

2008-12-21 Thread Alexandru Ciobanu

http://www.google.com/search?q=cakephp+contact+form

Check out first 2 hits.



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wizard Component 1.2 and admin routing

2008-12-17 Thread Alexandru Ciobanu

Smelly_Eddie wrote:
> This would probably be a question better left for the page you
> included :)
>
>
>   
I've found a solution.
And included on the mentioned page ;)


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Integration of Sphinx Search with CakePHP

2008-12-16 Thread Alexandru Ciobanu

bookme wrote:
> Thanks Alexandru,
>
> I looked your links. First link is for plugin and second for sphinx
> behaviour. Second link is useful for me but commenting inside in this
> not in english so it's difficult to implement for me.
>
> Can you provide me some other links?
>
>   
google translate:

http://translate.google.com/translate?hl=en&sl=ru&u=http://habrahabr.ru/blogs/php/41702/&sa=X&oi=translate&resnum=7&ct=result&prev=/search%3Fq%3Dcakephp%2Bsphinx%26hl%3Den%26sa%3DG

basically you just add 
|

var $actsAs = array('Sphinx');

to your model.

In your controller you can call it like this:

||

$sphinx = array('matchMode' => SPH_MATCH_ALL, 'sortMode' => 
array(SPH_SORT_EXTENDED => '@relevance DESC'));

$results = $this->Film->find('all', array('search' => 'search string', 'sphinx' 
=> $sphinx));

|
|
More:
|

http://www.google.com/search?hl=en&q=cakephp+sphinx&btnG=Google+Search&aq=f&oq=



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cake 1.2 forms: date fields left empty => null in database?

2008-12-16 Thread Alexandru Ciobanu

Sebastian Göttschkes wrote:
> Hi,
>
> i got the following problem using cakePHP 1.2 RC3:
>
> My Model 'Employee' has a attribute called 'birthday' (datatype:
> DATE). In the add-view, I have the following code:
> input('birthday',array('type'=>'text'));?>
> If i left this field blank when adding an employee, this employee has
> the birthday '-00-00' saved in the database. I would rather like
> the birthday having the null-value, because -00-00 is no valid
> birthday.
>
>   
Set the date field to NULL
|ALTER TABLE `employees` CHANGE `birthday` `birthday` DATE NULL;

IIRC

HTH
|

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Integration of Sphinx Search with CakePHP

2008-12-16 Thread Alexandru Ciobanu

bookme wrote:
> Hi,
>
> I want to implement Sphinx Search with my CakePHP website.
>
> Some days back I saw one article on cake bakery
> http://bakery.cakephp.org/articles/view/sphinx-behavior but now
> it's  not displaying  and giving  message "Unable to provide the
> article you requested because it is currently pending approval for
> publication".
>
> Is there any tutorial or help so that I can integrate Sphinx Search
> with my cakephp application?
>
> Thanks
>
>   
http://github.com/namelessnotion/sphinx-cakephp-plugin/wikis/home

http://habrahabr.ru/blogs/php/41702/

HTH


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Wizard Component 1.2 and admin routing

2008-12-16 Thread Alexandru Ciobanu

Hi,

I'm trying to use jared's Wizard component with admin routing but can't 
seem to figure it out.
http://bakery.cakephp.org/articles/view/wizard-component-1-2-1
Anyone done this?


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-16 Thread Alexandru Ciobanu

Snoopaki wrote:
> I found the error, it was on my behalf (as usual).
>
> I had a beforeSave() function in my model that replaced the $this-
>   
>> model->data['file'] value with the tmp_name value of the form. I was
>> 
> not aware that saveField() used $this->model->data['FieldName'] to
> store its value.
>
>   
I didn't know that either.
> I suppose it simply runs a save() function with the fieldList option
> after that.
>
> Anyway, I'm  back to business, thanx for the replies :)
>   
You've answered your own question :-)

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Prepopulating forms via the URL

2008-12-15 Thread Alexandru Ciobanu

acoustic_overdrive wrote:
> I just thought of a little function that I wanted to get some feedback
> on. It's a way to pre-populate a form when adding new records, using
> the URL only and no controller-specific controller logic.
>
> In AppController::beforeRender :
>
> if(isset($_REQUEST['populate'])) {
>   if(empty($this->data)) {
>   $this->data = array();
>   }
>   $this->data = array_merge_recursive($this->data,$_REQUEST
> ['populate']);
> }
>
> then make a link pointing to an ADD form:
>
> /admin/project_images/add?populate[ProjectImage][project_id]=3&populate
> [ProjectImage][name]=blah
>
> What do you think? Not very cakey with that querystring but is there a
> better way to do this?
>
>   
input('ProjectImage.project_id', array('value' => '3'));?>
input('ProjectImage.name', array('value' => 'blah'));?>



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Weird saveField error, UPDATE value gets ...distorted?!

2008-12-15 Thread Alexandru Ciobanu

Snoopaki wrote:
> The first letter of the variable $filename, in my case, as my
> webserver is in C:\wamp\ , it updates the value to just 'C' 
>
>   
\ escapes the rest...
e.g.
C:\\wamp\\ => first \ escapes the second one, so only the last one 
gets printed.

Please paste your moveUploadedFile method.

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Association not producing dropdown list, help! :(

2008-12-15 Thread Alexandru Ciobanu

_Z wrote:
> Now the index.ctp view:
>
> >
>   
>   
>   
>   
>   
>   
>   
>   
> 
>
>   
>   
>   
>
> input('store_table_id'); 
>
>   
You have an unclosed php tag there, but I guess that's a typo.
Here are your options.

Options no.1:
You need to create an actual form for this to work.
e.i
$form->create('Waitlist');
$form->input('store_table_id');
$form->end();

Hiding the unnecessary  fields with CSS would be an option.


Option no.2:

input('store_table_id', array('type'=> 'select', 'options' => 
$store_tables));?>

You're going with option 2, right? :-)


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Association not producing dropdown list, help! :(

2008-12-13 Thread Alexandru Ciobanu

_Z wrote:
> I validated with pr($store_tables); That I am indeed getting back a
> list of tables.
>
> However the echo $form->input('store_table_id'); does not produce a
> dropdown.
>
> Any other ideas or things I need to check?
>   
Like yash said, please paste your controller and view.


--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Association not producing dropdown list, help! :(

2008-12-12 Thread Alexandru Ciobanu

_Z wrote:
> Hello,
>
> I am expecting a dropdown box in my /add action, but only a textbox is
> produced.
>   
In your controller:

$store_tables = $this->Waitlist->StoreTable->find('list');

$this->set(compact('store_tables'));


In your view:

echo $form->input('store_zone_id');



--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Zero values being submitted as NULL into DB.

2008-12-12 Thread Alexandru Ciobanu

andruu wrote:
> SQL LOG
> UPDATE `categories` SET `parent_id` = NULL, `name` = 'Apparel',
> `description` = '', `modified` = '2008-12-12 14:27:13' WHERE
> `categories`.`id` = 7
>
>   
You probably have a NULL default to your DB.

I'm using the Tree behavior with no problem.

Here's my setup:

SQL:

CREATE TABLE IF NOT EXISTS `categories` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `parent_id` int(11) NOT NULL default '0',
  `lft` int(11) NOT NULL,
  `rght` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `active` tinyint(1) NOT NULL,
  `created` datetime default NULL,
  `updated` datetime default NULL,
  PRIMARY KEY  (`id`)
);

The MVC  structure is generated with the bake script.
The only change I've made was to add the behaviour to the model, e.i. 
var $actsAs = array('Tree');

--~--~-~--~~~---~--~~
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, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: location of home.ctp in XP

2008-12-09 Thread Alexandru Ciobanu

bobn wrote:
> For typical web development is the \libs directoery the propoer place
> to editing content?
>
> Should the 'Editing this page' section be changed for XP?
>   
Don't edit cake core. When you'll be upgrading you'll understand why.
> Should I expect directory structure differences for XP as I go through
> the tutorial?
>
>   

Copy cake/libs/view/pages/home.ctp to app/views/pages/home.ctp.

Same thing for layouts.



--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: saving into multiple table with multiple data

2008-12-08 Thread Alexandru Ciobanu

ridwan arifandi wrote:
> in an action, i have to do more than one save action. rule
>
> 1). save data into purchases
> 2). get last insert id from table purchases
>
> 3). save data into items
> 4). get last insert id from table items
>
> 5). save data into purchase_details with those two variables
> ( purchase_id & item_id )
> 6). get last insert id from table purchase_details
>
> 7). save data into item_details with item_id
> 8). get last insert id from table item_details
>
> 9). save data into purchase_item_detail with those two variables
> ( purchase_detail_id & item_detail_id )
>
> so.. i get a problem at rule #3... it cannot save, dont know why, i
> have no error message at my web
>
>   
saveAll()?


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How can I view the screencasts on Linux

2008-12-07 Thread Alexandru Ciobanu

Ed Howland wrote:
> I am having trouble playing the screencasts on the cakephp.org site. I
> am using Ubuntu 8.10 w/FF.
>
> Does anyone have any suggestions?
>
> Thanks
> Ed
>
>   
I'm using the Totem mozplugin to do this on Fedora 10.

On my notebook I'm using mplayer and mozplugger.

If you can't get the videos to play in your browser,look at the HTML 
source, search for the .mov files and play them with your favorite player.

--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: OT: PHP IDE with GIT and SVN Plugins

2008-11-27 Thread Alexandru Ciobanu

Penfold wrote:
> I'm currently using windows but i can swap to linux if there is a IDE
> that can cater for my needs.
> I'm now on the hunt for an OS IDE that can support SVN and GIT, can
> anyone recommend one?
>
>
>
>   
I'm using Eclipse PDT all in one 2.0 (Eclipse 3.4) on Fedora 9 
(upgrading to 10 as I type), which has the features you want.
You can get it here:
http://downloads.zend.com/pdt/all-in-one/

--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Login-help

2008-11-21 Thread Alexandru Ciobanu

rapdev wrote:
> Hi ,
> im new to cakephp,
>
> http://bakery.cakephp.org/articles/view/simple-form-authentication-in-1-2-x-xi
>
> just use this url to create a login , but once  run the code , im
> getting ,
>
>   
Hi rapdev,
Use the Auth Component. It will make your coding way easier.
http://book.cakephp.org/view/172/Authentication

--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help with populating SELECT drop down

2008-11-21 Thread Alexandru Ciobanu

luigi7up wrote:
> @anja
> This solution works fine but I thought I could do it more elegant :)
> thanks
>
> @grigri
> I'll try this... I don't get it at first glance but I'll try it. It
> seems like something worth of try...
> I'll tell you how it went
>
> P.S. Username "griGri" has something to do with climbing device or
> not?
>
>
> On Nov 19, 12:24 pm, grigri <[EMAIL PROTECTED]> wrote:
>   
>> Hi Luka
>>
>> This sounds like a job for Set::combine() :
>>
>> > $options = Set::combine(
>> $product['ProductVariant'],
>> '{n}.id',
>> array(
>> '{0} | {1} - {2}',
>> '{n}.sex', '{n}.size', '{n}.price'
>> )
>> );
>>
>> echo $form->select('variant', $options);
>> ?>
>>
>> hth
>> grigri
>>
>> On Nov 19, 10:42 am, luigi7up <[EMAIL PROTECTED]> wrote:
>>
>> 
>>> Hello I need help with populating drop down select element.
>>>   
>>> I have following data in array $product that is available in my view
>>>   
>>> Array
>>> (
>>> [Product] => Array
>>> (
>>> [id] => 1
>>> [product_category_id] => 1
>>> [user_id] => 26
>>> [title] => Nije Vuk Ovca
>>> [folder] => nije_vuk_ovca
>>> [price] => 85
>>> [special] => 0
>>> [published] => 1
>>> [created] =>
>>> [modified] => 2008-11-07 11:56:06
>>> )
>>>   
>>> [ProductVariant] => Array
>>> (
>>> [0] => Array
>>> (
>>> [id] => 1
>>> [product_id] => 1
>>> [sex] => male
>>> [size] => S
>>> [extras] =>
>>> [price] =>
>>> )
>>>   
>>> [1] => Array
>>> (
>>> [id] => 2
>>> [product_id] => 1
>>> [sex] => male
>>> [size] => M
>>> [extras] =>
>>> [price] =>
>>> )
>>>   
>>> [2] => Array
>>> (
>>> [id] => 3
>>> [product_id] => 1
>>> [sex] => male
>>> [size] => L
>>> [extras] =>
>>> [price] =>
>>> )
>>>   
>>> )
>>>   
>>> 
>>> As you can see Product has it's variants because PRODUCT model hasMany
>>> PRODUCT_VARIANTS.
>>> In my product view I want drop down menu (SELECT) with all variants of
>>> product to be populated in following way:
>>>   
>>
Isn't  $this->Product->ProductVariant->find('list') what you're loooking 
for?

I'm using something similar at http://anunciostotal.net/ads/add to 
populate the subcategories and provinces select boxes.


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Configuring Cake with openSUSE 11

2008-11-18 Thread Alexandru Ciobanu

undbund wrote:
>
>>> AllowOverride FileInfo AuthConfig Limit Indexes
>>>
>>>   
Replace the above line with:

AllowOverride All






--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Configuring Cake with openSUSE 11

2008-11-16 Thread Alexandru Ciobanu

undbund wrote:
> Hi guys,
>
> I was trying to configure Cake with openSUSE 11 but I could not make
> mod rewrite work. I can access the Cake folder in the document root
> (http://localhost/~undbund/cake) but the CSS is not coming on the web
> page correctly. I tried to enable mod rewrite using the following
> tutorial 
> http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/Q_23154913.html
> but it did not work out. There is no one single conf file but many and
> is all controlled by httpd.conf with many includes in this file.
>
>
>   
Most likely your httpd.conf has AllowOverride set to None; SuSE apache 
comes this way, IIRC.
Look for something like this:


AllowOverride FileInfo ... etc ..etc
more directives here...


Set de AllowOverride directive to 'All' (no quotes).
That should do the trick.

You should see the apache manual ( 
http://httpd.apache.org/docs/1.3/mod/core.html#allowoverride ) to know 
what your allowing to override. :-)


--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

no no in rc2 this was on manual
Recipe HABTM Tag  => recipes_tags.recipe_id, recipes_tags.tag_id
BUT now they changed in manual and put this
Recipe HABTM Tag  => id,recipes_tags.recipe_id, recipes_tags.tag_id

now i know for sure it is NOT a BUG.

TOPIC CLOSED
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

in rc2 all worked ok and i had to add some simple code in product
model to work
class AllowedusesProduct extends AppModel {

var $name = 'AllowedusesProduct';
var $useTable = 'alloweduses_products';

function beforeSave(){
$this->id = null;
return true;
}
}
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



HABTM in rc3 need now field id in link table.

2008-10-28 Thread Alexandru

i have a HABTM products->alloweduses

this is the linking table.

CREATE TABLE IF NOT EXISTS `alloweduses_products` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `allowedus_id` int(10) unsigned NOT NULL,
  `product_id` int(10) unsigned NOT NULL,
  `value` enum('yes','no','na') collate latin1_general_ci NOT NULL
default 'na',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `uk` (`allowedus_id`,`product_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
AUTO_INCREMENT=36 ;

if i remove id the edit of product will fail. anyone know about this
bug? there is already an opened ticket?

--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---