Route wildcards

2007-01-31 Thread Dave Rogers

In the system that I am putting together, I would like to be able to
drop plugins into the system and they just work.

If I use scaffolding, this works.

I would like to, however, allow the use of URLs created by the
administrator of the system, such as:
/aboutus
/aboutus/contacts
/community
/community/events
/

This works if I add a route to /* and then parse out the url in the
function that the route points to.

Now comes the tricky part.  I can't seem to get these to work
together.  If I drop in a plugin named, for example, 'priviledges',
the system uses the /* route and everything looks like it should go to
a page that has been soft-coded with 'privileges', not the privileges
plugin.

Is there a way that I can dynamically generate the routes.php file?
Or is there something else I could try?

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



Using one set of controllers/models for multiple sites

2007-01-25 Thread Dave Rogers

Is there a way to use one set of controllers and models for multiple
sites?  This would effectively create an ASP (Application Service
Provider) model.

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



Creating Dynamic Model Associations

2007-01-17 Thread Dave Rogers

In my latest project, I am trying to make particular Models/Controllers
inherit from other Models/Controllers that I create.  For example:

Items
 -- Article
  -- News
  -- Event

In particular, I am trying to figure out the model association, so that
I can plug in a new Model and Controller and it all works magically.

My current Items Model is:

?php
class Item extends AppModel {
var $name = 'Item';

var $hasMany = array(
'Event' =
array('className' = 'Event',
'conditions'= '',
'order' = '',
'limit' = '',
'foreignKey'= 'item_id',
'dependent' = true,
'exclusive' = false,
'finderQuery'   = ''
)
);
}
?

I don't want to have to go in and edit the Items model every time I get
a new model that inherits from Item.

I know you can, on the fly, do new associations (or is this v1.2?) but
they only work for the next query.  Is this correct?

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



How to do dynamic includes of controllers

2007-01-11 Thread Dave Rogers

I am trying to put together a CMS that would allow you to create an
infinite number of pages and add an infinite number of sections (which
are controllers) to that page.

So far, I have a page controller that accepts all URLs that do not
specifically have a route defined:  mysite.com/about goes to the pages
controller and looks up the page 'about' and finds all the sections for
that page.  The 'about' page might have a 'news' section and a
'content' section.  In turn, the 'news' section does a requestAction of
'/news/show', then it does a similar requestAction for the 'content'
section.

The code looks like this:
foreach ($pageSections as $pageSection) {
  if ($pageSection['Section']['section_type_id']!='0') {
$requestAction = '/'.
strtolower($pageSection['SectionType']['title']).
'/show';
$pageContent .= $this-requestAction($requestAction,
array('return'
,'pageSection'=$pageSection
,'permissions'=$this-permissions
)
 );
  }
}

My question is:  Does this seem like the best way to do this sort of
thing?  Is there another way to do it because it seems kind of abstract
and might break easily with an update to the Cake core files.

If this is unclear, please let me know.


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



Extending controllers

2007-01-11 Thread Dave Rogers

I have an CMS application that has multiple 'modules' that can be used
on each 'page'.  These 'modules' seem to naturally extend each other.
A sample hierarchy of modules is below:

Item
-- Article
-- Content
-- Announcement
-- Event
-- File
-- Document
-- Image
-- Audio

So, in my item controller, I can define common things, like 'title'.
Then the article controller extends 'item' by adding 'title' and
'body'.  Then the event controller extends 'article' by adding
'start_date', 'end_date', 'location', etc.

Just because of OO design, each extended controller takes longer to
process because of having to go up the chain.  I don't know how much
overhead this really is, though.

It seems to work fairly well:  I only have to change things in one
place.  I'm wondering though, is there a way to get the parent's views
such that I only have to have a view in one place, such as 'article'
instead of duplicating views for content, announcement and event?

Is there a more defined way to do what I am attempting?


--~--~-~--~~~---~--~~
 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 do dynamic includes of controllers

2007-01-11 Thread Dave Rogers

I just wanted to make sure I understood you.

I found this link on cakephp groups:
http://groups.google.com/group/cake-php/browse_frm/thread/6dab044365132bdf/02ffb077f9ebf389?lnk=gstq=elementsrnum=14#02ffb077f9ebf389

Is that what you had in mind?


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



Saving Associated Data that is an Array

2006-12-13 Thread Dave Rogers

I have a report form that has a list of people who attended an event.
When I try to save the attendees, the first one is added to the db, the
rest attempt to update with the id of the event.

here is an idea of the data:

$this-data['event']=array(
 'title'='title of event',
 'date'='12/12/2006',
 'attendees'=array(
  [0]=array(
   'name'='sara lemming',
   'title'='queen bee'
  ),
  [1]=array(
   'name'='joe schmoe',
   'title'='worker bee'
  )
 )
)

Before I save, I copy the attendees array to another variable
($attendees) and then unset the 'attendees' element from the data
array.  The data array then saves ok.

Then I do a 'foreach' on the $attendees array and save each to the
proper model.  The first one is inserted into the db.  Then there is a
'select count' sql that is looking for the id of insert of the data
array.  Then the rest of the $attendees try to update based on that id.

What am I doing wrong?


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



DBO MetaType Error

2006-07-31 Thread Dave Rogers

I am attempting to upgrade to the newest version of CakePHP from a beta
version.  I am using Oracle using dbo.  When I run any route, I get the
error:

Fatal error:  Call to a member function MetaType() on a non-object in
...\cake\libs\model\dbo\dbo_adodb.php on line 298

Does this ring a bell to anyone.  I'm having trouble tracking down
where/how this is getting implemented.

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



Re: DBO MetaType Error

2006-07-31 Thread Dave Rogers




nate wrote:

  Do you have ADOdb installed in /vendors?




  

Yes. I have ADOdb installed in /vendors. It
was working before I tried upgrading.

Does the upgrade need to be a certain revision level?

--Dave


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





No Database table for model

2006-05-22 Thread Dave Rogers

I just installed Cake v1 thinking that some of the bugs that I had seen
earlier might be fixed.  I am pleased to say most of them are.

I am working with an Oracle database and tried using adodb-oci8.  It
seems to connect ok (when I change the connection string I get a
connection error, so I'm thinking it is connecting ok).  But I get a
'No Database table for model' error message.  I know the table is
there.

Is there a way to check the db connection?  Can I do any raw sql to try
to gather some information about what might be causing this?

I tried creating a tests_controller with '$uses=null;' statement so I
could try to access the db directly, but I get a notice: 'Notice:
Undefined property: TestsController::$Test in
...cake\libs\controller\scaffold.php on line 431'.

Any more ideas?


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



Re: No Database table for model

2006-05-22 Thread Dave Rogers

Ok...with more in depth research, I found that it cannot find the table
list in the cache.  Where does it set that table list?


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



Using a querystring results in 'Requested address could not be found error'

2006-05-18 Thread Dave Rogers

I am creating a login function and I am passing the url of the page
they were trying to access as well as other information in the
querystring using a $this-redirect in another function.

The url looks like this:
http://cake.localhost/users/login/?url=post.addaccountID=1234

When I put that in the address bar, I get the error that the requested
address could not be found.  I have setup the route:
$Route-connect ('/login/*', array('controller'='users',
'action'='login'));

Is this the correct way of setting it up?  In the manual at
http://manual.cakephp.org/chapter/7 , it states `For example, if the
URL /posts/view/?var1=3var2=4 was called, $this-params['pass'] would
equal ?var1=3var2=4.`


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



Re: HABTM doesn't seem to be working

2006-05-04 Thread Dave Rogers

I can't find cakebin on the newly designed site.

After I posted the code, I realized I should have said that I was
working on a new dbo for Oracle.  I have made modifications to the
dbo_source and datasource files, which might be the problem.  I am
doing this because you can't get the table name from oracle like you
can in MySQL.  I have already committed to a project using Cake and
need to make it work.

When a table has other tables associated with it, does Cake parse
through all the tables to find all the fields of the current table and
the associations?  Could that be the reason that all the tables are not
showing up?

I would like to find a cleaner way to do all this, but the only way I
could find so far is to do something like this:

In the dbo_source file, fields function, around line 1050 I have
modified the code from:
$fields[$i] = $this-name($alias) . '.' . $this-name($fields[$i]) . '
AS ' . $this-name($fields[$i]);
to
$fields[$i] = strtoupper($this-name($alias) . '.' .
$this-name($fields[$i]) . ' AS ' . $this-name($alias) . '_#_' .
$this-name($fields[$i]));

Which in effect prepends the table alias name to the field name and
concatonates them with '_#_'.  I can then use that to re-generate the
table name in the dbo_oracle.php file.

Does it all make more sense now?  Am I on the right track?  Can you
point me in another, less intrusive way to do this?


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



Re: HABTM doesn't seem to be working

2006-05-04 Thread Dave Rogers

The sheet (page) and section controllers and models are at
http://cakephp.org/pastes/show/f9985ada4a1e1d83a5eab4f3cceb10f0

Thanks for taking a look at them


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



Re: Using Oracle with Cake

2006-05-04 Thread Dave Rogers

There were some things with my dbo_oracle that were causing problems:

* PHP OCI functions do not return the table, so everything was being
  put into the [0] array, which caused problems if the column name
  from different tables were used.
* The base dbo_source.php file was aliasing tables with the keyword AS,
  which Oracle doesn't seem to like.  It works ok without the 'AS'
  keyword.
* There is no 'insert_id' function for Oracle like there is for MySQL.
  We are using a sequence table.  I think this is standard for Oracle,
  so I need to figure out a way to get the lastInsertID working
  properly.
* I'm sure that there will be other things that crop up.

I am trying to get this all working, but I am having to delve into the
dbo_source.php and datasource.php files, so it's not going to be
pretty.

I can't seem to get adodb-oci8 to work and I'm not sure about a PEAR
driver.

Anyone have any more suggestions?


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



Re: Multi-User Permission Control

2006-05-04 Thread Dave Rogers

Where does this get installed?  At the base level (same as cake and
app) or under one of these?


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



Re: Using Oracle with Cake

2006-05-04 Thread Dave Rogers

I have a not so elegant first round attempt at getting oracle to work.
I modified the dbo_source.php and datasource.php files.  I also created
a dbo_oracle.php file.

The code for all three is at
http://cakephp.org/pastes/show/081dbc0d1d0c131feec6be10e02d9285

Please give me suggestions on how to improve 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
-~--~~~~--~~--~--~---