Cannot add attribute programatically
Permalink 1 user found helpful
Hi
I'm trying to import a CSV file to add pages as well as some attributes. The page adds correctly but the attributes doesn't. Here is my code:
Am I doing anything wrong?
Rony
I'm trying to import a CSV file to add pages as well as some attributes. The page adds correctly but the attributes doesn't. Here is my code:
public function add() { if ($this->isPost()) { $this->validate(); //echo 'Im here'; die; if(!$this->error->has()) { Loader::model('collection_types'); $path = "/companies"; $newPage = Page::getByPath($path); $data = array(); //get the csv file $file = $_FILES['ronyd_csv']['tmp_name']; //echo '<pre>'; print_r($file); $handle = fopen($file,"r"); //loop through the csv file and insert into database do{
Viewing 15 lines of 29 lines. View entire code block.
Am I doing anything wrong?
Rony
No I want it to set on all child pages..
I think your code is set attribute to parent page.
Ohh Ohh Ohh.... :) I got it. Fully my mistake. Thanks for pointing that.
Rony
Rony
Sorry, My English is not good.
Good luck!
Good luck!
Sorry, My English is not good.
Good luck!
Good luck!
I think...
Do you want like this?