You can use Set::extract for tidying array
On Thu, 2009-04-09 at 06:56 -0700, rossjha wrote:
> This seems to be working.
>
> $this->Tag->unbindModel(array('hasAndBelongsToMany' => array
> ('Improvements')));
> $this->Tag->bindModel(array('hasOne' => array(
> 'Improv
Hey everyone I have been following the tutorial on setting up an ACL
system, and everything has gone well until I got the the section on
setting permissions: http://book.cakephp.org/view/648/Setting-up-permissions
I put in the initDb() code they give you there, but when I try and
load the page to
Make you own error handler and call these methods manually if it
wasn't done in normal flow. It is the only way.
On Apr 8, 11:21 pm, "rich...@home" wrote:
> In my AppController, I set a bunch of view variables in the
> beforeFilter() {} callback.
>
> I use these view variables ($authUser) in the
On Apr 9, 3:08 pm, "smithtrev...@googlemail.com"
wrote:
> Ok, now I've done that, I've spent the last couple of hours trying to
> insert the parsed xml into a database table called teams.
>
Well, depending on what your table columns are named, you may need to
change some of the keys in the array
If you using Jquery, maybe i can give some hand.
My method is:
1. Sending input using JSON -> Controller.
2. Validates on controller
3. Send back report using JSON to View
On Wed, 2009-04-08 at 20:06 -0230, Dave Maharaj :: WidePixels.com wrote:
> Has anyone have any advice on live validation u
Ok, thank you Miles, I will try for the thickbox.
On Apr 9, 5:09 pm, Miles J wrote:
> Im pretty positive lightbox is images only. You would have to try
> thickbox, or another equivalent.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Have you edit the cake for libs at all? Because thats where its
located.
Or have you overwritten that method?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-
Your wellcome, sorry for the small mistake.
2009/4/9 brian
>
> 2009/4/9 Jorge Horacio Cué Cantú :
> > Hello,
> >
> >
> > Set
> >
> > $this->Auth->redirect = false
> >
> > in AppController::beforeFilter().
> >
> > The the login() action will be called after a successful login.
> >
>
> Thanks,
Hi
I am trying to access a database table that was built without a
primary key (I know). How would I go about this in CakePHP. Is it
possible or do I have to just use Model::query all the time?
--~--~-~--~~~---~--~~
You received this message because you are subscri
I keep getting Fatal error: Call to undefined function loadmodel()
I have no idea what has happened butikeep seeing this error. If i delete
cookies it disappears but i am sure thats not a good thing.
Anynoe know why I am getting this message so i canback track to see what i
have done wrong?
T
On Apr 3, 8:05 am, Fábio "Kym" Nascimento
wrote:
> Hey,
>
> I'd like to see a summary of yourbookbefore buying, I think people
> wants to know a little deep what are you talking about on thebook,
> chapters and sub-chapters names at least.
>
> Thanks
Hrm...maybe I should put that up there on the
Wow, never heard of this before!
Thank you very much!
On Apr 9, 11:27 pm, grigri wrote:
> In the afterDelete() callback, $this->id(or $model->id) in a behavior
> will refer to the just-deletedmodel. It's cleared after the callbacks
> have been called, just before Model::del() returns.
>
> hth
>
Use Containable over Recursion.
http://book.cakephp.org/view/474/Containable
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscri
The problem is the attribute recursive: i cannot set it to 3 as i
need! Is there a way to bypass the problem or a trick to have more
deep association fatching? Thanks!
On 9 Apr, 16:27, luke83 wrote:
> Hi there,
> first question, complex question :D
>
> i have tables in db like this:
>
> + league
Hi all.
A brief description of my problem:
I need to make pagination with non-fixed page size, every page must
contain items from certain month only. I wrote the query correctly ,
but the CAKE cannot count pages correctly because it calculates the
number of pages by dividing the total count of i
Im pretty positive lightbox is images only. You would have to try
thickbox, or another equivalent.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googleg
NOT LIKE '%term%'
Is that what you mean?
http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to
Dardo
Thanks - I already tried this direction and it doesn't affect the
location of the label - it still appears above the input box.
I can change label placement for all the forms but in this case I only
want to change one particular field label
In the view:
echo $form->input('idcode', array(
If I've understood correctly I had a very similar problem. I was using
the inbuilt pages controller and had an 'AddThis' widget in the footer
of the layout that I generally wanted to be visible, but on certain
pages it wasn't required. All I did was at the top of the pages I
didn't want the 'AddTh
Same thing happens if I replace "generatetreelist" with "findAll"
-BP
On Apr 9, 3:22 pm, cartosys wrote:
> my conditions:
>
> $sqlConditions = array(
> 'Node.lft' => ">= ".$node["Node"]["lft"],
> 'Node.rght' => "<= "
my conditions:
$sqlConditions = array(
'Node.lft' => ">= ".$node["Node"]["lft"],
'Node.rght' => "<= ".$node["Node"]["rght"]);
$nodes = $this->Node->generateTreeList($sqlConditions);
and this is the r
Ok, now I've done that, I've spent the last couple of hours trying to
insert the parsed xml into a database table called teams.
However, I am struggling to do so.
I've had a few tries using a number of different methods.
http://abeautifulsite.net/notebook/42
http://www.codewalkers.com/c/a/Databa
Ok, I've managed to do it by using the XML file directly from the
website, and not using a local copy. This is definitely much better.
Thanks for your help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" gr
You probably downloaded 1.2 but are reading about 1.1.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, se
Ok, I tried the test, and also print_r($parsed_xml) and var_dump
($parsed_xml).
When I tried the test, with all of them except var_dump($parsed_xml),
it again just showed "Array".
But with var_dump($parsed_xml) it shows:
array(1) { ["Testxml"]=> array(2) { ["test2"]=> string(17) "Content
of tes
You will have to look at the driver for DB2. If you need to override
it you can place it in app/models/datasources or submit a patch.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this gr
OK unbind model. I managed to unbind 1 model but how unbind multiple
models at one?
$this->User->unbindModel(array('hasMany' => array('Message')));
thanks
Dave
On Apr 9, 2:29 pm, "Dave Maharaj :: WidePixels.com"
wrote:
> Can anyone assist me with this?
>
> In the standard controller view func
I actually just used unbind to not get any results from the 2 models since
in that particular layout I do not need any data from those associated
tables.
Thanks for the info and time.
Dave
-Original Message-
From: brian [mailto:bally.z...@gmail.com]
Sent: April-09-09 2:33 PM
To: cake
2009/4/9 Jorge Horacio Cué Cantú :
> Hello,
>
>
> Set
>
> $this->Auth->redirect = false
>
> in AppController::beforeFilter().
>
> The the login() action will be called after a successful login.
>
Thanks, that's it (sort of). The var is actually $this->Auth->autoRedirect.
So, for the record:
A
You could either use find() along with 'contain' or you could simply
not display certain fields in the view.
On Thu, Apr 9, 2009 at 12:29 PM, Dave Maharaj :: WidePixels.com
wrote:
>
> Can anyone assist me with this?
>
> In the standard controller view function there is this:
>
> $this->set('user
Hi!
In the 1.1 Collection of the manual, section: 5 Configuration, I'm
reading through the section "Advanced Routing Configuration: Admin
Routing and Webservices"
The third paragraph begins:
"To enable this, first, uncomment the CAKE_ADMIN line in your /app/
config/core.php file."
So, I go to
Hello,
Set
$this->Auth->redirect = false
in AppController::beforeFilter().
The the login() action will be called after a successful login.
Regards.
2009/4/9 brian
>
> Actually, yes, I did consider that and I think I will do it that way.
> But that still leaves with this problem: how to
Can anyone assist me with this?
In the standard controller view function there is this:
$this->set('user', $this->User->read(null, $id));
which gets all the User info from the tables based on the ID but I do not
want every thing returned. I have information for that User in their profile
fun
Hi,
$parsed_xml should be an array representation of the XML. If nothing
is returned (you could also try print_r($parsed_xml) or
var_dump($parsed_xml) ) then your XML is probably malformed or not
loaded.
Try making a simple test like this and show us the output:
$tstxml = " Content of test 2
Co
Thanks for your help. I've been using this code and I think it's sort
of worked.
function index() {
App::import('Xml');
$file = "http://localhost\parses\y.xml";;
$parsed_xml =& new XML($file);
$parsed_xml = Set::reverse($parsed_xml); // this is what i call
magic
debug($pars
Actually, yes, I did consider that and I think I will do it that way.
But that still leaves with this problem: how to check this field after
a successful login?
On Thu, Apr 9, 2009 at 11:48 AM, Angry Coder wrote:
>
> Have you considered a separate column in your users table of
> "accepted_eula"
Have you considered a separate column in your users table of
"accepted_eula" or "eula_version_accepted" if you want to track which
version of the EULA they have accepted?
It would be easy then to force users to re-accept if it changes and
you do not have to lose the "last_login" data if you wish
In the afterDelete() callback, $this->id (or $model->id) in a behavior
will refer to the just-deleted model. It's cleared after the callbacks
have been called, just before Model::del() returns.
hth
grigri
On Apr 9, 4:09 pm, park wrote:
> Hi,
>
> Working on a set of models, in which after one mo
OK, it looks like one can't override login() with AuthComponent in
place. I was sure I could, and it doesn't make sense to me that I
can't. If someone knows otherwise, please advise.
So, I tried putting my code in isAuthorized().
AppController:
function beforeFilter()
{
$this->Auth->fiel
Hi every one,
If I wanna fetch a db entry how got "blue car" in a field,
1 > I can set "WHERE fieldName LIKE '%blue%' "
2 > But how could I make the opposite ? I got "blue car" and I wanna
find an entry whith "blue". Obviously LIKE '%blue car%' will not work.
(I don't wanna (can't) handle "blue
Hi all,
I am considering cake as a front-end to a large db2 database and i
have this weird problem, which does not apply to mssql and mysql
databases. Whenever i try to a view an entry from a table by clicking
on the respective link on the index page, i get an SQL Error: 42818.
The cause is that
Hi there,
first question, complex question :D
i have tables in db like this:
+ leagues
| - lid
| - name
+ users
| - uid
| - name
+ groups
| - gid
| - name
+ league_staff
| - lid
| - gid
| - uid
The models:
class League extends AppModel {
var $name = 'League';
var $primaryKey = 'lid'
Hi there,
I have 4 table that relate to this problem...
- Products
- Types
- Sizes
- StockItems
I have set CakePHP so that each product has a Type.
I am now sorting out the StockItems controller/views. Each StockItem
will relate to a single Product and will specify the Size of the
StockItem.
M
Hi,
Working on a set of models, in which after one model got its record
updated, the Log model will be manipulated accordingly.
$cascade = true of Model:del() doesn't seem to work, 'coz models
mentioned above are not associated. (Log model has a field 'item_id'
that is shared by all other models
I need to direct first-time users to an EULA page for a client's
extranet. I thought I'd check the last_login field in order to decide
whether to redirect there or not. However, for some reason, I'm being
logged in but none of my custom code is running.
function beforeFilter()
{
parent::b
sortBy do not exists !!! :(
http://api.cakephp.org/class/paginator-helper
On 8 abr, 03:24, Elavazhagan chidambaram
wrote:
> this is ur code sort('MUNICIPIO',
> 'Municipio.Nome_municipio'); ?>
>
> this code right code $paginator->sortBy('Municipio.Nome_municipio', 'MUNICIPIO'); ?>
>
> On Tue,
set() is called from within save() before validation. If you need to
call validates() yourself, you must first set the data.
http://book.cakephp.org/view/410/Validating-Data-from-the-Controller
http://api.cakephp.org/view_source/model/#line-1094
On Thu, Apr 9, 2009 at 10:05 AM, Rhee wrote:
>
>
I see.
Thanks a lot!
On Apr 8, 4:45 am, Miles J wrote:
> You are not able to use Components in models. The best is to import
> the session component.
>
> App::import('Component', 'Session');
> $Session = new SessionComponent();
>
> $user = $Session->read('Auth.User');
--~--~-~--~~--
Maybe I am just too idiot to understand this.
I know what $this->Model->set() do. But I used for adding a new data
set in database. Also, it has no ID / primary key yet, by the time i
called set() method. So what did set() do, so that validate() can be
called properly after that?
On Apr 9, 3:52 p
This seems to be working.
$this->Tag->unbindModel(array('hasAndBelongsToMany' => array
('Improvements')));
$this->Tag->bindModel(array('hasOne' => array(
'ImprovementsTag',
'FilterTag' => array(
'className' => 'Tag',
On Thu, Apr 9, 2009 at 8:06 AM, Rhee wrote:
>
> Next question, why is it now working? What did $this->Model->set() do?
> Can you gimme short explanation?
>
It sets the Primary Key for the model and $Model->data values.
http://api.cakephp.org/class/model#method-Modelset
--~--~-~--~~
$this->set() doesn't work?
http://api.cakephp.org/class/view#method-Viewset
-Mark
On Apr 8, 9:40 am, the_woodsman wrote:
> To my mind, a controller shouldn't need to know about the ugly
> semantics of Javascript dependencies etc - it's entirely presentation
> related, is irrelevant to other ou
Hi i have the following associations:
var $hasAndBelongsToMany = array('Improvements');
var $hasAndBelongsToMany = array('Tags');
With a join table improvements_tags
I want to be able to count the number of time a tag has been used.
The following sql query works, but i'm not sure how to do this
@ logout: sure maybe there is an error there, I didn't only copy paste
the source, I did some modification to cover up the real messages ...
But thanks a lot for your concern. ;-)
On Apr 9, 2:02 pm, logout wrote:
> Is this a typo here:
>
> 'alphanumeric' => array (
>
Yes of course, i did test it in if-block ... ;-)
Code looks like this:
if ($this->User->validates($this->data))
{
// This block will be always executed
}
Anyway, i found how to work around it. Before if-block, i put set().
Code:
$this->User->set($this->data);
if ($this->User->validates())
Is this a typo here:
'alphanumeric' => array (
'rule' => 'alphaNumeric',
'message' => 'Error
)
because the Error is missing the closing '
On Apr 8, 6:41 pm, brian wrote:
> > $this->User->validates($this->data); // al
In the core.php there is this section:
* The preferred session handling method. Valid values:
*
* 'php'Uses settings defined in your php.ini.
* 'cake' Saves session files in CakePHP's /tmp directory.
* 'database' Uses CakePHP's database sessions.
*
*
Did you see output from debug(Configure::getInstance()); ?
$behaviorPaths= array(ROOT.'common'.DS.'models'.DS.'behaviors');
controllerPaths
componentPaths
helperPaths
pluginPaths
On Apr 8, 3:19 pm, Ernesto wrote:
> And... to share a behavior?
>
> On 7 Apr, 18:11, majna wrote:
>
> > Setup
thx!
That was much easier as I expected, Cake rocks!
On 9 Apr., 02:31, schneimi wrote:
> Hi Aurelius,
>
> I use something like this in config/routes.php:
>
> $subdomain = substr(env("HTTP_HOST"), 0, strpos(env("HTTP_HOST"),
> "."));
>
> if ($subdomain != 'domain') {
> Router::connect('/', ar
Hello All,
I am using http://bakery.cakephp.org/articles/view/lightroom-helper
for lightbox effect.
This is working properly for showing images not for HTML
Is it only for Images?
Manisha
--~--~-~--~~~---~--~~
You received this message because you are subscribed
The pages on my website are hierarchicaly structured as a tree, and
one of the mandatory requests for the website is to represent the page
hierarchy in the URLs. The pages and their relationships are defined
in a database table. So, what I would like to do is query the database
(and cache the resu
hi!
$data = $this->Blog->findAll(array('
>
> Blog.id' => array(7, 8, 9),array('Blog.blogId','Blog.
>>
>> blogImage','Blog.blogTitle'));
>
>
2009/4/9 kaushik
>
> How to use not 'IN' in condition in finall()?
>
>$data = $this->Blog->findAll(array('Blog.id' =>
> '5'),array
> ('Blog
grigri had a nice clean solution for this:
http://bin.cakephp.org/saved/38624
On Apr 9, 12:13 am, Joe Critchley wrote:
> You should probably use the ClassRegistry class.
>
> You can instantiate an unrelated model by doing the following:
>
> $ModelName = ClassRegistry::init('ModelName');
>
> ...
'Required' is not a rule as noted in
http://book.cakephp.org/view/127/One-Rule-Per-Field
Your code should be:
var $validate = array(
'blogCategoryId' => array(
'rule' => 'notEmpty',
'required' => true,
'message'=>'Please select Blog category.'
)
);
On M
64 matches
Mail list logo