Re: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread AD7six



On Mar 1, 2:49 am, Samuel DeVore [EMAIL PROTECTED] wrote:
 requestAction is a method of Controller not Model

Well.. actually it's a method of object. The error is caused by doing
$this-SomethingThatDoesn'tExist-method();

However the question as raised looks like the controller logic in
getCategoryList (if there is any controller logic) should be in the
model, and it would be cleaner to put the following in the app
controller:

var $uses = array('Category');

function beforeRender() {
 if (isset($this-Category)) {
  $Categories = $this-Category-findAll(); // or whatever
MODEL method
  $this-set('navItems', $Categories);
 }
}

The use of the isset is to still have the possibility to show cake
error messages - which use an instance of the app_controller with NO
models loaded.

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: Please help me understand URL and Routes in Cake

2007-03-01 Thread barduck

Thanks for the reply.

I think I have better understanding of the Route functionality now.

I am still not sure I understand the full potential of regular
expressions in Route. I mean, I see how I can specify a regex in the
matching part of the Route-connect() but in mod rewrite, I can use
regular expression both in the matching and the substitutions part of
the URL (the groups from the match can be used in the rewritten URL,
using (...) in the pattern and $N in the substitution), can something
like this be done in Route?

I assume the colon is one way to do this, but does colon-param pattern
always needs to come surrounded by slashes (/)? What about the
asterisk I used in my route, how come it isn't being confused with the
meaning of asterisk in regex?

I am also not sure what is the best way to achieve what I described in
my original post. One possible solution is to define one big parameter
and parse it myself in my code using a delimiter I set.

So I set unit1+unit2+unit3... as one big parameter and separate it in
code myself by the plus signs. Then I set a Route rule to detect plus
signs before the normal unit view match. I think this will work also
for the parameters to the index view but I wonder if this is the right
way to do this and whether cake can do it automatically for me?

Thanks.

- barduck

On Feb 28, 5:54 pm, Chris Lamb [EMAIL PROTECTED] wrote:
  I understand that Cake does [routing] this in two phases, one
  using apache mod rewrite to pass the rest of the path to cake and the
  second one by Routes to further route the URL in cake internally. Is
  this correct?

 Yes.

  I assume that the major purpose of the Routes is to map URLs to
  controllers, functions and parameters.

 Correct.

  1. I've seen a colon (:) used in the manual in routes config (like /
  blog/:action/* ). What is the special meaning of the colon? It isn't
  mentioned anywhere.

 They are to control the parameters that are passed to the Controller.
 I think the syntax is a Ruby-ism. First, the general case. If your
 route is:

   /blog/:spam/*

 then if the browser requested

   /blog/eggs/

 then $this-params['spam'] would contain the value 'eggs'. You can have
 more than one in the route. For example:

   /blog/:year/:month/:day/:slug/*

 gets you something like the default WordPress blog link structure.
 There are two 'magic' parameters, controller and action which, when
 set, decide which controller or action to call respectively. For
 example, the route:

   /blog/:action/:spam

 when called with:

   /blog/view/eggs/

 will call the view action with $this-params['spam'] set to eggs.

  2. Can I use regular expressions in Routes like on mod rewrite? How?
  The manual doesn't mention it.

 Just use regular Perl-compatible regexs.

  3. Can I still use URL query string parameters using ? ? Or does
  cake only use the /controller/action/param/param... convention?

 Cake has a different method of handling query string parameters. My
 advice is to construct a controller action to display $this-params and
 see how they are handled.

  Hope I am making myself clear. Sorry for the long message.

 Hopefully someone else can help with the rest if the above does not
 help you solve the problem yourself. Note that the CakePHP source is
 very readable for a PHP program, so examining the dispatcher code may
 make sense than any of this.

 Best wishes,

 --
  Chris Lamb, Leamington Spa, UKGPG: 0x634F9A20

  signature.asc
 1KDownload


--~--~-~--~~~---~--~~
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: Help Using Date Range with findAll

2007-03-01 Thread AD7six



On Mar 1, 4:18 am, BlenderStyle [EMAIL PROTECTED] wrote:
 I figured it out. I did this:
 $conditions[]['Post.created'] = '= 2007-02-01';
 $conditions[]['Post.created'] = '= 2007-02-28';
 $this-Post-find($conditions);

 It seems the complex conditions section in the model chapter in the
 CakePHP Manual was wrong. It seems as Cake continues, the manual just
 seems older and older. Oh well, Cake still rocks.

There is no error in the manual wrt to how to generate array
constraints; I think there is a simple misunderstanding.

$conditions['Post.created'] = array('= 2007-02-01', '=
2007-02-28');
will generate
... WHERE `Post`.`created` IN ('= 2007-02-01', '= 2007-02-28') ...
which is obviously not what you wanted. using an array in that manner
ONLY generates an IN statemnet, it isn't used to build a list of
conditions to apply to the same field, where in the manual does it
suggest this will work?

There are several alternatives to the final solution you found (just
for info)
1)
$conditions['Post.created'] = '= 2007-02-01';
$conditions[]['Post.created'] = '= 2007-02-28';
The only reason the extra array (or arrays in your solution) are
needed is because otherwise you would overwrite one condition with
another.

2)
$conditions['Post.created'] = 'BETWEEN 2007-02-01 AND 2007-02-28';
(iirc)

Oh well, Cake still rocks.
indeederoony :)

Cheers,

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: HATBM add?

2007-03-01 Thread AD7six



On Feb 27, 12:23 pm, Devraj Mukherjee [EMAIL PROTECTED] wrote:
 Hi everyone,

 I have a HATBM relationship between a User and a Team, so a User
 belongs to  many team and  the table user_team joins them.

 Are there any examples of doing an add and delete function for HATBM
 relationships?

 I wish to create say a series of check boxes so the user can check a
 team for a user to assign them to it.

 Any help is appreciated.

 Thanks.

 --
 I never look back darling, it distracts from the now, Edna Mode (The
 Incredibles)

Have a look at rossofts useful ad on methods.
http://www.google.com/search?q=working+with+habtm+cakephp

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



Using the same Views and Controller for more than one Model?

2007-03-01 Thread Martin

Hi everyone,
I ran into a bit of a problem this morning that I cant get my head
around.

For several bad reasons there are a few tables I am working with that
have duplicates with the same structure but different data. It is a
legacy database I can't start messing with too much.

I wanted to avoid duplicating the View-files and Controller. My idea
was to Inherit the Controller and just sort of rename the Model so
that all the references still work.

The problem is that I can make the references in the controller work
quite well... But all array_indexes the model returns still have the
original Model name. There are probably more pitfalls I have not even
come close to.

So, is there a good way for a ModelTwo to represent itself as ModelOne
to the controller and Views?


--~--~-~--~~~---~--~~
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: Using the same Views and Controller for more than one Model?

2007-03-01 Thread AD7six



On Mar 1, 10:31 am, Martin [EMAIL PROTECTED] wrote:
 Hi everyone,
 I ran into a bit of a problem this morning that I cant get my head
 around.

 For several bad reasons there are a few tables I am working with that
 have duplicates with the same structure but different data. It is a
 legacy database I can't start messing with too much.

 I wanted to avoid duplicating the View-files and Controller. My idea
 was to Inherit the Controller and just sort of rename the Model so
 that all the references still work.

 The problem is that I can make the references in the controller work
 quite well... But all array_indexes the model returns still have the
 original Model name. There are probably more pitfalls I have not even
 come close to.

 So, is there a good way for a ModelTwo to represent itself as ModelOne
 to the controller and Views?

In your controller there is a variable modelClass which is the name of
the primary model. If you:

1) Make use of this variable in your controller
   e.g. : $this-{$this-modelClass}-findAll(
2) Pass this var to the view
3) Use the passed variable in your views
   e.g. foreach ($data as $blob) { echo $blog[$modelClass]['name']...

You should find that helps in avoiding rewriting the same code. If
modelClass isn't the correct string for your model - just edit it in
the beforeFilter. I'm not aware of any concequences in doing this
unless you are using scaffolding.

An extension to this idea is to write generic functions in your app
contrller using modelClass, and only define your methods in the
specific controllers if they differ from the generic logic. It is
possible to change the view folder that is used for a controller
(viewPath variable), which if the views are all the same you could
also consider doing.

An alternative if these controllers and views are carbon copies is to
use routes to ensure requests all point to the same controller with a
named var which you can pick up in the beforeFilter method, and set
the var modelClass as appropriate. In this way you have n sets of
routes for your various 'controllers' and 1 controller and set of
views. This would be (perhaps) the cleanest MVC solution.

Well, 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: Using the same Views and Controller for more than one Model?

2007-03-01 Thread Martin

Thanks, that was a great tip.
It will defenitely work for me.


--~--~-~--~~~---~--~~
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: include another model's view

2007-03-01 Thread gerbenzomp

Hi AD7six!

Thanks a lot for your comprehensive article! It seems we're both
aiming for the same thing: a while ago I wrote such a system as the
Google personalised homepage, in php and with the help of
scriptaculous, to create an online WYSIWYG website builder and CMS.
Now I'm trying to partly re-create this in Cake.

Bit of a turndown to read that Cake doesn't have built-in support for
such modular design, especially since scriptaculous has such flexible
drag-and-drop features. I'll try out your mini-modules solution, and
see if I can get it to work! I'll keep you posted!


 PS Model's don't have views, but perhpas that was a slip of the keys.

Yep, I meant another controller's view :)

On 1 mrt, 08:47, AD7six [EMAIL PROTECTED] wrote:
 On Mar 1, 8:45 am, AD7six [EMAIL PROTECTED] wrote:



  On Mar 1, 12:08 am, gerbenzomp [EMAIL PROTECTED] wrote:

   I've been programming in php for years, but I'm relatively new to
   cake. I must say I am amazed at the ease of use and intuïtivity of the
   framework! Mostly things just work the way you expect them to, which
   makes it very easy to work with, and a great pleasure too!

   There's also a lot of good documentation, so most questions I had,
   were easily answered. Now i want to do something a little more
   complex, and ran into a problem:

   I want to use Cake's plugin-structure to allow for an extendible set
   of, well let's call them menu-widgets for the navigation-bar of my
   blog system.

   So each widget resides in its own folder within the plugins-folder,
   and has its own add/edit/delete methods and views.

   But now I want to include the main view (view.thtml) of each widget in
   the sidebar of my blog. Any ideas on how to do that?

  The immediate answer would be to use reqesutAction, the (not really
  slow) answer is to make use of elements. I wrote about a solution to
  this sort of modular design problem on my blog about this only
  yesterday (how ironic).http://www.noswad.me.uk/MiBlog/MiniControllers

  HTH,

  AD

 PS Model's don't have views, but perhpas that was a slip of the keys.


--~--~-~--~~~---~--~~
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: multi-page forms

2007-03-01 Thread Toby Parent

Hrummm... My validation rules were obeyed. Are you using a screwy 
validation class? It doesn't interfere with the model::save at all.

I'll check and see what turns up.

Regards!
 -Toby

lukemack wrote:
 cool thanks, Chris.

 Toby - the formwizard seems to break validation. did you use it with
 validation?

 On 27 Feb, 15:04, Chris Hartjes [EMAIL PROTECTED] wrote:
   
 On 2/23/07,lukemack[EMAIL PROTECTED] wrote:



 
 Chris - can you elaborate on the problem with the back button? I
 assume you mean the browser back button?  I guess there are three
 options - sessions, database and hidden fields. If the user hits
 'back' - is the session data lost? do hidden fields get lost? would
 using a database help?
   
 Yeah, I'm talking about the browser back button.  Unless you can
 completely disable it, you can run into problems in multi-page forms.
 Sessions are the best way to go because even they use the back button,
 the next time they load a page the session data should still be there
 (unless the session has timed out of course).

 My personal experience has been that you have to design your
 multi-page forms around the idea that they WILL screw you up by using
 the browser back button.

 Hope that helps.

 --
 Chris Hartjes

 My motto for 2007:  Just build it, damnit!

 rallyhat.com - digital photo scavenger hunt
 @TheBallpark -http://www.littlehart.net/attheballpark
 @TheKeyboard -http://www.littlehart.net/atthekeyboard
 


 

   


--~--~-~--~~~---~--~~
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: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread Samuel DeVore

On 3/1/07, AD7six [EMAIL PROTECTED] wrote:


 On Mar 1, 2:49 am, Samuel DeVore [EMAIL PROTECTED] wrote:
  requestAction is a method of Controller not Model

 Well.. actually it's a method of object. The error is caused by doing
 $this-SomethingThatDoesn'tExist-method();


And the funny thing is I even linked to it in class_object.html in the api...
-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

--~--~-~--~~~---~--~~
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: Problem with multiple INSERTS

2007-03-01 Thread [EMAIL PROTECTED]

For the moment its run OK - I will find a better solution.
My controller received a array with data[Blogs_tags][checkID] and
parse it to associate with my Blogs_id at each row.
maybe its not so clear i post the code:

$str = '';
$i = 0;
foreach($tags as $name):
$i++;
$str .= 'input type=checkbox name=data[Blogs_tags][checkID]['.
$i.'] value='.$name['Tag']['id'].'  ';
foreach($data['Tag'] as $value):
if($value['id']==$name['Tag']['id'])
{
$str .= ' checked=1 ';
}else{
$str .= ' ';
}
endforeach;
$str .= ' / '.$name['Tag']['name'].'br /';
endforeach;
echo $str;

On 28 feb, 20:07, codecowboy [EMAIL PROTECTED] wrote:
 How do you build an array of checkboxes?


--~--~-~--~~~---~--~~
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: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread phirschybar

OK.

So this: var $uses = array('Category'); is the key here. Because I am
doing a beforeFilter(), my model wasn't loaded yet.?

On Mar 1, 8:58 am, Samuel DeVore [EMAIL PROTECTED] wrote:
 On 3/1/07, AD7six [EMAIL PROTECTED] wrote:



  On Mar 1, 2:49 am, Samuel DeVore [EMAIL PROTECTED] wrote:
   requestAction is a method of Controller not Model

  Well.. actually it's a method of object. The error is caused by doing
  $this-SomethingThatDoesn'tExist-method();

 And the funny thing is I even linked to it in class_object.html in the api...
 --
 ==
 S. DeVore
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot


--~--~-~--~~~---~--~~
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: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread AD7six



On Mar 1, 4:02 pm, phirschybar [EMAIL PROTECTED] wrote:
 OK.

 So this: var $uses = array('Category'); is the key here. Because I am
 doing a beforeFilter(), my model wasn't loaded yet.?

It isn't important with regards to your problem whether you use
beforeFilter or beforeRender. However, putting the display logic in
beforeFilter means that even for controller actions which do not
render a view (e.g. form submissions which redirect upon success) this
logic would be executed needlessly.

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



RoR to Cake Migration

2007-03-01 Thread MikeK

Dear Cakers ;)

A friend just sent me a link about Cake and I am excited about using
it and
have a few questions I was hoping ya'll could answer.

I used RoR to add some web applications and new features to an
existing
fishing website for running and scoring tournaments. While the
application
itself was simple to develop, deploying it and integrating it with a
website
written with traditional html and php was difficult. I ended up
deploying
the RoR app as a subdomain of the primary site for simplicity since
merging
a RoR app with an existing website is quite troublesome -- I really
got
overwhelmed by apache rewrites and all the other issues -- I was using
Mongrel.

The website also has forums run by phpBB, which are also bridged to
CPG
photo galleries. My 2nd huge headache for deployment became doing
single
login authentication. I wanted the RoR app to be just like CPG photo
gallery
when bridged to phpBB -- I wanted my users to have single unified
login
functionality across all my pages whether they were in the forums,
galleries, or in the web apps I created for tournament sdcoring and
other
functions I wanted to offer. Since I deployed my Ruby app as a
subdomain
(rorappname.mywebsite.com) to the main website at www.mywebsite.com
the Ruby
app could not share the cookies managed by phpBB, which are central to
it's
login and session management.

I created a tangled bit of code where my RoR apps had to essentially
load
dummy php pages on the  true web domain which did the phpBB cookie
management and synchronization constantly, and of course I also had to
create requisite code for returning the control to the RoR code that
initiated the request for session management -- what a NIGHTMARE. Of
course
the Ruby code that looked up things in the phpBB userDB was simple but
my
hope for a truly unified solution left me unhappy with this inelegant
result.

Now I see Cake as a viable alternative. I have no problem relearning
the
similar paradigms and getting productive on Cake -- from what I see
out
there plenty of info exists and I did get the RoR running in days so
that
should be no problem. I also saw the Cake phpBB package and am
reviewing it
to see if it will give me what I want. I really liked the productivity
I
gained in RoR, but the lack of control and deployment issues SUCKED
BIGTIME.

Is Cake going to help me over those 2 humps?

Thanks in advance for the opinions, and I apologize if there is a
better
place to ask these questions.

Regards,
Ready To Discard RoR Mike


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



newbie problem cakePHP/Ajax

2007-03-01 Thread Bart op de grote markt

Hello,

I just installed WAMP-server (Apache/Php/Mysql) and cakePHP.  I'm
seeing the startpage that is mentioned on the cakePHP-site and the
database-connection is also right.
Now I was looking for some tutorials and I found this one:
http://grahambird.co.uk/cake/tutorials/ajax.php.
One of the steps is to the following:

 Upload script.aculo.us files

Place the script.aculo.us files in the /app/webroot/js/ folder. Don't
forget to put the prototype.js file (that comes with the
script.aculo.us library) in the same folder.

To make the JavaScript libraries available to Cake, you also need to
add the following inside the head tag of your Layout file (/app/
views/layouts/default.thtml):

?php print $html-charsetTag('UTF-8') ?
?php print $javascript-link('prototype') ?
?php print $javascript-link('scriptaculous.js?load=effects') ?

Note: The Ajax functions only work with the UTF-8 character set
declaration.

If you have not created a layout file (ie the /app/views/layouts/
folder is empty), you can add these lines to the default Cake layout
(in /cake/libs/views/templates/layouts/).



I did everything as mentioned, but now I get the following error when
I execute http://localhost/; or http://localhost/tasks:




Notice: Undefined variable: javascript in C:\wamp\www\cake\libs\view
\templates\layouts\default.thtml on line 35

Fatal error: Call to a member function link() on a non-object in C:
\wamp\www\cake\libs\view\templates\layouts\default.thtml on line 35



So a problem with $javascript. Since I don't know what the framework
exactly does, I have now idea what to do.  The variable $html doesn't
seem to give a problem.  I could see in the sourcecode that the
charset was set to UTF-8, quite spectacular :-).


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



adding a string into monthOptionTag

2007-03-01 Thread Thomas

Hai!

Is there a way to add another option into the list of months. I want
to have the option all on top of all the months. It would be nice,
because otherwise I have to make a list of dates manually.

Thanks in advance.


--~--~-~--~~~---~--~~
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: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread Mariano Iglesias

Models are instantiated before running beforeFilter(). You can see this by
looking at dispatch() in class Dispatcher, located at cake/dispatcher.php:

1. Creates the controller: $controller = new $ctrlClass();

2. Initializes components: $controller-_initComponents()

3. Initializes models in the controller: $controller-constructClasses()

4. Invokes the action: $this-_invoke($controller, $params, $missingAction)

Then Dispatcher::_invoke():

1. Starts the controller (see below): $this-start($controller);

2. Executes the action and get its output.

3. Runs afterFilter(): $controller-afterFilter();

Now Dispatcher::start() does:

1. If there are functions defined in the array $beforeFilter, execute each
one of them (if they are callables): $controller-$filter();

2. Runs main beforeFilter: $controller-beforeFilter();

3. Starts up each component: $controller-{$c}-startup($controller);

I guess my point is by looking at the source code you can learn a lot. Just
ask Felix and Andy ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de AD7six
Enviado el: Jueves, 01 de Marzo de 2007 12:42 p.m.
Para: Cake PHP
Asunto: Re: error: Call to a member function requestAction() on a non-object

So this: var $uses = array('Category'); is the key here. Because I am doing
a beforeFilter(), my model wasn't loaded yet.?


--~--~-~--~~~---~--~~
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: baking the scaffolding

2007-03-01 Thread [EMAIL PROTECTED]

On Feb 28, 8:54 am, hydra12 [EMAIL PROTECTED] wrote:
 I'm not sure where the documentation is, but here's how I do it:


Thank you very much for posting this.  While the existing CakePHP
documentation is quite good, it does not discuss bake.  Nor have I
found this information covered in any level of detail beyond, just
take down your scaffolding and run bake.

I believe your short post is the best, most thorough description of
how to use bake.php


--~--~-~--~~~---~--~~
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: Help Using Date Range with findAll

2007-03-01 Thread BlenderStyle

Thanks, AD! That cleared up a lot for me. You're posts are always so
informative. I'm going to star this for later.

On Mar 1, 1:03 am, AD7six [EMAIL PROTECTED] wrote:
 On Mar 1, 4:18 am, BlenderStyle [EMAIL PROTECTED] wrote:

  I figured it out. I did this:
  $conditions[]['Post.created'] = '= 2007-02-01';
  $conditions[]['Post.created'] = '= 2007-02-28';
  $this-Post-find($conditions);

  It seems the complex conditions section in the model chapter in the
  CakePHP Manual was wrong. It seems as Cake continues, the manual just
  seems older and older. Oh well, Cake still rocks.

 There is no error in the manual wrt to how to generate array
 constraints; I think there is a simple misunderstanding.

 $conditions['Post.created'] = array('= 2007-02-01', '=
 2007-02-28');
 will generate
 ... WHERE `Post`.`created` IN ('= 2007-02-01', '= 2007-02-28') ...
 which is obviously not what you wanted. using an array in that manner
 ONLY generates an IN statemnet, it isn't used to build a list of
 conditions to apply to the same field, where in the manual does it
 suggest this will work?

 There are several alternatives to the final solution you found (just
 for info)
 1)
 $conditions['Post.created'] = '= 2007-02-01';
 $conditions[]['Post.created'] = '= 2007-02-28';
 The only reason the extra array (or arrays in your solution) are
 needed is because otherwise you would overwrite one condition with
 another.

 2)
 $conditions['Post.created'] = 'BETWEEN 2007-02-01 AND 2007-02-28';
 (iirc)

 Oh well, Cake still rocks.

 indeederoony :)

 Cheers,

 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: error: Call to a member function requestAction() on a non-object

2007-03-01 Thread phirschybar

AD7 and Mariano, thanks. Yeah I'll be digging through the source
before long ;)

On Mar 1, 11:12 am, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Models are instantiated before running beforeFilter(). You can see this by
 looking at dispatch() in class Dispatcher, located at cake/dispatcher.php:

 1. Creates the controller: $controller = new $ctrlClass();

 2. Initializes components: $controller-_initComponents()

 3. Initializes models in the controller: $controller-constructClasses()

 4. Invokes the action: $this-_invoke($controller, $params, $missingAction)

 Then Dispatcher::_invoke():

 1. Starts the controller (see below): $this-start($controller);

 2. Executes the action and get its output.

 3. Runs afterFilter(): $controller-afterFilter();

 Now Dispatcher::start() does:

 1. If there are functions defined in the array $beforeFilter, execute each
 one of them (if they are callables): $controller-$filter();

 2. Runs main beforeFilter: $controller-beforeFilter();

 3. Starts up each component: $controller-{$c}-startup($controller);

 I guess my point is by looking at the source code you can learn a lot. Just
 ask Felix and Andy ;)

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar

 -Mensaje original-
 De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
 de AD7six
 Enviado el: Jueves, 01 de Marzo de 2007 12:42 p.m.
 Para: Cake PHP
 Asunto: Re: error: Call to a member function requestAction() on a non-object

 So this: var $uses = array('Category'); is the key here. Because I am doing
 a beforeFilter(), my model wasn't loaded yet.?


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



So confused

2007-03-01 Thread skatona

I must be losing it.

I'm a veteran php web developer and a friend said cakephp was awesome
so I've checked it out and gone through a couple screencasts.  Am I
crazy, or is the Blog Tutorial screencast wrong?  More specifically,
the Edit functionality does NOT edit a post.  It merely Adds one.

Watch the screencast again.  You click Edit, it brings up the Title
and Body textboxes with the information from that post, but when you
edit it and save - it just creates a new post!  I thought Edit meant
change, not give me the info so I can use it in another NEW post.

Someone please help me out here.

-Shaun


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



Question about model relationships

2007-03-01 Thread Anthony

OK, I'm aware this is probably a very dumb, newbie question, but you
gotta start somewhere, right?

Say I have a users table and a messages table. For each ONE user,
there are MULTIPLE messages. However, when doing a findAll on the
users, I would like it to spit back all the messages the user has both
sent AND received.

In the messages table, I am using belongsTo and the foreignKey is
set to the user ID that the message was sent TO. How can I tell the
model that the message also belongs to the user that sent the
message?


--~--~-~--~~~---~--~~
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: multi-page forms

2007-03-01 Thread lukemack

toby - i fixed that problem. i was missing the special validate()
method you need for the formwizard - by fluke, the author of the
component was on IRC when i asked.

On 1 Mar, 13:30, Toby Parent [EMAIL PROTECTED] wrote:
 Hrummm... My validation rules were obeyed. Are you using a screwy
 validation class? It doesn't interfere with the model::save at all.

 I'll check and see what turns up.

 Regards!
  -Toby

 lukemack wrote:
  cool thanks, Chris.

  Toby - the formwizard seems to break validation. did you use it with
  validation?

  On 27 Feb, 15:04, Chris Hartjes [EMAIL PROTECTED] wrote:

  On 2/23/07,lukemack[EMAIL PROTECTED] wrote:

  Chris - can you elaborate on the problem with the back button? I
  assume you mean the browser back button?  I guess there are three
  options - sessions, database and hidden fields. If the user hits
  'back' - is the session data lost? do hidden fields get lost? would
  using a database help?

  Yeah, I'm talking about the browser back button.  Unless you can
  completely disable it, you can run into problems in multi-page forms.
  Sessions are the best way to go because even they use the back button,
  the next time they load a page the session data should still be there
  (unless the session has timed out of course).

  My personal experience has been that you have to design your
  multi-page forms around the idea that they WILL screw you up by using
  the browser back button.

  Hope that helps.

  --
  Chris Hartjes

  My motto for 2007:  Just build it, damnit!

  rallyhat.com - digital photo scavenger hunt
  @TheBallpark -http://www.littlehart.net/attheballpark
  @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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: Question about model relationships

2007-03-01 Thread AD7six



On Mar 1, 6:02 pm, Anthony [EMAIL PROTECTED] wrote:
 OK, I'm aware this is probably a very dumb, newbie question, but you
 gotta start somewhere, right?

 Say I have a users table and a messages table. For each ONE user,
 there are MULTIPLE messages. However, when doing a findAll on the
 users, I would like it to spit back all the messages the user has both
 sent AND received.

 In the messages table, I am using belongsTo and the foreignKey is
 set to the user ID that the message was sent TO. How can I tell the
 model that the message also belongs to the user that sent the
 message?

In your message table:
create the field sender_id
rename user_id to recipient_id

In your Message model,
var $belongsTo = array(
'Sender'=array('className'='User','foreignKey'='sender_id'),
'Recipient'=array('className'='User','foreignKey'='recipient_id')
);

In your User model,
var $hasMany = array(
'SentMessages'=array('className'='Message','foreignKey'='sender_id'),
'ReceivedMessages'=array('className'='Message','foreignKey'='recipient_id')
);

In your User controller, after creating some dummy data,  put pr($this-
User-findAll()); and you should see the user, and both the messages
sent and received. If there are any errors in the above, check the api/
manual ;)

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: RoR to Cake Migration

2007-03-01 Thread _psychic_


On Mar 1, 2007, at 7:58 AM, MikeK wrote:

 snip
 Now I see Cake as a viable alternative. I have no problem relearning
 the
 similar paradigms and getting productive on Cake -- from what I see
 out
 there plenty of info exists and I did get the RoR running in days so
 that
 should be no problem. I also saw the Cake phpBB package and am
 reviewing it
 to see if it will give me what I want. I really liked the productivity
 I
 gained in RoR, but the lack of control and deployment issues SUCKED
 BIGTIME.

 Is Cake going to help me over those 2 humps?

Yep.

For third party apps, just stick them in your /app/webroot folder and  
let then function on their own.

For a single sign on solution, use CakePHP's database sessions.  
You'll have to play a little with your other apps to make them check  
out the centralized session stored in the DB, but that shouldn't be a  
huge issue.

In short, Cake is the answer to all your development problems. :)

Best of luck, and join us in the IRC channel for some quick help if  
you run into snags.

-- John

--~--~-~--~~~---~--~~
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: Question about model relationships

2007-03-01 Thread Anthony

Thanks, that solved the problem!!

- Anthony


--~--~-~--~~~---~--~~
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: So confused

2007-03-01 Thread bernardo

You are right. There is a bug in the code used in the screencast. I
think the problem is that edit.thtml is copied from add.thtml but
forget to include the line  ?php echo $html-hidden('Post/id'); ? so
the id is not posted and the controller ends adding a new post. The
code in the manual is correct though.

I wonder how nobody noticed this before...

On Mar 1, 1:41 pm, skatona [EMAIL PROTECTED] wrote:
 I must be losing it.

 I'm a veteran php web developer and a friend said cakephp was awesome
 so I've checked it out and gone through a couple screencasts.  Am I
 crazy, or is the Blog Tutorial screencast wrong?  More specifically,
 the Edit functionality does NOT edit a post.  It merely Adds one.

 Watch the screencast again.  You click Edit, it brings up the Title
 and Body textboxes with the information from that post, but when you
 edit it and save - it just creates a new post!  I thought Edit meant
 change, not give me the info so I can use it in another NEW post.

 Someone please help me out here.

 -Shaun


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



Beginner : extended tree helper to display other fields

2007-03-01 Thread mamato

Hi,

I was having a problem on displaying other fields for my 'Category'
model using the tree helper, like this

name description
-
CarAll about cars
-New  New cars
-Used Pre owned cars

the tree helper can display the first field nicely but not the other
fields in the model. This is my first try, thought I extend the tree
helper a bit to allow other fields to be displayed. Here portion of it
goes;

pre

 function show($name, $data,  $arrayOfFields = null))
  {
list($modelName, $fieldName) = explode('/', $name);
$output = $this-list_element($data, $modelName, $fieldName, 0,
$arrayOfFields);

return $this-output($output);
  }

  function list_element($data, $modelName, $fieldName, $level,
$arrayOfFields=null)
  {
$tabs = \n . str_repeat($this-tab, $level * 2);
$li_tabs = $tabs . $this-tab;

$output = $tabs. ul;
foreach ($data as $key=$val)
{
  if(!is_null($arrayOfFields)) {
foreach($arrayOfFields as $key=$otherField){
$text .= 'nbsp ' . $val[$modelName][$otherField];
}
  }
  $output .= $li_tabs . li.$val[$modelName][$fieldName];
  if(isset($val['children'][0]))
  {
$output .= $this-list_element($val['children'], $modelName,
$fieldName, $level+1, $arrayOfFields);
$output .= $li_tabs . /li;
  }
  else
  {
$output .= /li;
  }
}
$output .= $tabs . /ul;

return $output;
  }
/pre

Now if only it can be displayed in table format... Comments
appreciated.

mamato.


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



Troubles with routes

2007-03-01 Thread andy corpes
Hi Group,

It seems that a recent installation of cake has broken some part of my
configuration, I've gone through the original installation procedures, but
cannot see where i have gone wrong.

I now have a single entry in route.php as follows:-

$Route-connect ('/tblallhosts/:action/*',
array('controller'='TblAllhosts'));

Now,  this url works:-

http://ac85489m/cake/index.php/TblAllhosts/

while this:-
http://ac85489m/cake/TblAllhosts/
and this:-
http://ac85489m/cake/TblAllhosts/

Do not.

I'm sure i've missed something, somewhere, but can anyone give me some clues
as to where to look?


-- 
Andy

--~--~-~--~~~---~--~~
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: MySQL export and import

2007-03-01 Thread Christopher E. Franklin, Sr.

bump

On Jan 8, 2:57 am, phpjoy [EMAIL PROTECTED] wrote:
 hey all,

 is there a class in CakePHP forexporting/importingSQLcalls?
 backing up a server, etc?exportingSQLto XML and XML toSQL?

 thanks


--~--~-~--~~~---~--~~
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: MySQL export and import

2007-03-01 Thread Samuel DeVore

no

On 1/8/07, phpjoy [EMAIL PROTECTED] wrote:

 hey all,

 is there a class in CakePHP for exporting/importing SQL calls?
 backing up a server, etc?
 exporting SQL to XML and XML to SQL?

 thanks


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

--~--~-~--~~~---~--~~
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: MySQL export and import

2007-03-01 Thread John David Anderson (_psychic_)


On Mar 1, 2007, at 12:42 PM, Christopher E. Franklin, Sr. wrote:


 bump

Please don't bump an issue without making an effort to improve your  
question.


 On Jan 8, 2:57 am, phpjoy [EMAIL PROTECTED] wrote:
 hey all,

 is there a class in CakePHP forexporting/importingSQLcalls?

Well, the model does that at some level but give us an example of  
what you're talking about.

 backing up a server, etc?exportingSQLto XML and XML toSQL?

Not that I know of - there's not any native support for this kind of  
thing - but writing something that would do it wouldn't seem too hard.

-- John

--~--~-~--~~~---~--~~
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: So confused

2007-03-01 Thread skatona

oh man, thank you.  I've been going crazy thinking that they wouldn't
possibly let something like that slip by, so have been staring at each
and every individual character in my code to see what I messed up.
Over and over.

Thanks a ton!

On Mar 1, 2:30 pm, bernardo [EMAIL PROTECTED] wrote:
 You are right. There is a bug in the code used in the screencast. I
 think the problem is that edit.thtml is copied from add.thtml but
 forget to include the line  ?php echo $html-hidden('Post/id'); ? so
 the id is not posted and the controller ends adding a new post. The
 code in the manual is correct though.

 I wonder how nobody noticed this before...

 On Mar 1, 1:41 pm, skatona [EMAIL PROTECTED] wrote:

  I must be losing it.

  I'm a veteran php web developer and a friend said cakephp was awesome
  so I've checked it out and gone through a couple screencasts.  Am I
  crazy, or is the Blog Tutorial screencast wrong?  More specifically,
  the Edit functionality does NOT edit a post.  It merely Adds one.

  Watch the screencast again.  You click Edit, it brings up the Title
  and Body textboxes with the information from that post, but when you
  edit it and save - it just creates a new post!  I thought Edit meant
  change, not give me the info so I can use it in another NEW post.

  Someone please help me out here.

  -Shaun


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



FindAll with HABTM issue

2007-03-01 Thread Dave

OK, so I've established a HABTM association between Tags and
Events. Tags have many events and Events have many tags, so it goes
both ways.

I want to fetch events for a particular Tag id:

function getEventsByTag($tag_id) {

$events = $this-Event-findAll('Tag.id='.$tag_id);
return $events;

}

It returns empty.

??


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



Speed

2007-03-01 Thread Anthony

I am having an issue with MySQL query speed...
Here is the query CakePHP is trying to perform:

SELECT `Review`.`id`, `Review`.`user_id`, `Review`.`book_id`,
`Review`.`comments`, `Review`.`rating_plot`,
`Review`.`rating_character_dev`, `Review`.`rating_style`,
`Review`.`rating_pacing`, `Review`.`rating_overall`,
`Review`.`published`, `Review`.`active`, `User`.`id`,
`User`.`username`, `User`.`email`, `User`.`password`,
`User`.`created`, `User`.`modified`, `User`.`first_name`,
`User`.`last_name`, `User`.`birthday`, `User`.`sex`, `User`.`city`,
`User`.`state`, `User`.`news`, `User`.`active`, `Book`.`id`,
`Book`.`image`, `Book`.`title`, `Book`.`translators`, `Book`.`year`,
`Book`.`year_suffix`, `Book`.`keywords`, `Book`.`isbn`,
`Book`.`active` FROM `reviews` AS `Review` LEFT JOIN `users` AS `User`
ON `Review`.`user_id` = `User`.`id` LEFT JOIN `books` AS `Book` ON
`Review`.`book_id` = `Book`.`id` WHERE 1 = 1

When I throw that into phpMyAdmin, it gives me back my results in
0.0007 seconds. However, the time it takes Cake to generate the
print_r results of that query on the page is 2.6624 seconds. I am
trying to figure out what the hold up is. I was wondering if there is
any type of specific error logs I could look at, or if anybody knows
why this might be happening.

- Anthony


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



troubles with cake_1.1.13.4450

2007-03-01 Thread [EMAIL PROTECTED]

I cant load one of my class, i think the load modules is more strict
but not understand my errror

Fatal Error -  Cant Load `Category` Class Model  etc ect


:(

---

Dan


--~--~-~--~~~---~--~~
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: FindAll with HABTM issue

2007-03-01 Thread Dave

Not working either.

On Mar 1, 1:19 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
 why not

 $this-Event-findAll(array('Tag.tag_id' = $tag_id));

 since you want all the events with a particular tag_id


--~--~-~--~~~---~--~~
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: troubles with cake_1.1.13.4450

2007-03-01 Thread Langdon Stevenson

Hi Dan

 I cant load one of my class, i think the load modules is more strict
 but not understand my errror
 
 Fatal Error -  Cant Load `Category` Class Model  etc ect

I would start by checking the class names of controller and model, if I 
have an error like that, it is usually my fault and caused by a mistake 
in class names that I have made.

Also if you are using Ant or similar to build the project to a test 
server, then you may have duplicate files if a file name has changed.

Just a couple of thoughts for you.

Regards,
Langdon

--~--~-~--~~~---~--~~
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: newbie problem cakePHP/Ajax

2007-03-01 Thread Langdon Stevenson

Hi Bart

It's hard to know what the problem is, but my guess would be that the 
javascript file/s are not being loaded.  It would help if you posted the 
page source so that we can see what is on line 35, and what the link 
tags are outputting.

Regards,
Langdon


 I did everything as mentioned, but now I get the following error when
 I execute http://localhost/; or http://localhost/tasks:
 
 
 
 
 Notice: Undefined variable: javascript in C:\wamp\www\cake\libs\view
 \templates\layouts\default.thtml on line 35
 
 Fatal error: Call to a member function link() on a non-object in C:
 \wamp\www\cake\libs\view\templates\layouts\default.thtml on line 35
 
 
 So a problem with $javascript. Since I don't know what the framework
 exactly does, I have now idea what to do.  The variable $html doesn't
 seem to give a problem.  I could see in the sourcecode that the
 charset was set to UTF-8, quite spectacular :-).

--~--~-~--~~~---~--~~
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: newbie problem cakePHP/Ajax

2007-03-01 Thread John David Anderson (_psychic_)


On Mar 1, 2007, at 2:12 PM, Langdon Stevenson wrote:


 Hi Bart

 It's hard to know what the problem is, but my guess would be that the
 javascript file/s are not being loaded.  It would help if you  
 posted the
 page source so that we can see what is on line 35, and what the link
 tags are outputting.

I'd guess that the controller rendering the view doesn't have the  
JavascriptHelper available.

var $helpers = array('Html', 'Javascript');

-- John

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



Best performance in templates

2007-03-01 Thread mozart_ar

when we wrote templates for the views, I believe that he is better to
put everything within the labels of php, in place to open and to close
whenever we needed to accede to some variable or to helper. This would
help to the performance of cakephp, correct? Why the script bake.php
makes the opposite?


--~--~-~--~~~---~--~~
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: FindAll with HABTM issue

2007-03-01 Thread AD7six



On Mar 1, 9:37 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
 On Mar 1, 2007, at 1:29 PM, Dave wrote:



  Not working either.

 If we're going to be able to help, you'll need to give us at least a
 few details.

 ;)

 -- John

Isn't it great that the group search, let's you find old answers to
old questions :D

http://groups.google.com/group/cake-php/search?group=cake-phpq=filtering+habtmqt_g=Search+this+group

Btw Sam may have meant to say:
$this-Tag-findAll(array('Tag.tag_id' = $tag_id));

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: FindAll with HABTM issue

2007-03-01 Thread Samuel DeVore

no actually in my sleep depriced, addled old brain state I meant to say

$this-Event-findAll(array('Event.tag_id' = $tag_id));

man friggin clients are driving my brain nutty

On 3/1/07, AD7six [EMAIL PROTECTED] wrote:



 On Mar 1, 9:37 pm, John David Anderson (_psychic_)
 [EMAIL PROTECTED] wrote:
  On Mar 1, 2007, at 1:29 PM, Dave wrote:
 
 
 
   Not working either.
 
  If we're going to be able to help, you'll need to give us at least a
  few details.
 
  ;)
 
  -- John

 Isn't it great that the group search, let's you find old answers to
 old questions :D

 http://groups.google.com/group/cake-php/search?group=cake-phpq=filtering+habtmqt_g=Search+this+group

 Btw Sam may have meant to say:
 $this-Tag-findAll(array('Tag.tag_id' = $tag_id));

 HTH,

 AD


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

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



portal system

2007-03-01 Thread mogguy

Hi there!

Half a year ago I started writing my first bigger application in php.
As I'm a student at the university of Munich, Germany I felt it would
be nice to have a possibility to store lecture links in a webpage and
access them at home, at my parents home and from every computer in the
university's cip pools (where JS is often disabled, which means that I
couldn't use many already existing services). At first I wrote a
simple unformated html-document and loaded it up. That was just for
me. Then some friends asked me to write a similar page for them too. I
started working on a system that provides a page for every user. This
page has a linkmodule that can be filled with personal links and it is
possible to add some more modules, like a google searchbar and login
fields to freemail accounts. To only access the links and the
searchbar a login isn't required. For editing and using other modules
the user has to login. If a user wants to reach his page he only has
to type in www.360mix.de/username

http://www.360mix.de/mogguy (my personal page - standard colors)
http://www.360mix.de/CoMArO (my brother's page - he personalized the
set of colors)

Well I stopped working on this first version because of the
unorganized code. Two weeks ago I found cakephp, downloaded it and was
so happy about all the features. I read the manual and some articles.
For example the article about dAuth V0.3. Until now I was sure to do
this project on my own. But in this article there was so much about
security issues I didn't even thought about before so that it came to
my mind to get some professional help by the cakephp community.

My idea now is to turn this into an open source project. I really
don't want to only get the work done by others. What I want is to
profit from the knowledge of more experienced programmers to get a
well and organized code at the end.

The goal of this project is to provide a basic framework for this kind
of  portal system (pageflakes.com, netvibes.com and personalized
google) with some basic modules (like link boxes, search fields, notes
module and so on). After setting up this system on one's own server,
it is easy to add own modules and it will be possible to share those
modules with the community.

Some Features in keywords:
Registering and fast configuration tool so that users get started
quickly
Secure authentication - (d_auth v 0.3 ?)
Users can have one or more pages
Pages as tabs at the top
Possibility to share pages with other users
Groups that can have one or more pages (for example learning groups at
the university)
Tagging System
Modules rearrangable via drag  drop
In Place Editing of modules
Ajax
Switching between different layouts
Interface for user programmed modules that lie on remote servers
A possibility to access user pages (with fewer options) when js is
disabled
[to be continued with your ideas]

To give you an overview of my planned models I uploaded my mindmap:
http://www.360mix.de/models.html
Yellow fields are jointables - HABTM association between the models
Every table to the right of the modules field is a table providing
data for special modules (fields in muddy green (if this is correct
English:-) ))

Well, I never worked in a open source project before and I don't know
much about this kind of programming, so it would be a lot of pleasure
to me to get introduced by you!

What do you think about this project? Drop some comments, drop some
hints to get me started with the code organization and post something
like I want to get involved too ;-)

with best regards,
Moritz


--~--~-~--~~~---~--~~
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: Troubles with routes

2007-03-01 Thread fr3nch13

check to see if your mod_rewrite is working correctly

On Mar 1, 2:39 pm, andy corpes [EMAIL PROTECTED] wrote:
 Hi Group,

 It seems that a recent installation of cake has broken some part of my
 configuration, I've gone through the original installation procedures, but
 cannot see where i have gone wrong.

 I now have a single entry in route.php as follows:-

 $Route-connect ('/tblallhosts/:action/*',
 array('controller'='TblAllhosts'));

 Now,  this url works:-

 http://ac85489m/cake/index.php/TblAllhosts/

 while this:-http://ac85489m/cake/TblAllhosts/
 and this:-http://ac85489m/cake/TblAllhosts/

 Do not.

 I'm sure i've missed something, somewhere, but can anyone give me some clues
 as to where to look?

 --
 Andy


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



Big Web Application Suggestion

2007-03-01 Thread Leandro Ardissone

Hi,

We will be starting a new big application in the following months and
I want to know what resources I'll need to do it or what suggestions
can you give us, since it's our first huge project.
For example, what kind of platform and OS, what backend language, what
frontend, etc.

The application is based on a big database of texts and excerpts, and
we need to create an interface to allow many resources acting as data
entry, editors, some administrators that does moderation utilities,
and a rich front end that can manage around 2 millions visits daily.
The more actions that will eat more resources will be the searches
around the data, because it will be the key of the functionality of
the site.
The database will handle around 1gb of texts, hopefully, well indexed
and sorted.

I've in mind a Linux based server with dual processor and 4gb of
memory as base.
And for the backend I thought in a framework like CakePHP.


What do you think?
Also what tools do you think I could use to improve performance,
acceleration and/or caching ?

Thanks in advance,
Leandro


--~--~-~--~~~---~--~~
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: troubles with cake_1.1.13.4450

2007-03-01 Thread [EMAIL PROTECTED]

No,, sorry

No case.

the cakephp frwk cant load my model.
Its curious coz in version 1.1.8 its works perfectly.
---
Dan

On 1 mar, 17:59, Langdon Stevenson [EMAIL PROTECTED] wrote:
 Hi Dan

  I cant load one of my class, i think the load modules is more strict
  but not understand my errror

  Fatal Error -  Cant Load `Category` Class Model  etc ect

 I would start by checking the class names of controller and model, if I
 have an error like that, it is usually my fault and caused by a mistake
 in class names that I have made.

 Also if you are using Ant or similar to build the project to a test
 server, then you may have duplicate files if a file name has changed.

 Just a couple of thoughts for you.

 Regards,
 Langdon


--~--~-~--~~~---~--~~
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: FindAll with HABTM issue

2007-03-01 Thread Dave

Yeah, but when there are thousands of posts, it's sometimes hard to
find that needle in the haystack :)
I searched for at least a half-hour before posting...

On Mar 1, 2:22 pm, AD7six [EMAIL PROTECTED] wrote:
 On Mar 1, 9:37 pm, John David Anderson (_psychic_)

 [EMAIL PROTECTED] wrote:
  On Mar 1, 2007, at 1:29 PM, Dave wrote:

   Not working either.

  If we're going to be able to help, you'll need to give us at least a
  few details.

  ;)

  -- John

 Isn't it great that the group search, let's you find old answers to
 old questions :D

 http://groups.google.com/group/cake-php/search?group=cake-phpq=filte...

 Btw Sam may have meant to say:
 $this-Tag-findAll(array('Tag.tag_id' = $tag_id));

 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: FindAll with HABTM issue

2007-03-01 Thread Dave

Yep! Works like a charm. Thanks

On Mar 1, 2:35 pm, Samuel DeVore [EMAIL PROTECTED] wrote:
 no actually in my sleep depriced, addled old brain state I meant to say

 $this-Event-findAll(array('Event.tag_id' = $tag_id));

 man friggin clients are driving my brain nutty

 On 3/1/07, AD7six [EMAIL PROTECTED] wrote:





  On Mar 1, 9:37 pm, John David Anderson (_psychic_)
  [EMAIL PROTECTED] wrote:
   On Mar 1, 2007, at 1:29 PM, Dave wrote:

Not working either.

   If we're going to be able to help, you'll need to give us at least a
   few details.

   ;)

   -- John

  Isn't it great that the group search, let's you find old answers to
  old questions :D

 http://groups.google.com/group/cake-php/search?group=cake-phpq=filte...

  Btw Sam may have meant to say:
  $this-Tag-findAll(array('Tag.tag_id' = $tag_id));

  HTH,

  AD

 --
 ==
 S. DeVore
 (the old fart) the advice is free, the lack of crankiness will cost you

 - its a fine line between a real question and an idiot


--~--~-~--~~~---~--~~
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: FindAll with HABTM issue

2007-03-01 Thread Samuel DeVore

On 3/1/07, Dave [EMAIL PROTECTED] wrote:

 Yeah, but when there are thousands of posts, it's sometimes hard to
 find that needle in the haystack :)
 I searched for at least a half-hour before posting...


One way to make ones search more effective, is to add to it posters
that you know make good advice and comments,  my first pass at a query
in this group is always to add 'nate' to the end of the query ;)
AD7six is a good one too as is _psychic_

Sam D

ps if all you want is a snarky worthless answers add 'old fart'  ;)

--~--~-~--~~~---~--~~
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: troubles with cake_1.1.13.4450

2007-03-01 Thread Mariano Iglesias

You need to provide us with more information than that for us to understand
your problem.

If it is working on 1.1.8 it is most likely because you are doing:

$model = new Model()

When in 1.1.13 you should be doing:

loadModel('Model');
$model = new Model();

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Jueves, 01 de Marzo de 2007 07:41 p.m.
Para: Cake PHP
Asunto: Re: troubles with cake_1.1.13.4450

No,, sorry

No case.

the cakephp frwk cant load my model.
Its curious coz in version 1.1.8 its works perfectly.


--~--~-~--~~~---~--~~
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: findNeighbours does not seem to be working

2007-03-01 Thread Samuel DeVore

I've never used it but if you want to paste your model/controllers and
the db schema in http://bin.cakephp.org  I bet you might get some
people interested in helping you

Sam D
On 2/28/07, Xandornot [EMAIL PROTECTED] wrote:

 I even tried putting this in the model with all parameters as static
 values, still it does not respond with any values for prev and next.
 Does anyone have any ways to get this to work?

 On Feb 26, 9:32 am, Xandornot [EMAIL PROTECTED] wrote:
  Hi, has anyone successfully used findNeighbours? I have tried this in
  several models and even a simple use such as $this-set('neighbours',
  $this-Slide-findNeighbours(null, 'id', $id); with $id properly
  filled only produces an empty array of [prev] and [next] with no
  previous and next ids produced. Any ideas?


 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

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



Help Using Date Range with findAll

2007-03-01 Thread BlenderStyle

I'm trying to find all Posts within a given range of dates (the month
of February 2007 in this example), and I can't figure it out.

This isn't returning any results:
$conditions['Post.created'] = array('= 2007-02-01', '= 2007-02-28');
$this-Post-findAll($conditions);

The strange part is that this works:
$conditions['Post.created'] = '= 2007-02-01';
$this-Post-findAll($conditions);

And so does this:
$conditions['Post.created'] = '= 2007-02-31';
$this-Post-findAll($conditions);

And so does this, assuming that posts exist on both those days, and it
only returns posts on those days:
$conditions['Post.created'] = array('2007-02-01', 2007-02-31');
$this-Post-findAll($conditions);

It also works if I query the database directly like this:
select * from posts where created = '2007-02-01'  created =
'2007-02-31';

Am I missing somthing? Why isn't this working?


--~--~-~--~~~---~--~~
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: Switch Element On/Off

2007-03-01 Thread GreyCells

Determine the business logic in the controller and use controller-set
to communicate the decisions to the views/elements.

Don't get too hung up on strict seperation of M-V-C there's plenty
of grey across the boundaries... A pragmatic approach if generally
more productive :)

Interesting discussion here:

http://groups.google.com/group/cake-php/browse_thread/thread/7786024149ca244b/efeb2a04e537e6b1?lnk=gstq=stutchbury+viewrnum=1#efeb2a04e537e6b1

~GreyCells

On Feb 28, 7:44 pm, phirschybar [EMAIL PROTECTED] wrote:
 Hey all..

 What if I have an element and I want to switch it on for some pages
 and off for others?

 I could easily pass it some data and do the logic to determine if it
 should be shown right within the element itself or even in the default
 layout but then I would have business logic right in the views,
 violating MVC...

 How can I do the logic in the controller where it should be and only
 call the element from there?


--~--~-~--~~~---~--~~
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: Problem with multiple INSERTS

2007-03-01 Thread [EMAIL PROTECTED]

i have found the way to build an array of checkboxes.
but when i update this at the controller class
the checkbox in false are not visible. so i must clear all the entries
first
and replace this with the new array.


?php
function edit()
{
if(isset($this-data['Blogs_tags']['checkID']))
{
$ID = $this-data['Blogs_tags']['blogs_id'];
$t = new BlogsTags;
$d = $t-findAllByblogs_id($ID);
foreach($d as $value):
$t-delete_ByField($ID, 
$value['blogs_tags']['tags_id']);
endforeach;
foreach($this-data['Blogs_tags']['checkID'] as $value):
if(isset($value)){
$param = array();
$param['blogs_id'] = $ID;
$param['tags_id'] = $value;
$t-save($param);
}
else{
if ($bol) {
$t-delete_ByField($ID, $value);
}
}
endforeach;
}
}
?

Does anyone have a better idea?
---
Dan

On 28 feb, 14:43, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 i want to post a array with multiples IDs, at an relationchip table.
 All this id are generated by a list of checkboxes.
 input type=hidden name=data[customs][from_id]  value=27 id= /

 input type=checkbox name=data[customs][tags_id] value=1 /
 designbr /
 input type=checkbox name=data[customs][tags_id] value=1 /
 architecturebr /
 input type=checkbox name=data[customs][tags_id] value=1 /
 videosbr /

 and my save function =
 $t = new customs;
 $t-save($this-data['customs']);

 do you have any idea ?

 ---
 Dan


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



Troubles with ajax

2007-03-01 Thread MYRZ

Hi all,

I have a actionview with a ajax-link to another actionview, which
seems to be working just fine. The contents of the actionview
perfectly go into the given div, right after the click.

The only problem is, is that i have a table in this actionview i want
to load in the other. And for some strange reason, it does not work in
Firefox, and it does work in IE. If i open my firebug extention in
Firefox, i see that the table has loaded into the div, but that is
made grey and fuzzy.

Somebody, please, why is this, and does anybody know how to fix it?

Greetings,
Mario Meijers


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



Installing Cake on 1 subdomain with .htaccess, not multiple instances of apps

2007-03-01 Thread [EMAIL PROTECTED]

The documentation over at the CakePHP manual is far too complex for
what I think I'm trying to do.  I have an account on a shared server
and the top level domain is already running wordpress.  If I put Cake
in the top level, that will break Wordpress, right?  So I created a
subdomain dev and installed Cake there.  And I created a .htaccess
file like this:

IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /app/webroot/ [L]
/IfModule

Weird.  This only *partly* works.  For instance, the CSS files are not
being included.  When called directly, i.e. dev.domain.com/css/
cake.generic.css I only get back the index.php file in webroot.  Also,
I set up a controller called notes and can call it only through the
app directory, i.e. dev.domain.com/app/notes and it works (no css).
However,  dev.domain.com/notes only returns me to the index.php


--~--~-~--~~~---~--~~
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: Best performance in templates

2007-03-01 Thread Grant Cox

Do you mean that the entire view file should be wrapped in ?php  ... ?
, and the actual html elements are all output using echo ?

While this may actually be faster, it is far more difficult to develop
and maintain - and the main aim of CakePHP is to make application
development (and support) faster and easier.  By all means you can
rewrite your own views however you like, and deal with these issues
yourself, but I wouldn't recommend it :)


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



Cache an object, not a view

2007-03-01 Thread phirschybar

I see lots of info on caching views in the manual but I am wondering
of I can cache an object as easily. Just a simple array of data so
that I do not have to hit the DB on every page.


--~--~-~--~~~---~--~~
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: Best performance in templates

2007-03-01 Thread mozart_ar

after some tests with eAccelerator + cacheAction, using ab of
apache, I did not find differences of performance between, to use a
single block () and to use a block php by each echo.
thanks


--~--~-~--~~~---~--~~
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: Big Web Application Suggestion

2007-03-01 Thread Grant Cox

It all depends on the resources you have available.

Server - what can you afford, and which vendor provides the support
you need?
Operating System - what can your staff maintain and support?
Backend language - who are your developers, what are they trained in?
Who will train them in something new?
Frontend language - who are your users, what technology will they
have?
Database - what kind of usage (ie reads vs writes, concurrency) will
it have, who will be supporting it, what OS do you need to run on?


--~--~-~--~~~---~--~~
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: Integrating phpGACL with CakePHP

2007-03-01 Thread scragz

I don't have any experience with phpGacl. How hard do you think it
would be to get it using the existing Cake DB connection (for
performance reasons)?

On Feb 28, 4:16 pm, Mariano Iglesias [EMAIL PROTECTED]
wrote:
 Update: still working on this (component is already over 900 lines,
 including documentation, which is about 70% of the code).

 When the component runs for the first time it will set up PhpGacl database
 schema (so there's no need to do anything other than just include phpGacl on
 your vendors directory, and then adding PhpGacl as a component to your
 controller), and create AXO groups/AXO objects for each controller/action
 (see at the bottom of this message)

 Let me give you a quick view on how you programmatically manipulate your ACL
 data:

 // Add groups

 $this-PhpGacl-saveGroup(1, 'my group #1 with ID 1');
 $this-PhpGacl-saveGroup(2, 'my group #1 with ID 2');

 // Modify group

 $this-PhpGacl-saveGroup(2, 'my group #1 with ID 2 with new name');

 // Get groups

 $groups = $this-PhpGacl-getGroups();

 /*
  This gets you a threaded array like:

 Array
 (
 [0] = Array
 (
 [id] = authenticated
 [name] = Authenticated
 )

 [1] = Array
 (
 [id] = 2
 [name] = my group #1
 )

 [2] = Array
 (
 [id] = 3
 [name] = my group #2
 [children] = Array
 (
 [0] = Array
 (
 [id] = 5
 [name] = my group #2.1
 )

 )

 )

 [3] = Array
 (
 [id] = 4
 [name] = my group #3
 )

 )
 */

 // Add user:

 $this-PhpGacl-saveUser(1, 'mariano.iglesias');

 // Modify user:

 $this-PhpGacl-saveUser(1, 'mariano.iglesias (new)');

 // Assign groups to user:

 $this-PhpGacl-assign(1, array(1, 2));

 // Get user groups:

 $this-PhpGacl-getUserGroups(1);

 /*
  * This gets you an array like:
  *
  * Array
  * (
  *[0] = 1,
  *[1] = 2,
  *[2] = authenticated
  * )
  */

 // Change user group assignments:

 $this-PhpGacl-assign(1, array(2, 'authenticated'));

 /*
  * After which the previous assigned group #1 will be un-assigned, #2
  * will remain assigned, and 'authenticated' will be added to the assignment
  */

 // Delete group (and related data):

 $this-PhpGacl-delGroup(3);

 /*
  * By default if the group has children, they will be added as children
  * of this group's parent. But if you call it like:
  *
  * $this-PhpGacl-delGroup(3, false);
  *
  * Then the children will also be deleted.
  *
  * Naturally deleting a group means that assignments with this group are
  * also removed
  */

 // Delete user (and related data):

 $this-PhpGacl-delUser(1);

 // Add controller and its actions as AXO objects:

 $this-PhpGacl-saveController('Posts');

 /*
  * It creates an AXO group called Posts, and assigned to them
  * one AXO object per action.
  *
  * If the controller was already added, only new actions are
  * added
  */

 Next step I'm working on is the assignment of rules between group -
 controller/action, and user - controller/action.

 After that wrap phpGACL check, set up a few things, and then release the
 first version (without the plugin to manipulate data via GUI)

 -MI

 ---

 Remember, smart coders answer ten questions for every question they ask.
 So be smart, be cool, and share your knowledge.

 BAKE ON!

 blog:http://www.MarianoIglesias.com.ar


--~--~-~--~~~---~--~~
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: Cache an object, not a view

2007-03-01 Thread Grant Cox

http://bakery.cakephp.org/articles/view/249

phirschybar wrote:
 I see lots of info on caching views in the manual but I am wondering
 of I can cache an object as easily. Just a simple array of data so
 that I do not have to hit the DB on every page.


--~--~-~--~~~---~--~~
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: Best performance in templates

2007-03-01 Thread Dr. Tarique Sani

On 3/2/07, mozart_ar [EMAIL PROTECTED] wrote:
 This would
 help to the performance of cakephp, correct? Why the script bake.php
 makes the opposite?

Did you perform any tests to confirm your assumptions?

If not - I would suggest do so and be surprised ;)

Besides what Grant as written holds true.

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog: http://cheesecake-photoblog.org
=

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