DateFormat and date in TimeStamp

2008-06-08 Thread foxmask

Hello,
my database table contain a date in integer to store a timestamp.

When , in my form i write this in my form :
?php echo $form-
input('date',array('type'='date','label'=false,'dateFormat'='DMY'));?


i can get the data like this to store them in my date column:

$m = (integer) $this-data['Calendar']['date']['month'];
$d = (integer) $this-data['Calendar']['date']['day'];
$y = (integer) $this-data['Calendar']['date']['year'];
if ( !checkdate ($m,$d,$y) ) {
$common_warning = __('the date is not a valid',true);
}
else
$this-data['Calendar']['date'] = mktime(0,0,0,$this-data['Calendar']
['date']['month'],

$this-data['Calendar']['date']['day'],

$this-data['Calendar']['date']['year']);


My problem is : when i edit the data from my form,
instead of displaying 08 june 2008
i read :1 january 2028 !

this is the fault of the strtotime function used in the function year
of the form helper...


My Question is : how can i give the Cake the correct format of my date
before displaying the edit form .?

i have tried $this-data['Calendar']['date']  = date(Y-m-d,$this-
data['Calendar']['date']) ;
but that does not do the trick.

Regards.

--~--~-~--~~~---~--~~
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: DateFormat and date in TimeStamp

2008-06-08 Thread foxmask

i found a solution :
in my CalendarController i did :
function edit {
[...]
if (empty($this-data)) {
$this-data = $this-Calendar-read(null, $id);
}
#as CakePHP does not understand a unix timestamp i force the type to
integer thus Cake will see
#it correctly to transform the timestamp in 3 arrays for the date;
$this-data['Calendar']['date'] = (integer) $this-data['Calendar']
['date'];
}



On 8 juin, 18:47, b logica [EMAIL PROTECTED] wrote:
 I think that you might be mixing up timestamps and date strings.
 mktime() returns a UNIX timestamp, which is an integer, being the
 number of seconds elapsed since Ken Thompson  Dennis Ritchie say so.
 While you may have a timestamp column in your DB, it's probably
 serving the data up formatted as a date string, much like a DATETIME
 column.

 2008-06-08 12:25:32 (or 20080608122532) vs 1212942514

 strtotime() can use the former but the latter needs to be converted
 into some kind of date string first.

 In any case, I can't quite understand what it is you need to do.
 Perhaps all of this is unnecessary.

 On Sun, Jun 8, 2008 at 6:57 AM, foxmask [EMAIL PROTECTED] wrote:

  Hello,
  my database table contain a date in integer to store a timestamp.

  When , in my form i write this in my form :
  ?php echo $form-
 input('date',array('type'='date','label'=false,'dateFormat'='DMY'));?

  i can get the data like this to store them in my date column:

  $m = (integer) $this-data['Calendar']['date']['month'];
  $d = (integer) $this-data['Calendar']['date']['day'];
  $y = (integer) $this-data['Calendar']['date']['year'];
  if ( !checkdate ($m,$d,$y) ) {
 $common_warning = __('the date is not a valid',true);
  }
  else
 $this-data['Calendar']['date'] = 
  mktime(0,0,0,$this-data['Calendar']
  ['date']['month'],
 
  $this-data['Calendar']['date']['day'],
 
  $this-data['Calendar']['date']['year']);

  My problem is : when i edit the data from my form,
  instead of displaying 08 june 2008
  i read :1 january 2028 !

  this is the fault of the strtotime function used in the function year
  of the form helper...

  My Question is : how can i give the Cake the correct format of my date
  before displaying the edit form .?

  i have tried $this-data['Calendar']['date']  = date(Y-m-d,$this-
 data['Calendar']['date']) ;
  but that does not do the trick.

  Regards.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Page CakePHP In The Wild

2008-06-04 Thread foxmask

add a link to an open source CMS and to the french cakephp community

Cliquez sur http://groups.google.com/group/cake-php/web/cakephp-in-the-wild
ou copiez et collez le lien dans la barre d'adresse du navigateur si
cela ne fonctionne pas.

--~--~-~--~~~---~--~~
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: Caching System with Language in the file name

2008-05-17 Thread foxmask

i've done some tests and a simple one is in core.php :

Cache::config('default', array('engine' = 'File',
 'path'=
realpath(dirname(__FILE__) .DS.'..'.DS.'tmp'.DS.'cache'.DS.'fr'.DS)
 ));

and when i look into my /home/foxmask/www/tmp/cache/fr/ directory (in
views/persistent/models) everything is still empty.

here it's clearly a bug...


On 17 mai, 01:06, francky06l [EMAIL PROTECTED] wrote:
 I guess Config::language is available in beforeFiler, but not before.
 I never tried to override the Cache::config('default...) in
 beforeFilter, but I do not see any reason this would not work..
 However, I am not sure if in case of a cached view,
 app_controller:beforeFilter is even reached...

 On May 17, 12:45 am, foxmask [EMAIL PROTECTED] wrote:

  Hello,
  i would like to avoid to change something inside cakephp .

  i tried in the core.php file :
  Cache::config('default', array('engine' = 'File','path'=
  dirname(__FILE__) 
  .DS.'..'.DS.'tmp'.DS.'cache'.Configure::read('Config.language')));

  but unfortunatly, Config.language is not set yet at this moment.

  in app_controller.php in beforeRender Config.language is available
  but i dont know if it's the right place to modify the
  Cache::config('default'.)

  So, I really dont understand how a so simple thing cant work

  Anyone get an idea ?

  On 16 mai, 09:42, Filip Camerman [EMAIL PROTECTED] wrote:

   Hi,

   I've had the exact same problem: the cache prefix that you can specify
   in the core config is not used for cached views - which is a major bug
   imo. I solved it by hacking the core in the places where it reads/
   writes cached views, since I absolutely needed this functionality.
   I've described how to do it in the second message of this 
   thread:http://groups.google.com/group/cake-php/browse_thread/thread/62b4d61b...

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



Re: Caching System with Language in the file name

2008-05-16 Thread foxmask

Hello,
i would like to avoid to change something inside cakephp .

i tried in the core.php file :
Cache::config('default', array('engine' = 'File','path'=
dirname(__FILE__) 
.DS.'..'.DS.'tmp'.DS.'cache'.Configure::read('Config.language')));

but unfortunatly, Config.language is not set yet at this moment.

in app_controller.php in beforeRender Config.language is available
but i dont know if it's the right place to modify the
Cache::config('default'.)

So, I really dont understand how a so simple thing cant work

Anyone get an idea ?

On 16 mai, 09:42, Filip Camerman [EMAIL PROTECTED] wrote:
 Hi,

 I've had the exact same problem: the cache prefix that you can specify
 in the core config is not used for cached views - which is a major bug
 imo. I solved it by hacking the core in the places where it reads/
 writes cached views, since I absolutely needed this functionality.
 I've described how to do it in the second message of this 
 thread:http://groups.google.com/group/cake-php/browse_thread/thread/62b4d61b...

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



Caching System with Language in the file name

2008-05-15 Thread foxmask

Hi,
as CakePHP is able to detect the language of the visitor on the
website, i would like to use the cache and put the language in front
of the cache filename like this :

tmp/cache/views/fre_articles_index.php

actually i have

tmp/cache/views/_articles_index.php

What happens actuallay  ?

when an english guy comes the first on the index of the articles
plugin ; he generates the cache for a given time.
during this time if a french guy comes ; he reads an english content.

This is why i would like to use Configure::read('Config.language') at
the right place .
I thought i 've found it in libs/cache.php ( function write ) by using
the prefix parameter of the config cache in the core.php file but that
does not do the trick.

So can someone give me a tips to be able to fix this issue ?
Or do i have to open a ticket on trac.cakephp.org ?

Kind Regards?


--~--~-~--~~~---~--~~
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: Caching System with Language in the file name

2008-05-15 Thread foxmask

Hi Francky,
no i dont know it depends on the visitors.
but i am always interesting in any idea to reach my goal ;)
regards.
On 16 mai, 01:41, francky06l [EMAIL PROTECTED] wrote:
 Well, I have solved this in another way, but depends if you know the
 languages you are handling .. I mean, I have applications in
 production, that are supporting up to 3 languages. In such case, it's
 quite easy, you define 1 cache config per language (ie: en_conf,
 fre_cong, ru_conf). Then in all cache operation you can pass the
 config name using the Config:language.
 I understand this does not cover all your needs, especially with the
 caching of views .etc ..
 hth

 On May 15, 10:11 pm, foxmask [EMAIL PROTECTED] wrote:

  Hi,
  as CakePHP is able to detect the language of the visitor on the
  website, i would like to use the cache and put the language in front
  of the cache filename like this :

  tmp/cache/views/fre_articles_index.php

  actually i have

  tmp/cache/views/_articles_index.php

  What happens actuallay  ?

  when an english guy comes the first on the index of the articles
  plugin ; he generates the cache for a given time.
  during this time if a french guy comes ; he reads an english content.

  This is why i would like to use Configure::read('Config.language') at
  the right place .
  I thought i 've found it in libs/cache.php ( function write ) by using
  the prefix parameter of the config cache in the core.php file but that
  does not do the trick.

  So can someone give me a tips to be able to fix this issue ?
  Or do i have to open a ticket on trac.cakephp.org ?

  Kind Regards?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Starbox with CakePHP.

2008-04-15 Thread foxmask

I saw in this post
http://groups.google.com/group/cake-php/browse_thread/thread/fc6927c768d743c0/165d40eb845faa70?lnk=gstq=starboxutoken=_OMNxCsAAAB94UAlaOjWovwvAR_0zjZXHAAmJKq-OJ6hgFYeyBeUiehFHpEPJkSjXQgT9j0zljY
that someone spoke about Starbox with CakePHP.

Can someone provides us some example on how to use Starbox with
CakePHP ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Checkbox with array ( Cakephp 1.2 )

2008-02-25 Thread foxmask

Hello,
i would like to use the form help to migrate this :

lilabelinput type=checkbox name=p_fids[] value=?php echo
$forum['Forums']['id']? class=checkbox ?php echo $options ? /?
php echo $forum['Forums']['forum_name']; ?/label/li

where
$options is the result of


if ( in_array($forum['Forums']['id'],$p_fids ) )
$options = 'checked=checked';

i have tried this
echo $form-input('p_fids[]',
array(
'div'=false,
'label'=$forum['Forums']['forum_name'],
'type'='checkbox',
'before' = 'li',
'after' = '/li',
'value' = $forum['Forums']['id']
)
);

but when i submit the form ; with the Security component ; i'm falling
in the blackhole :(

Thank you for your help

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Checkbox with array ( Cakephp 1.2 )

2008-02-25 Thread foxmask

Hello,
can someone help me with the FormHelper and an array of checkboxes ?
Regards.

On 25 fév, 22:51, foxmask [EMAIL PROTECTED] wrote:
 Hello,
 i would like to use the form help to migrate this :

 lilabelinput type=checkbox name=p_fids[] value=?php echo
 $forum['Forums']['id']? class=checkbox ?php echo $options ? /?
 php echo $forum['Forums']['forum_name']; ?/label/li

 where
 $options is the result of

 if ( in_array($forum['Forums']['id'],$p_fids ) )
 $options = 'checked=checked';

 i have tried this
 echo $form-input('p_fids[]',
 array(
 'div'=false,
 'label'=$forum['Forums']['forum_name'],
 'type'='checkbox',
 'before' = 'li',
 'after' = '/li',
 'value' = $forum['Forums']['id']
 )
 );

 but when i submit the form ; with the Security component ; i'm falling
 in the blackhole :(

 Thank you for your help

 Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 to test that adatabase table exists ?

2008-01-20 Thread foxmask

Hello
nobody to give a suggestion ?

On Jan 18, 9:39 pm, foxmask [EMAIL PROTECTED] wrote:
 Good evening,
 I would like to test if my database table exists or not
 If no,   i will display a message to suggest to install the software
 If yes,  i will Route::connect()  to the main page of the software.

 I digged on the Model::Schema() but i dunno how to use it nor if it's
 the well way to do the trick.

 kind regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 combine CakePHP + ExtJS?

2008-01-12 Thread foxmask

on my side i get the grid and the string :
{total:2, users:[{username:foxmask, title:,
realname:}, {username:Invité, title:, realname:}]}

display just after the grid .



On Jan 11, 11:15 pm, hydra12 [EMAIL PROTECTED] wrote:
 OK, the forms tutorial is up now.  You can find it 
 here:http://www.ntatd.org/mark/?p=31. Have a great weekend!

 On Jan 11, 8:38 am, hydra12 [EMAIL PROTECTED] wrote:

  That's what it's supposed to do.  getAllUsers just returns a json
  string with data from the database.  Now call myroot/users/index.  It
  should show a datagrid with all the json data in it.  The way it works
  is this: index is pretty much blank, but it loads myScript.js (or
  whatever you named it).  myScript.js calls getAllUsers on line 17:

   proxy: new Ext.data.HttpProxy({url: 'http://'+host+'/ext/users/
  getAllUsers'}),

  When you call index, it should call getAllUsers and load the data
  returned into your store.  When you render your datagrid, it pulls
  data from the store and puts it in the grid.  The fact that you are
  getting the json string when you call getAllUsers directly means
  you're on the right track.  Let me know if I can help.

  BTW, I'm about 1/2 way done on a forms tutorial . . .

  hydra12

  On Jan 11, 8:13 am, inma [EMAIL PROTECTED] wrote:

   Thank you Hidra12!

   I read your datagrid tutorial for ext-2.0.

   I'm using ext-2.0 and CakePHP 1.2 Beta, too.

   But when I call to myroot//users/getAllUsers, it shows that:

   {total:8, users:[{id:6, username:archangel,
   fullname:Worthington, Warren}, {id:2, username:cyclops,
   fullname:Summers, Scott}, {id:8, username:gambit,
   fullname:LeBeau, Remy}, {id:1, username:hydra12,
   fullname:Buckner, Mark}, {id:5, username:iceman,
   fullname:Drake, Bobby}, {id:3, username:nightcrawler,
   fullname:Wagner, Kurt}, {id:7, username:storm,
   fullname:Munroe, Ororo}, {id:4, username:wolverine,
   fullname:Logan}]}

   On 10 ene, 21:37, hydra12 [EMAIL PROTECTED] wrote:

OK, I did some searching and found this 
thread:http://groups.google.com/group/cake-php/browse_thread/thread/32d4c152...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



webroot change dynamically ?

2008-01-12 Thread foxmask

Good evening

On windows with WampServer my webroot does not change.
but on linux here is what's happened :
when i'm on http://www._.com/ the webroot value is /
when i'm on http://www._.com/news the webroot value is /home/
foxmask/cakephp/ (the directory where cakephp is installed)

What's the matter ?

how can i defined the webroot correctly definitivly ?
Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 combine CakePHP + ExtJS?

2008-01-10 Thread foxmask

i tried to repeat the step of your example with ext 1.1.1 here is my
ajax.ctp


!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=?php
__('lang_iso_code') ?
lang=?php __('lang_iso_code') ? dir=?php __('lang_direction') ?

head
title
?php echo pt_portal_title . ' - ' .$title_for_layout;?
/title

?php echo $html-charset(__('lang_encoding',true));?

link rel='StyleSheet' href='?php echo $this-base ?/js/ext-1.1/
resources/css/ext-all.css' /
?php echo $javascript-link('ext-1.1/adapter/ext/ext-base'); ?

?php echo $javascript-link('ext-1.1/ext-all-debug'); ?

?php echo $javascript-link('myScript'); ?
body/head
body
div id=grid-panel
div id=grid-paging style=border:1px solid
#99bbe8;overflow:hidden; width: 665px; height: 00px;/div
/div
?php echo $content_for_layout; ?
?php echo '{total:'.$total.', users:'.$javascript-
Object($users).'}'; ?
/body
/html


i think i made a mistake because that display the content of
{ ... } ...



On Jan 9, 8:02 pm, hydra12 [EMAIL PROTECTED] wrote:
 I'm working on a new version of my tutorial that works with 2.0.  I'll
 try to get it done soon, depending on my work schedule.

 hydra12http://www.ntatd.org/mark

 On Jan 9, 12:23 pm, DjZoNe [EMAIL PROTECTED] wrote:

  Hi inma,

  I started to write here a little help, but it became bigger as I
  expected.
  So I rather posted into my blog:http://djz.hu/blog/posts/689

  --
  DjZoNe

   Hi,

   I'm newbie in CakePHP and ExtJS. I'm developing a new application with
   CakePHP, and I want to integrate the ExtJS forms into this
   application. I was looking some posts about it.

Nevertheless, I don't know how to match Cake model, controller and
   view with ExtJS exactly. :-(

Can someone post an example (basic example) with this combination
   (cake model, controller and view with ExtJS)?

   Thanks a lot.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 combine CakePHP + ExtJS?

2008-01-09 Thread foxmask


I'd like it too

As the example provided concerned extjs1.1 and does not work anymore
with extjs 2.0.

Kind regards

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Route::Connect and Plugins

2008-01-03 Thread foxmask

i think the better will be to dump my setting database table in
bootstrap.php doesnt it ?

On Jan 2, 5:49 pm, foxmask [EMAIL PROTECTED] wrote:
 Hello

 In the routes.php i cant know what is the default route to the default
 plugins at this moment.
 At the startup of my app i read the database to find which is the
 default plugin to point to but when i write this in my main
 app_controller.php :

 public function beforeFilter() {
 #defining const
 $this-appInit-startup($this);
 #use the const to point to the default plugins
 #here echo pt_default_module  display 'news' !
 Router::connect('/',array('plugin'=pt_default_module ,'controller'
 = pt_default_module, 'action' = 'index'));

 }

 i got the error :

 Missing controller
 You are seeing this error because controller Controller could not be
 found.
 Notice: If you want to customize this error message, create app\views
 \errors\missing_controller.ctp
 Fatal: Create the class below in file: app\controllers\controller.php

 ?php
 class Controller extends AppController {
var $name = '';}

 ?

 which means that cakePHP does not know the default plugin i'm trying
 to route to.

 instead, i waited :

 ?php
 class NewsController extends AppController {
var $name = 'News';}

 ?

 any tips to be able to define the default route at this moment ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Configure::store in the same file used by Configure::load

2008-01-03 Thread foxmask

Hello,
everything is in the subject
How can I store the data i wirte with Configure::write in the same
file i loaded with Configure::load ?

As i can see, we i use Configure::store() this create a new file in
the cache/persistent/ directory but not in the same file I loaded with
Configure::load()
Is it possible ?

kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Route::Connect and Plugins

2008-01-02 Thread foxmask

Hello

In the routes.php i cant know what is the default route to the default
plugins at this moment.
At the startup of my app i read the database to find which is the
default plugin to point to but when i write this in my main
app_controller.php :

public function beforeFilter() {
#defining const
$this-appInit-startup($this);
#use the const to point to the default plugins
#here echo pt_default_module  display 'news' !
Router::connect('/',array('plugin'=pt_default_module ,'controller'
= pt_default_module, 'action' = 'index'));
}

i got the error :

Missing controller
You are seeing this error because controller Controller could not be
found.
Notice: If you want to customize this error message, create app\views
\errors\missing_controller.ctp
Fatal: Create the class below in file: app\controllers\controller.php

?php
class Controller extends AppController {
   var $name = '';
}
?

which means that cakePHP does not know the default plugin i'm trying
to route to.

instead, i waited :

?php
class NewsController extends AppController {
   var $name = 'News';
}
?

any tips to be able to define the default route at this moment ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Forum Incubator

2007-12-29 Thread foxmask

Hello,
I'm integrating punBB in one project
i'm saying mylself i could integrate several forum softwares by
creating an interface class (in Java term) that will be more
appropriate, no ?
If so how in cakephp do we make an interface ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Will CakePHP be able to survive as the Zend Framework matures?

2007-12-17 Thread foxmask


 That said - I don't see any *one* framework becoming an industry
 standard in PHP world
in France, Symfony seems to be this one in the professional world (i
mean, used in companies).

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Plugins and RequestAction Issues

2007-12-16 Thread foxmask

i've a controller
app/controller/reports_controller.php (which count warns to be
displayed of not)
that is used in
app/view/elements/top.ctp like that :

$reports_lists = $this-requestAction('/reports/
index',array('return'=false));

if (!empty($reports_lists['nb_report']))
   $tpl_temp .= \n\t\t\t\t.'li class=reportlinkstronga
href=admin_reports.php'.__('new warnings',true)./a/strong/
li';

echo $tpl_temp;

this works well until i dont do http://localhost/articles where
articles is a plugins... (app/plugins/articles/)

i have the foloowing error message :

You are seeing this error because the action reports is not defined in
controller ArticlesController
If you want to customize this error message, create app\views\errors
\missing_action.ctp.
Fatal: Confirm you have created the ArticlesController::reports in
file : app\controllers\articles_controller.php.
?php
class ArticlesController extends AppController {
   function reports() {
   }
}
?

but of course reports is not a method of Articles but a controller
itself.

i also tried to specify the route to make understand for the
requestAction where to find the stuff :

Router::connect('/reports/*', array('controller' = 'reports',
'action' = 'index'));
Router::connect('/articles/*',
array('plugin'='articles','controller' = 'articles', 'action' =
'index'));

but that does not work too.

if i dont use articles as a plugins and let stuff is app/controllers
app/views app/models everything is ok, but i need plugins as i have a
lot of little app that has to be dispatch as plugins.

What can i do to make this work ?

Kind Regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Plugins and RequestAction Issues

2007-12-16 Thread foxmask

notice :i use cakephp 1.2.x.x
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Plugins and RequestAction Issues

2007-12-16 Thread foxmask

in cake/libs/object.php i've changed the following

if (isset($this-plugin)) {
#$extra['plugin'] = $this-plugin;
}

and it's working
but i dont think it's the best


On 16 déc, 11:21, foxmask [EMAIL PROTECTED] wrote:
 notice :i use cakephp 1.2.x.x
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 to INNER Join in Model ?

2007-12-07 Thread foxmask

Nice !


On Dec 6, 10:48 pm, nate [EMAIL PROTECTED] wrote:
 ?php
 class ForumPerm extends AppModel {
 var $name = 'ForumPerm';
 var $primaryKey = 'group_id,forum_id';
 //The Associations below have been created with all possible
 keys,
 those that are not needed can be removed
 var $belongsTo = array(
 'Group' = array('type' = 'INNER'),
 'Forum' = array('type' = 'INNER')
 );

 }

 On Dec 6, 12:28 pm, Baz [EMAIL PROTECTED] wrote:

  I'm sorry, I'm a bit lost.

  Could you explain this a lil more?

  On Dec 6, 2007 10:15 AM, nate [EMAIL PROTECTED] wrote:

   On 1.2 you can set the 'type' key in the association, which defaults
   to LEFT.

   On Dec 6, 7:39 am, foxmask [EMAIL PROTECTED] wrote:
Hi  Baz
We suggested me to do this :

in the topics controller :
function lastTopics(){
$sql =
SELECT Topic.id, Topic.subject FROM topics AS Topic INNER JOIN forums
AS Forum ON
Forum.id = Topic.forum_id LEFT JOIN forum_perms AS ForumPerm ON
(ForumPerm.forum_id=Forum.id AND
ForumPerm.group_id='xxx') WHERE (ForumPerm.read_forum IS NULL OR
ForumPerm.read_forum=1)
AND Topic.moved_to IS NULL  ORDER BY Topic.last_post DESC LIMIT 10 ;
$resultset = $this-Topic-query($sql);
return $resultset;

}

and in my element :
$pt_active_topics = $this-requestAction('topics/lastTopics/');

On Dec 5, 9:59 pm, Baz L [EMAIL PROTECTED] wrote:

 I ran into a need for this today.

 In the interest of time, I just trim the array I get back after the
 fact, however...is there someway to do this?
 --
 Baz L
 Web Development 2.0http://WebDevelopment2.com/

 On Dec 1, 1:30 pm, foxmask [EMAIL PROTECTED] wrote:

  gooed evening
  any idea aboutinner join?

  On Nov 29, 12:39 pm, foxmask [EMAIL PROTECTED] wrote:

   Hi i'd like to know what i need to do and in what model, to be
   able to
   use this SQL query

   SELECT t.id, t.subject FROM topics AS tINNER JOINforums AS f ON
   f.id=t.forum_id LEFT JOIN forum_perms AS fp ON 
   (fp.forum_id=f.idAND
   fp.group_id='xxx') WHERE (fp.read_forum IS NULL OR fp.read_forum=1
   )
   AND t.moved_to IS NULL  ORDER BY t.last_post DESC LIMIT 10

   actually this SQL Query :
   SELECT `Post`.`id`, `Post`.`poster`, `Post`.`poster_id`,
   `Post`.`poster_ip`, `Post`.`poster_email`, `Post`.`message`,
   `Post`.`hide_smilies`, `Post`.`posted`, `Post`.`edited`,
   `Post`.`edited_by`, `Post`.`topic_id`, `Topic`.`id`,
   `Topic`.`poster`,
   `Topic`.`subject`, `Topic`.`posted`, `Topic`.`last_post`,
   `Topic`.`last_post_id`, `Topic`.`last_poster`,
   `Topic`.`num_views`,
   `Topic`.`num_replies`, `Topic`.`closed`, `Topic`.`sticky`,
   `Topic`.`moved_to`, `Topic`.`forum_id` FROM `posts` AS `Post` LEFT
   JOIN `topics` AS `Topic` ON (`Post`.`topic_id` = `Topic`.`id`)
   WHERE 1
   = 1 ORDER BY `last_post` desc LIMIT 10

   is produce when i do in my element :

   $pt_active_topics =
   $this-requestAction('posts/index/sort:last_post/
   direction:desc/limit:10');

   here are my models :

   ?php
   class Post extends AppModel {

   var $name = 'Post';

   //The Associations below have been created with all
   possible keys,
   those that are not needed can be removed
   var $belongsTo = array(
   'Topic' = array('className' = 'Topic',

   'foreignKey' = 'topic_id',

   'conditions' = '',

   'fields' = '',

   'order' = '',

   'counterCache' = ''),
   );

   }

   ?php
   class Topic extends AppModel {

   var $name = 'Topic';

   //The Associations below have been created with all
   possible keys,
   those that are not needed can be removed
   var $belongsTo = array(
   'Forum' = array('className' = 'Forum',

   'foreignKey' = 'forum_id',

   'conditions' = '',

   'fields' = '',

   'order' = '',

   'counterCache' = ''),
   );

   var $hasMany = array(
   'Post' = array('className' = 'Post',

   'foreignKey' = 'topic_id',

   'conditions' = '',

   'fields' = '',

   'order' = '',

   'dependent' = ''),
   );

   }

   ?php
   class Forum extends AppModel {

   var $name = 'Forum';

   //The Associations below have been created with all
   possible keys,
   those that are not needed can be removed
   var $hasMany = array(
   'ForumPerm' = array('className' =
   'ForumPerm',

   'foreignKey' = 'forum_id',

   'conditions' = '',

   'fields' = '',

   'order' = '',

   'limit' = '',

   'offset' = '',

   'dependent' = '',

   'exclusive' = '',

   'finderQuery' = '',

   'counterQuery

Re: How to INNER Join in Model ?

2007-12-06 Thread foxmask

Hi  Baz
We suggested me to do this :

in the topics controller :
function lastTopics(){
$sql =
SELECT Topic.id, Topic.subject FROM topics AS Topic INNER JOIN forums
AS Forum ON
Forum.id = Topic.forum_id LEFT JOIN forum_perms AS ForumPerm ON
(ForumPerm.forum_id=Forum.id AND
ForumPerm.group_id='xxx') WHERE (ForumPerm.read_forum IS NULL OR
ForumPerm.read_forum=1)
AND Topic.moved_to IS NULL  ORDER BY Topic.last_post DESC LIMIT 10 ;
$resultset = $this-Topic-query($sql);
return $resultset;

}

and in my element :
$pt_active_topics = $this-requestAction('topics/lastTopics/');




On Dec 5, 9:59 pm, Baz L [EMAIL PROTECTED] wrote:
 I ran into a need for this today.

 In the interest of time, I just trim the array I get back after the
 fact, however...is there someway to do this?
 --
 Baz L
 Web Development 2.0http://WebDevelopment2.com/

 On Dec 1, 1:30 pm, foxmask [EMAIL PROTECTED] wrote:

  gooed evening
  any idea aboutinner join?

  On Nov 29, 12:39 pm, foxmask [EMAIL PROTECTED] wrote:

   Hi i'd like to know what i need to do and in what model, to be able to
   use this SQL query

   SELECT t.id, t.subject FROM topics AS tINNER JOINforums AS f ON
   f.id=t.forum_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND
   fp.group_id='xxx') WHERE (fp.read_forum IS NULL OR fp.read_forum=1)
   AND t.moved_to IS NULL  ORDER BY t.last_post DESC LIMIT 10

   actually this SQL Query :
   SELECT `Post`.`id`, `Post`.`poster`, `Post`.`poster_id`,
   `Post`.`poster_ip`, `Post`.`poster_email`, `Post`.`message`,
   `Post`.`hide_smilies`, `Post`.`posted`, `Post`.`edited`,
   `Post`.`edited_by`, `Post`.`topic_id`, `Topic`.`id`, `Topic`.`poster`,
   `Topic`.`subject`, `Topic`.`posted`, `Topic`.`last_post`,
   `Topic`.`last_post_id`, `Topic`.`last_poster`, `Topic`.`num_views`,
   `Topic`.`num_replies`, `Topic`.`closed`, `Topic`.`sticky`,
   `Topic`.`moved_to`, `Topic`.`forum_id` FROM `posts` AS `Post` LEFT
   JOIN `topics` AS `Topic` ON (`Post`.`topic_id` = `Topic`.`id`) WHERE 1
   = 1 ORDER BY `last_post` desc LIMIT 10

   is produce when i do in my element :

   $pt_active_topics = $this-requestAction('posts/index/sort:last_post/
   direction:desc/limit:10');

   here are my models :

   ?php
   class Post extends AppModel {

   var $name = 'Post';

   //The Associations below have been created with all possible keys,
   those that are not needed can be removed
   var $belongsTo = array(
   'Topic' = array('className' = 'Topic',
   
   'foreignKey' = 'topic_id',
   
   'conditions' = '',
   'fields' 
   = '',
   'order' 
   = '',
   
   'counterCache' = ''),
   );

   }

   ?php
   class Topic extends AppModel {

   var $name = 'Topic';

   //The Associations below have been created with all possible keys,
   those that are not needed can be removed
   var $belongsTo = array(
   'Forum' = array('className' = 'Forum',
   
   'foreignKey' = 'forum_id',
   
   'conditions' = '',
   'fields' 
   = '',
   'order' 
   = '',
   
   'counterCache' = ''),
   );

   var $hasMany = array(
   'Post' = array('className' = 'Post',
   
   'foreignKey' = 'topic_id',
   
   'conditions' = '',
   'fields' 
   = '',
   'order' 
   = '',
   
   'dependent' = ''),
   );

   }

   ?php
   class Forum extends AppModel {

   var $name = 'Forum';

   //The Associations below have been created with all possible keys,
   those that are not needed can be removed
   var $hasMany = array(
   'ForumPerm' = array('className' = 'ForumPerm',
   
   'foreignKey' = 'forum_id',
   
   'conditions' = '',
   'fields' 
   = '',
   'order

CakePHP and PunBB

2007-12-03 Thread foxmask

Hi,

PunBB create a cookie that way :

setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.
$password_hash))), $expire, $cookie_path, $cookie_domain,
$cookie_secure, true);

i dont find how CakePHP could read it.
I've read the cookie component and all i conclude is I need to make my
own Cookie Management
havent I ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from 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 to INNER Join in Model ?

2007-12-01 Thread foxmask

gooed evening
any idea about inner join ?

On Nov 29, 12:39 pm, foxmask [EMAIL PROTECTED] wrote:
 Hi i'd like to know what i need to do and in what model, to be able to
 use this SQL query

 SELECT t.id, t.subject FROM topics AS t INNER JOIN forums AS f ON
 f.id=t.forum_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND
 fp.group_id='xxx') WHERE (fp.read_forum IS NULL OR fp.read_forum=1)
 AND t.moved_to IS NULL  ORDER BY t.last_post DESC LIMIT 10

 actually this SQL Query :
 SELECT `Post`.`id`, `Post`.`poster`, `Post`.`poster_id`,
 `Post`.`poster_ip`, `Post`.`poster_email`, `Post`.`message`,
 `Post`.`hide_smilies`, `Post`.`posted`, `Post`.`edited`,
 `Post`.`edited_by`, `Post`.`topic_id`, `Topic`.`id`, `Topic`.`poster`,
 `Topic`.`subject`, `Topic`.`posted`, `Topic`.`last_post`,
 `Topic`.`last_post_id`, `Topic`.`last_poster`, `Topic`.`num_views`,
 `Topic`.`num_replies`, `Topic`.`closed`, `Topic`.`sticky`,
 `Topic`.`moved_to`, `Topic`.`forum_id` FROM `posts` AS `Post` LEFT
 JOIN `topics` AS `Topic` ON (`Post`.`topic_id` = `Topic`.`id`) WHERE 1
 = 1 ORDER BY `last_post` desc LIMIT 10

 is produce when i do in my element :

 $pt_active_topics = $this-requestAction('posts/index/sort:last_post/
 direction:desc/limit:10');

 here are my models :

 ?php
 class Post extends AppModel {

 var $name = 'Post';

 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 var $belongsTo = array(
 'Topic' = array('className' = 'Topic',
 'foreignKey' 
 = 'topic_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 
 'counterCache' = ''),
 );

 }

 ?php
 class Topic extends AppModel {

 var $name = 'Topic';

 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 var $belongsTo = array(
 'Forum' = array('className' = 'Forum',
 'foreignKey' 
 = 'forum_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 
 'counterCache' = ''),
 );

 var $hasMany = array(
 'Post' = array('className' = 'Post',
 'foreignKey' 
 = 'topic_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 'dependent' 
 = ''),
 );

 }

 ?php
 class Forum extends AppModel {

 var $name = 'Forum';

 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 var $hasMany = array(
 'ForumPerm' = array('className' = 'ForumPerm',
 'foreignKey' 
 = 'forum_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 'limit' = '',
 'offset' = 
 '',
 'dependent' 
 = '',
 'exclusive' 
 = '',
 'finderQuery' 
 = '',
 
 'counterQuery' = ''),
 'Topic' = array('className' = 'Topic',
 'foreignKey' 
 = 'forum_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 'limit' = '',
 'offset

How to INNER Join in Model ?

2007-11-29 Thread foxmask

Hi i'd like to know what i need to do and in what model, to be able to
use this SQL query

SELECT t.id, t.subject FROM topics AS t INNER JOIN forums AS f ON
f.id=t.forum_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND
fp.group_id='xxx') WHERE (fp.read_forum IS NULL OR fp.read_forum=1)
AND t.moved_to IS NULL  ORDER BY t.last_post DESC LIMIT 10


actually this SQL Query :
SELECT `Post`.`id`, `Post`.`poster`, `Post`.`poster_id`,
`Post`.`poster_ip`, `Post`.`poster_email`, `Post`.`message`,
`Post`.`hide_smilies`, `Post`.`posted`, `Post`.`edited`,
`Post`.`edited_by`, `Post`.`topic_id`, `Topic`.`id`, `Topic`.`poster`,
`Topic`.`subject`, `Topic`.`posted`, `Topic`.`last_post`,
`Topic`.`last_post_id`, `Topic`.`last_poster`, `Topic`.`num_views`,
`Topic`.`num_replies`, `Topic`.`closed`, `Topic`.`sticky`,
`Topic`.`moved_to`, `Topic`.`forum_id` FROM `posts` AS `Post` LEFT
JOIN `topics` AS `Topic` ON (`Post`.`topic_id` = `Topic`.`id`) WHERE 1
= 1 ORDER BY `last_post` desc LIMIT 10

is produce when i do in my element :

$pt_active_topics = $this-requestAction('posts/index/sort:last_post/
direction:desc/limit:10');

here are my models :

?php
class Post extends AppModel {

var $name = 'Post';

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'Topic' = array('className' = 'Topic',
'foreignKey' = 
'topic_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'counterCache' 
= ''),
);

}
?php
class Topic extends AppModel {

var $name = 'Topic';

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'Forum' = array('className' = 'Forum',
'foreignKey' = 
'forum_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'counterCache' 
= ''),
);

var $hasMany = array(
'Post' = array('className' = 'Post',
'foreignKey' = 
'topic_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'dependent' = 
''),
);

}


?php
class Forum extends AppModel {

var $name = 'Forum';

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $hasMany = array(
'ForumPerm' = array('className' = 'ForumPerm',
'foreignKey' = 
'forum_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'dependent' = 
'',
'exclusive' = 
'',
'finderQuery' 
= '',
'counterQuery' 
= ''),
'Topic' = array('className' = 'Topic',
'foreignKey' = 
'forum_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'dependent' = 
'',
'exclusive' = 
'',

HowTo put blocks in view ?

2007-11-28 Thread foxmask

hi

i dont know how to do it with cakephp


Currently i have the following code :

div id=menu
?php tpl::bloc('menu');?
?php tpl::bloc('active_topics');?
?php tpl::bloc('login');?
[...]
/div

the class tpl and bloc method looks like this

class tpl
{
function bloc($bloc)
{
if (is_callable($func))
call_user_func($func);
}
}

and the function login looks like this :
function login()
{
?
form method=post action=?php echo 
pt_portal_url ?
div class=inform
input type=hidden 
name=login value=1 /
input type=hidden 
name=redirect_url value=?php echo
$_SERVER['REQUEST_URI'] ? /

p class=fieldlabel 
for=req_username?php echo
__('Username') ?/label
input type=text 
name=req_username id=req_username
size=13 maxlength=25 //p

p class=fieldlabel 
for=req_password?php echo
__('Password') ?/label
input type=password 
name=req_password id=req_password
size=13 maxlength=16 //p

pinput type=submit 
class=submit value=?php echo
__('Login') ? //p
/div
/form
pa href=?php echo pt_forum_url; 
?register.php?php echo
__('Not registered') ?/abr /
a href=?php echo pt_forum_url; 
?login.php?action=forget?
php echo __('Forgotten pass') ?/a/p
?php
}
}


where do i have to put what and where to migrate this code is a
CakePHP version ?

kind Regards.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Helpers and Themes : is it possible ?

2007-11-28 Thread foxmask

I've read the theme.php which contain the ThemeView class and i dont
see how i can make a specific Helper for a given theme.
i mean currently to deal with theme i have

view/themed/mytheme/layouts/
view/themed/mytheme/lelements/
view/themed/mytheme/articles/...
view/themed/mytheme/blog/...
etc...

but view/themed/mytheme/helpers/ is not used.

all helpers are here view/helpers/ with or without theme management

is it a bug ?

if so i have another bug with helper that crash Apache (under windows)
when we do
$var helpers = array('foobar'); in app_controller.php  where foobar
does not exist ...

as i expected to find my helper foobar in view/themed/mytheme/
helpers/
all this explain that ...

if it's not a bug so helper with theme can be used ?






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PowerBake - bake all at once (for 1.2)

2007-11-28 Thread foxmask

what does it do more than cake bake ?
just the 'A' ?

On 28 nov, 15:04, kiang [EMAIL PROTECTED] wrote:
 Download here:http://twpug.googlecode.com/files/powerbake.php.zip

 1. Download and extract the file to cake/console/libs/powerbake.php
 2. Try to use this script as bake:
 cake.php powerbake -working /../app/
 3. You have four options after executing the script
 M = Generating all models according to tables in your database
 C = Generating all controllers according to tables in your database
 V = Generating all views according to tables in your database
 A = Generating all above according to tables in your database at once

 Known problems and limitations:
 1. I haven't had time to figure out how to deal with table
 relationships automatically.
 2. Test this script in non-production environments, or ... or ...

 :)

 ---
 kiang
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HowTo put blocks in view ?

2007-11-28 Thread foxmask

i made elements and call them by ?php echo $this-
renderElement('menu') ?

and so on...

and put the call_user_function() ... to the garbage.

foxmask a écrit :
 hi

 i dont know how to do it with cakephp


 Currently i have the following code :

 div id=menu
 ?php tpl::bloc('menu');?
 ?php tpl::bloc('active_topics');?
 ?php tpl::bloc('login');?
 [...]
 /div

 the class tpl and bloc method looks like this

 class tpl
 {
   function bloc($bloc)
   {
   if (is_callable($func))
   call_user_func($func);
   }
 }

 and the function login looks like this :
   function login()
   {
 ?
   form method=post action=?php echo 
 pt_portal_url ?
   div class=inform
   input type=hidden 
 name=login value=1 /
   input type=hidden 
 name=redirect_url value=?php echo
 $_SERVER['REQUEST_URI'] ? /

   p class=fieldlabel 
 for=req_username?php echo
 __('Username') ?/label
   input type=text 
 name=req_username id=req_username
 size=13 maxlength=25 //p

   p class=fieldlabel 
 for=req_password?php echo
 __('Password') ?/label
   input type=password 
 name=req_password id=req_password
 size=13 maxlength=16 //p

   pinput type=submit 
 class=submit value=?php echo
 __('Login') ? //p
   /div
   /form
   pa href=?php echo pt_forum_url; 
 ?register.php?php echo
 __('Not registered') ?/abr /
   a href=?php echo pt_forum_url; 
 ?login.php?action=forget?
 php echo __('Forgotten pass') ?/a/p
   ?php
   }
   }


 where do i have to put what and where to migrate this code is a
 CakePHP version ?

 kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: a lot of the features that make rails so cool are totally missing in cake :(

2007-11-28 Thread foxmask


D:\wamp\www_cakephp\cake\consolecake bake help

Welcome to CakePHP v1.2.0.5875 pre-beta Console
---
App : console
Path: D:\wamp\www_cakephp\cake\console
---
CakePHP Bake:
---
The Bake script generates controllers, views and models for your
application.
If run with no command line arguments, Bake guides the user through
the class
creation process. You can customize the generation process by telling
Bake
where different parts of your application are using command line
arguments.
---
Usage: cake bake command arg1 arg2...
---
Params:
-app path Absolute/Relative path to your app folder.

Commands:

bake help
shows this help message.

bake project path
bakes a new app folder in the path supplied
or in current directory if no path is specified

bake db_config
bakes a database.php file in config directory.

bake model
bakes a model. run 'bake model help' for more info

bake view
bakes views. run 'bake view help' for more info

bake controller
bakes a controller. run 'bake controller help' for
more info


On 28 nov, 20:37, AD7six [EMAIL PROTECTED] wrote:
 On Nov 28, 8:33 pm, Luke [EMAIL PROTECTED] wrote:

  I'm sorry I honestly forgot I already asked this question... I was
  wondering why you said again - thanks for answering anyway :)

 Try a screen cast:http://cakephp.org/screencasts(setting up the CakePHP 
 console)

 Bake is self documenting really, i.e. you start it and it asks you
 what you want to do.

 hth,

 AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake and ThemeView class

2007-11-27 Thread foxmask

i made others tests.
var $theme = 'Theme'; in the controller ; call effectivly the
ThemeView class.

i debug the ThemView class to understand how its working
function __construct ($controller) {
parent::__construct($controller);

$this-theme = $controller-theme;

echo premy theme .$this-theme./pre;

if (!empty($this-theme)) {
if (is_dir(WWW_ROOT . 'themed' . DS . $this-theme)) {
$this-themeWeb = 'themed/'. $this-theme .'/';
echo premy themeWeb .$this-themeWeb./pre;
}
$this-themeElement = 'themed'. DS . $this-theme .
DS .'elements'. DS;
$this-themeLayout =  'themed'. DS . $this-theme .
DS .'layouts'. DS;
$this-themePath = 'themed'. DS . $this-theme . DS;

echo pre.$this-themeElement .   . $this-
themeLayout .   . $this-themePath . /pre;
}
}

i enter in the __construct method all is well define and set
but the files i put in the elements and layouts are not used.

do i miss somthing else ?
Kind Regards.


On 27 nov, 08:54, foxmask [EMAIL PROTECTED] wrote:
 Hi,
 i already tried it, and also, as suggest in another thread, copying
 from cake/view/theme.php in the myapp/view directory
 that does not solve the issue.
 may be the theme management is not ready yet .
 Kind Regards.

 On 27 nov, 02:48, Gwoo [EMAIL PROTECTED] wrote:

  try setting var $view = 'Theme';
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake and ThemeView class

2007-11-27 Thread foxmask

it seems we also need to have this directory tree

app/view/themed/themeA/view1
app/view/themed/themeA/view2

app/view/themed/themeB/view1
app/view/themed/themeB/view2

plus
webroot/themed/themeA/
webroot/themed/themeB/


On 27 nov, 10:00, foxmask [EMAIL PROTECTED] wrote:
 i made others tests.
 var $theme = 'Theme'; in the controller ; call effectivly the
 ThemeView class.

 i debug the ThemView class to understand how its working
 function __construct ($controller) {
 parent::__construct($controller);

 $this-theme = $controller-theme;

 echo premy theme .$this-theme./pre;

 if (!empty($this-theme)) {
 if (is_dir(WWW_ROOT . 'themed' . DS . $this-theme)) {
 $this-themeWeb = 'themed/'. $this-theme .'/';
 echo premy themeWeb .$this-themeWeb./pre;
 }
 $this-themeElement = 'themed'. DS . $this-theme .
 DS .'elements'. DS;
 $this-themeLayout =  'themed'. DS . $this-theme .
 DS .'layouts'. DS;
 $this-themePath = 'themed'. DS . $this-theme . DS;

 echo pre.$this-themeElement .   . $this-themeLayout .   
 . $this-themePath . /pre;

 }
 }

 i enter in the __construct method all is well define and set
 but the files i put in the elements and layouts are not used.

 do i miss somthing else ?
 Kind Regards.

 On 27 nov, 08:54, foxmask [EMAIL PROTECTED] wrote:

  Hi,
  i already tried it, and also, as suggest in another thread, copying
  from cake/view/theme.php in the myapp/view directory
  that does not solve the issue.
  may be the theme management is not ready yet .
  Kind Regards.

  On 27 nov, 02:48, Gwoo [EMAIL PROTECTED] wrote:

   try setting var $view = 'Theme';
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake and ThemeView class

2007-11-26 Thread foxmask

hello,
i'm trying to use this class to be able to use theme with cake but i
really dont know how to do.
i've created :
webroot/themed/foobar/layouts
webroot/themed/foobar/elements
put default.php in layout directory
and in the app_controller did

public $theme = PT_DEFAULT_THEME;

class AppController extends Controller {

public $theme = PT_DEFAULT_THEME;

public function __construct() {

parent::__construct();
}
}
ps :  PT_DEFAULT_THEME is set in bootstrap.php.

Any tips ?
kind regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake and ThemeView class

2007-11-26 Thread foxmask


any suggestion on how we have to proceed to be able to use themes ?

Kind Regards

On Nov 26, 4:19 pm, foxmask [EMAIL PROTECTED] wrote:
 hello,
 i'm trying to use this class to be able to use theme with cake but i
 really dont know how to do.
 i've created :
 webroot/themed/foobar/layouts
 webroot/themed/foobar/elements
 put default.php in layout directory
 and in the app_controller did

 public $theme = PT_DEFAULT_THEME;

 class AppController extends Controller {

 public $theme = PT_DEFAULT_THEME;

 public function __construct() {

 parent::__construct();
 }}

 ps :  PT_DEFAULT_THEME is set in bootstrap.php.

 Any tips ?
 kind regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake and ThemeView class

2007-11-26 Thread foxmask

Hi,
i already tried it, and also, as suggest in another thread, copying
from cake/view/theme.php in the myapp/view directory
that does not solve the issue.
may be the theme management is not ready yet .
Kind Regards.

On 27 nov, 02:48, Gwoo [EMAIL PROTECTED] wrote:
 try setting var $view = 'Theme';
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: language problem

2007-11-24 Thread foxmask

how looks like your default.po and what is the exact __() content ?

my default.ctp is

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=?php
__('lang_iso_code') ?
lang=?php __('lang_iso_code') ? dir=?php __('lang_direction') ?


and my default.po

msgid lang_iso_code
msgstr fr

msgid lang_direction
msgstr ltr


On Nov 24, 5:06 pm, cronet [EMAIL PROTECTED] wrote:
 hi,

 I created the folder /app/locale/deu/LC_MESSAGES/default.po

 In my app_controller i set
 uses('L10n');
 before the class call

 and within beforeFilter():

 $this-Session-write('Config.language', deu);

 Now, i thought, all __() constructs would be translated with the po
 file.

 But nothing happens.

 How can I debug this?

 Greetings,
 Alexander
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: language problem

2007-11-24 Thread foxmask

if you put a simple __('foo') in a view and in default.po

msgid foo
msgstr bar

does it work when you access the view ?

On Nov 24, 5:27 pm, cronet [EMAIL PROTECTED] wrote:
 no,

 it's the latest stable 1.2 alpha

 On 24 Nov., 17:26, foxmask [EMAIL PROTECTED] wrote:

  cakephp 1.1.x.x ?

  On Nov 24, 5:21 pm, cronet [EMAIL PROTECTED] wrote:

   I think my files are correct, because, it worked already in
   development environment. Now i wanted to switch to my production
   server, and the language thing isn't working anymore...

   On 24 Nov., 17:18, foxmask [EMAIL PROTECTED] wrote:

how looks like your default.po and what is the exact __() content ?

my default.ctp is

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=?php
__('lang_iso_code') ?
lang=?php __('lang_iso_code') ? dir=?php __('lang_direction') ?



and my default.po

msgid lang_iso_code
msgstr fr

msgid lang_direction
msgstr ltr

On Nov 24, 5:06 pm, cronet [EMAIL PROTECTED] wrote:

 hi,

 I created the folder /app/locale/deu/LC_MESSAGES/default.po

 In my app_controller i set
 uses('L10n');
 before the class call

 and within beforeFilter():

 $this-Session-write('Config.language', deu);

 Now, i thought, all __() constructs would be translated with the po
 file.

 But nothing happens.

 How can I debug this?

 Greetings,
 Alexander
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Undefined property: NewsMainsController::$modelClass [CORE\cake\libs\controller\controller.php, line 347]

2007-11-23 Thread FoxMaSk


 class AppController extends Controller {
   public function __construct() {
parent::__construct();
 }
}

solve the issue


On 23 nov, 17:36, FoxMaSk [EMAIL PROTECTED] wrote:
 Hi,

 i'm using cakephp 1.2.x.x

 i did cake bake to build all my Model View and Controller

 here is my model :
 ?php
 class NewsMain extends AppModel {

 var $name = 'NewsMain';
 var $useTable = 'news_main';
 var $validate = array(
 'title' = VALID_NOT_EMPTY,
 'url' = VALID_NOT_EMPTY,
 'date' = VALID_NOT_EMPTY,
 'status' = VALID_NOT_EMPTY,
 'tid' = VALID_NOT_EMPTY,
 'pid' = VALID_NOT_EMPTY,
 );

 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 var $belongsTo = array(
 'NewsCat' = array('className' = 'Ne?php
 class NewsMain extends AppModel {

 public $name = 'NewsMain';
 public $useTable = 'news_main';
 public $validate = array(
 'title' = VALID_NOT_EMPTY,
 'url' = VALID_NOT_EMPTY,
 'date' = VALID_NOT_EMPTY,
 'status' = VALID_NOT_EMPTY,
 'tid' = VALID_NOT_EMPTY,
 'pid' = VALID_NOT_EMPTY,
 );

 //The Associations below have been created with all possible keys,
 those that are not needed can be removed
 public $belongsTo = array(
 'NewsCat' = array('className' = 'NewsCat',
 'foreignKey' 
 = 'cat_id',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 
 'counterCache' = ''),
 );

 public $hasMany = array(
 'NewsVote' = array('className' = 'NewsVote',
 'foreignKey' 
 = 'id_news',
 'conditions' 
 = '',
 'fields' = 
 '',
 'order' = '',
 'limit' = '',
 'offset' = 
 '',
 'dependent' 
 = '',
 'exclusive' 
 = '',
 'finderQuery' 
 = '',
 
 'counterQuery' = ''),
 );

 }

 ?

 and the Controller :
 ?php
 class NewsMainsController extends AppController {

 public $name = 'NewsMains';
 public $helpers = array('Html', 'Form' );

 public function index() {
 $this-NewsMain-recursive = 0;
 $this-set('newsMains', $this-paginate());
 }
 [...]

 }?

 and as soon as i want to add a __construct() in the
 app_controller.php  i get the error i posted.
 ?php
 /* SVN FILE: $Id: app_controller.php 5118 2007-05-18 17:19:53Z phpnut
 $ */

 [...]
 class AppController extends Controller {

 public function __construct() {

 }}

 ?

 ps : i saw an old message here with the exactly same Undefined
 property ::$modelClass on the version 1.1.x.x
 anyone can explain me what's wrong here ?

 Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp-fr

2007-11-23 Thread foxmask

cakephp-fr.org is not free.
cakephp-france.org is free or better cakephp.fr is free too (at the
same price of .org)

On Nov 24, 12:49 am, pluriels [EMAIL PROTECTED] wrote:
 thanx for the answers.

 I started to use cake about one year ago and at that time every one
 was speaking about the wiki.
 It seems that the french community lost a lot of things with the
 arrival of the bakery.
 I would like to takehttp://www.cakephp-fr.orgbecause its owner gave
 it up sometime ago.
 The problem is that he has already lost everything form the database.

 This website will have two purposes for me :
 - spreading CakePHP in France, instead of Symfony. Because when i
 decided to learn a framework, i chose CakePHP !
 - telling everyone that I have some kind of knowledge about CakePHP,
 i.e for commercial purpose.

 But the commercial purpose will be visible only :
 - in a directory of companies using CakePHP
 - in the list of contributors
 - in the fact that i am trying to make it possible

 Since the directory and the the list of contributors is open, it can
 be useful to every contributor.

 Anyone interested ?
why not, launch the missile and i will follow the project ;)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Undefined property: NewsMainsController::$modelClass [CORE\cake\libs\controller\controller.php, line 347]

2007-11-23 Thread FoxMaSk

Hi,

i'm using cakephp 1.2.x.x

i did cake bake to build all my Model View and Controller

here is my model :
?php
class NewsMain extends AppModel {

var $name = 'NewsMain';
var $useTable = 'news_main';
var $validate = array(
'title' = VALID_NOT_EMPTY,
'url' = VALID_NOT_EMPTY,
'date' = VALID_NOT_EMPTY,
'status' = VALID_NOT_EMPTY,
'tid' = VALID_NOT_EMPTY,
'pid' = VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'NewsCat' = array('className' = 'Ne?php
class NewsMain extends AppModel {

public $name = 'NewsMain';
public $useTable = 'news_main';
public $validate = array(
'title' = VALID_NOT_EMPTY,
'url' = VALID_NOT_EMPTY,
'date' = VALID_NOT_EMPTY,
'status' = VALID_NOT_EMPTY,
'tid' = VALID_NOT_EMPTY,
'pid' = VALID_NOT_EMPTY,
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
public $belongsTo = array(
'NewsCat' = array('className' = 'NewsCat',
'foreignKey' = 
'cat_id',
'conditions' = 
'',
'fields' = '',
'order' = '',
'counterCache' 
= ''),
);

public $hasMany = array(
'NewsVote' = array('className' = 'NewsVote',
'foreignKey' = 
'id_news',
'conditions' = 
'',
'fields' = '',
'order' = '',
'limit' = '',
'offset' = '',
'dependent' = 
'',
'exclusive' = 
'',
'finderQuery' 
= '',
'counterQuery' 
= ''),
);

}
?

and the Controller :
?php
class NewsMainsController extends AppController {

public $name = 'NewsMains';
public $helpers = array('Html', 'Form' );

public function index() {
$this-NewsMain-recursive = 0;
$this-set('newsMains', $this-paginate());
}
[...]
}?

and as soon as i want to add a __construct() in the
app_controller.php  i get the error i posted.
?php
/* SVN FILE: $Id: app_controller.php 5118 2007-05-18 17:19:53Z phpnut
$ */

[...]
class AppController extends Controller {

public function __construct() {

}
}
?


ps : i saw an old message here with the exactly same Undefined
property ::$modelClass on the version 1.1.x.x
anyone can explain me what's wrong here ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp-fr

2007-11-23 Thread FoxMaSk

Hi,
i was looking for a french community too and found also cake pour
tous  (means cake fo all)
but it seems it's not maintaining (8months old, the most recent post).
and cakephp-fr google group is not so active too.

@ Lionel : i can try to
 - helping me to keep some kind of french community around CakePHP

but as i'm very very heavy busy that will be difficult.

on my side, as soon as i will finish to find the good habits to adopt
with CakePHP
i will write an article on it :D

but for the moment I gropes ;)

Kind regards.
On Nov 23, 7:50 pm, Gwoo [EMAIL PROTECTED] wrote:
 CrazyLegs started this :http://www.cakepourtous.org/
 Not sure if he is still maintaining it, but it seems like a good start.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



bake : feature request

2007-11-22 Thread FoxMaSk

hello

when we do cake bake controller and choose one of the list,
i'd like to be able to rename the controller class name (by giving the
$useTable)

currently i dont like the way the database tables are named,
so when i do cake bake model that's create a model that i modify by
renaming the model filename,  changed the class name and add
$useTable.

But after that, when i do cake bake controller ; and make my choice i
have
You must have a model for this class to build scaffold methods.
Please try again.
because effectively the model has changed and bake cant find it.

So it will be nice to be able to specify the $useTable and class name
we we want.

Or may be i miss something that permits to do that ?

Kind regards



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: bake : feature request

2007-11-22 Thread FoxMaSk

ok, I understood


On Nov 22, 7:15 pm, Gwoo [EMAIL PROTECTED] wrote:
 yes, you are missing something. Bake is not meant to satisfy special
 cases. As a good friend would say, Edge case, move on.
 Bake works based on the conventions in Cake. If you do not follow
 these conventions because you do not like them, then you will end up
i did not say i dont like the conventions on the contrary i jsut
search the better way to use cake.
if you say it a special case
i will search a way to simply the issue.

 writing a lot more code.

regards
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Undefined variable: ... CORE\app\views\layouts\default.ctp

2007-11-21 Thread FoxMaSk

Hi,
in the boostrap.php i call a vendor script that does a lot of stuff

one of them is to get the punbb (a BB sofware) config

class foxtal
{
public $pun_config;
{
public function __construct()
# Load cached config
if (file_exists(PUN_ROOT.'/cache/cache_config.php'))
require PUN_ROOT.'/cache/cache_config.php';

if (!defined('PUN_CONFIG_LOADED')  $this-
_generate_config_cache())
require PUN_ROOT.'/cache/cache_config.php';

$this-pun_config = $pun_config;
}
[...]
}

so i do $foxtal =  new foxtal();

now in the layout and everywhere in my application i'd like to be able
to do use $foxtal
for example : echo $foxtal['o_cur_version'] in the defailt.ctp file

Is it possible ?

What do i need to do ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Undefined variable: ... CORE\app\views\layouts\default.ctp

2007-11-21 Thread FoxMaSk

i tried :
class AppController extends Controller {

public function index() {
$foxtal =  new foxtal();
$this-set('foxtal', $foxtal);
}
}

and then in default.ctp i still have :
pre
?php
echo foobar;
print_r($foxtal); ?
/pre
which give the error Undefined variable: foxtal

where is the mistake ?
Kind Regards.


On 21 nov, 12:29, Repsah [EMAIL PROTECTED] wrote:
 Inizialize the class in your app_controller and export it to views using the
 set() method.

 On Nov 21, 2007 12:18 PM, FoxMaSk [EMAIL PROTECTED] wrote:



  Hi,
  in the boostrap.php i call a vendor script that does a lot of stuff

  one of them is to get the punbb (a BB sofware) config

  class foxtal
  {
  public $pun_config;
  {
  public function __construct()
 # Load cached config
 if (file_exists(PUN_ROOT.'/cache/cache_config.php'))
 require PUN_ROOT.'/cache/cache_config.php';

 if (!defined('PUN_CONFIG_LOADED')  $this-
  _generate_config_cache())
 require PUN_ROOT.'/cache/cache_config.php';

 $this-pun_config = $pun_config;
  }
  [...]
  }

  so i do $foxtal =  new foxtal();

  now in the layout and everywhere in my application i'd like to be able
  to do use $foxtal
  for example : echo $foxtal['o_cur_version'] in the defailt.ctp file

  Is it possible ?

  What do i need to do ?

  Kind Regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Undefined variable: ... CORE\app\views\layouts\default.ctp

2007-11-21 Thread FoxMaSk

Thanks you very much !
i'm starting to see how to rethink a complet CMS which did not use
MVC ; its a real pain, but that's come slowly  ;)

On 21 nov, 13:17, Repsah [EMAIL PROTECTED] wrote:
 because you have to put that declaration in the constructor, not in an
 index() method that you probably won't call.

 On Nov 21, 2007 1:09 PM, FoxMaSk [EMAIL PROTECTED] wrote:



  i tried :
  class AppController extends Controller {

 public function index() {
 $foxtal =  new foxtal();
 $this-set('foxtal', $foxtal);
 }
  }

  and then in default.ctp i still have :
  pre
  ?php
  echo foobar;
  print_r($foxtal); ?
  /pre
  which give the error Undefined variable: foxtal

  where is the mistake ?
  Kind Regards.

  On 21 nov, 12:29, Repsah [EMAIL PROTECTED] wrote:
   Inizialize the class in your app_controller and export it to views using
  the
   set() method.

   On Nov 21, 2007 12:18 PM, FoxMaSk [EMAIL PROTECTED] wrote:

Hi,
in the boostrap.php i call a vendor script that does a lot of stuff

one of them is to get the punbb (a BB sofware) config

class foxtal
{
public $pun_config;
{
public function __construct()
   # Load cached config
   if (file_exists(PUN_ROOT.'/cache/cache_config.php'))
   require PUN_ROOT.'/cache/cache_config.php';

   if (!defined('PUN_CONFIG_LOADED')  $this-
_generate_config_cache())
   require PUN_ROOT.'/cache/cache_config.php';

   $this-pun_config = $pun_config;
}
[...]
}

so i do $foxtal =  new foxtal();

now in the layout and everywhere in my application i'd like to be able
to do use $foxtal
for example : echo $foxtal['o_cur_version'] in the defailt.ctp file

Is it possible ?

What do i need to do ?

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Undefined variable: ... CORE\app\views\layouts\default.ctp

2007-11-21 Thread FoxMaSk

Hi,
I meet 2 issue :

A) Constantes
B) Array and undefined index

A) Constantes
When i define a constante in the __construct of the app_controller.php
cakephp try to define it twice ...

one for each controllor ? (app_controller.php and one for
[myapp]_controller.php ) ?

if so ; do i have to define my constantes in bootstrap.php instead ?

B) Undefined index

when i instanciate my $foxtal in __construct of the my
app_controller.php

class AppController extends Controller {

public function __construct() {
$foxtal =  new foxtal();
$this-set('foxtal', $foxtal);
}
}

and access to http://localhost/ and do ?php echo $foxtal['my_index'] ?
 in the  layout
everything goes well

BUT as soon as i do  http://localhost/article/index

the same echo in my the view give a NOTICE undefined index ...

Why ?
Kind Regards

On 21 nov, 13:54, FoxMaSk [EMAIL PROTECTED] wrote:
 Thanks you very much !
 i'm starting to see how to rethink a complet CMS which did not use
 MVC ; its a real pain, but that's come slowly  ;)

 On 21 nov, 13:17, Repsah [EMAIL PROTECTED] wrote:

  because you have to put that declaration in the constructor, not in an
  index() method that you probably won't call.

  On Nov 21, 2007 1:09 PM, FoxMaSk [EMAIL PROTECTED] wrote:

   i tried :
   class AppController extends Controller {

  public function index() {
  $foxtal =  new foxtal();
  $this-set('foxtal', $foxtal);
  }
   }

   and then in default.ctp i still have :
   pre
   ?php
   echo foobar;
   print_r($foxtal); ?
   /pre
   which give the error Undefined variable: foxtal

   where is the mistake ?
   Kind Regards.

   On 21 nov, 12:29, Repsah [EMAIL PROTECTED] wrote:
Inizialize the class in your app_controller and export it to views using
   the
set() method.

On Nov 21, 2007 12:18 PM, FoxMaSk [EMAIL PROTECTED] wrote:

 Hi,
 in the boostrap.php i call a vendor script that does a lot of stuff

 one of them is to get the punbb (a BB sofware) config

 class foxtal
 {
 public $pun_config;
 {
 public function __construct()
# Load cached config
if (file_exists(PUN_ROOT.'/cache/cache_config.php'))
require PUN_ROOT.'/cache/cache_config.php';

if (!defined('PUN_CONFIG_LOADED')  $this-
 _generate_config_cache())
require PUN_ROOT.'/cache/cache_config.php';

$this-pun_config = $pun_config;
 }
 [...]
 }

 so i do $foxtal =  new foxtal();

 now in the layout and everywhere in my application i'd like to be able
 to do use $foxtal
 for example : echo $foxtal['o_cur_version'] in the defailt.ctp file

 Is it possible ?

 What do i need to do ?

 Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Latest additions to 1.2

2007-11-18 Thread FoxMaSk

Good News, as i have an entire CMS to migrate to cakephp.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake Schema issue ?

2007-11-17 Thread FoxMaSk

with cakephp 1.1.x.x :
is it normal to allocate a so big memory size to use bake ?
at the beginning i used 16M but i had to grow up memory limit to
200M !
for finnally see no controller generated as requested :(

D:\wamp\www_cakephp_1.1\cake\scriptsdir ..\..\app\controllers

 Répertoire de D:\wamp\www_cakephp_1.1\app\controllers

17/11/2007  09:10REP  .
17/11/2007  09:10REP  ..
10/11/2007  16:08REP  components
   0 fichier(s)0 octets
   3 Rép(s)  127 667 056 640 octets libres

D:\wamp\www_cakephp_1.1\cake\scripts


Would you like bake to build your controller interactively?
Warning: Choosing no will overwrite  controller if it exist. (y/n)
[y]  n

Would you like to include some basic class methods (index(), add(),
view(), edit())? (y/n)
[y]  y

Would you like to create the methods for admin routing? (y/n)
[y]  y

Fatal error: Allowed memory size of 188743680 bytes exhausted (tried
to allocate 264 bytes) in D:\wamp\www_cakephp_
1.1\cake\libs\class_registry.php on line 300


On Nov 15, 6:06 pm, FoxMaSk [EMAIL PROTECTED] wrote:
 On Nov 15, 5:24 pm, Gwoo [EMAIL PROTECTED] wrote:

  why are passing a path?

 i also did
  cake schema generate 

 but even this produce the error.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Question

2007-11-16 Thread FoxMaSk

a better way will be to migrate my lib somewhere in the CakePHP tree,
to be used anywhere in all the plugins,  is it possible ?


On Nov 16, 11:22 am, FoxMaSk [EMAIL PROTECTED] wrote:
 in the same idea :

 in my vendor libs i need to access to the database but how could i ?

 if i want to use all method find and findAll etc.. how do i have to
 do ?

 kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Question

2007-11-16 Thread FoxMaSk

in the same idea :

in my vendor libs i need to access to the database but how could i ?

if i want to use all method find and findAll etc.. how do i have to
do ?

kind Regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Question

2007-11-16 Thread FoxMaSk

http://bakery.cakephp.org/articles/view/confcomponent-db-based-configuration-tutorial
could do the trick ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Question

2007-11-16 Thread FoxMaSk

Thanks you very much !
its working great.
On 16 nov, 06:48, Grant Cox [EMAIL PROTECTED] wrote:
 1. Use vendor() to require in whichever classes you need from your
 vendors folder.
 2. View elements should be in your /app/views/elements folder.  If
 you've got to keep that structure though, I guess just including it is
 the way to go...  But do it like
 vendor( 'themes'.DS.CMS_DEFAULT_THEME.DS.'_top' );

 On Nov 16, 2:28 am, FoxMaSk [EMAIL PROTECTED] wrote:

  Hi,
  can someone give me some tips on how to proceed ?
  thanks
  kind regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Constant usable for all applications

2007-11-16 Thread FoxMaSk

Hi,

i'd like to know where i can put a file containing constantes that can
be used everywhere (view/model/controller) ?

if in vendors directory , where do i do the vendor() call ?
if not which directory ?

thanks you for your help.

Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Constant usable for all applications

2007-11-16 Thread FoxMaSk

thanks !


On Nov 16, 8:55 pm, chad [EMAIL PROTECTED] wrote:
 app/config/bootstrap.php

 On Nov 16, 9:10 am, FoxMaSk [EMAIL PROTECTED] wrote:

  Hi,

  i'd like to know where i can put a file containing constantes that can
  be used everywhere (view/model/controller) ?

  if in vendors directory , where do i do the vendor() call ?
  if not which directory ?

  thanks you for your help.

  Kind Regards.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Several Question

2007-11-15 Thread FoxMaSk

Hi,
i plan to migrate a complete CMS which use is own kind of  MVC
pattern.

first of all i show the directories tree of my CMS,
second i show what i did to migrate to cake
and finally ask some questions of oragnisation ;-) to clarify my mind

This CMS uses several modules (by module we think about a little
application)
modules/articles/
modules/blogs
modules/planet
modules/calendar
modules/downloads
etc..

we told me to put all of them in the plugins directory.

this is what i did.

now its look like :

app/plugins/articles/controllers
app/plugins/articles/components
app/plugins/articles/models
app/plugins/articles/views/articles (we have to make a sub dir
articles in the views dir ; its weird but its like that it seems)
app/plugins/articles/layout/default.thtml

for the libs of my CMS we also told me to put them in vendors

so its look like that :
app/vendors/config (a config file for the CMS)
app/vendors/classes (some class of the CMS)
app/vendors/libs (some libs of the CMS)
app/vendors/themes/
app/vendors/themes/themeA  contains file used for the header and
footer to be include in the main layout.

app/webroot/themes/themeA/ contain all the css of all the plugins


Now the questions
1) when i'm on http://localhost/
how do i call all the libs and classes i need ?
currently i have a lot of settings that are stored in my database, and
i dont know how to get them.

2) do i have to do a require  in the app/plugins/articles/view/layout/
default.thtml to be able to load the part of my template ?

?php require_once dirname(__FILE__).('/../../../../vendors/
themes/'.CMS_DEFAULT_THEME.'/_top.php'); ?

thanks you for your help.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake Schema issue ?

2007-11-15 Thread FoxMaSk

Hi,
when i do this :
D:\wamp\www_cakephp\cake\consolecake schema generate -connect default
-path d:\
wamp\www_cakephp\cake\console\config\sql\foxmask.sql

i get the error :


Welcome to CakePHP v1.2.0.5875 pre-beta Console
---
Cake Schema Shell
---
Generating Schema...
Error: Missing Database Connection. Try 'cake bake'


but my connection is well defined and works :

D:\wamp\www_cakephp\cake\consolemore d:\wamp\www_cakephp\app\config
\database.php
class DATABASE_CONFIG
{
var $default = array('driver' = 'mysql',
 
'connect' = 'mysql_connect',
'host'
= 'localhost',
 
'login' = 'foxmask',
 
'password' = 'foxmask',
 
'database' = '',
 
'prefix' = '');

/*var $test = array('driver' = 'mysql',
'connect' =
'mysql_connect',
'host' =
'localhost',
'login' =
'user',
'password' =
'password',
'database' =
'project_name-test',
'prefix' =
'');*/
}
?


What's the matter ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake Schema issue ?

2007-11-15 Thread FoxMaSk

because even without -path the issue is met...


On Nov 15, 5:24 pm, Gwoo [EMAIL PROTECTED] wrote:
 why are passing a path?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Several Question

2007-11-15 Thread FoxMaSk

Hi,
can someone give me some tips on how to proceed ?
thanks
kind regards.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake Schema issue ?

2007-11-15 Thread FoxMaSk



On Nov 15, 5:24 pm, Gwoo [EMAIL PROTECTED] wrote:
 why are passing a path?

i also did
 cake schema generate 

but even this produce the error.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---