php - Defining multiple streams and adding fields to each of them in PyroCMS -
i new pyrocms , willing build job site wherein there'll 2 main users namely, employers , job seekers. in order allow them register on site, i'm using streams api pyrocms build forms. these users part of 2 different modules namely employer module , job seeker module.
in details.php file, under install() function, want create multiple streams(database tables). following code helps add stream:
$this->streams->streams->add_stream();
the following code helps define fields added stream:
$this->streams->fields->add_fields($fields);
my concern how add multiple streams above ones , add fields each of them? in other words, how syntax
$this->streams->fields->add_fields($fields);
know stream add fields to?
have @ fields driver documentation streams api. fields , streams separate entities, no required association between two. when adding field can assign stream this:
$field = array( 'name' => 'question', 'slug' => 'question', 'namespace' => 'streams_sample', 'type' => 'text', 'extra' => array('max_length' => 200), 'assign' => 'stream_slug_goes_here', 'title_column' => true, 'required' => true, 'unique' => true ); $this->streams->fields->add_field($field);
or can create streams , fields separately, , assign each field stream this:
$this->streams->fields->assign_field('streams_sample', 'stream_slug_goes_here', 'question', array('required' => true));
all talk of fields , streams makes me want go outside...
Comments
Post a Comment