FeedWizardController
in package
Controller for feed wizard operations.
Handles the multi-step feed creation wizard:
- Step 1: Insert Feed URI
- Step 2: Select Article Text
- Step 3: Filter Text
- Step 4: Edit Options
Tags
Table of Contents
Properties
- $feedFacade : FeedFacade
- Feed facade.
- $languageFacade : LanguageFacade
- Language facade.
- $viewPath : string
- View base path.
- $wizardSession : FeedWizardSessionManager
- Wizard session manager.
Methods
- __construct() : mixed
- Constructor.
- setViewPath() : void
- Set custom view path.
- wizard() : RedirectResponse|null
- Feed wizard page.
- articleHtmlFromExtraction() : string
- Reduce an extraction result to the article HTML the preview shows.
- getStep2FeedHtml() : string
- Get HTML content for step 2 feed preview.
- getStep3FeedHtml() : string
- Get HTML content for step 3 feed preview.
- getWizardFeed() : array<int|string, mixed>
- Get the wizard feed data as typed array.
- initWizardSession() : void
- Initialize wizard session data.
- loadCuratedFeeds() : array<int, array<string, mixed>>
- Load curated feeds from the JSON registry.
- loadExistingFeedForEdit() : RedirectResponse|null
- Load existing feed data for editing.
- loadNewFeedFromUrl() : RedirectResponse|null
- Load new feed from URL.
- processStep2SessionParams() : void
- Process step 2 session parameters.
- processStep3SessionParams() : void
- Process step 3 session parameters.
- updateFeedArticleSource() : void
- Update feed article source.
- wizardStep1() : void
- Wizard Step 1: Insert Feed URI.
- wizardStep2() : RedirectResponse|null
- Wizard Step 2: Select Article Text.
- wizardStep3() : void
- Wizard Step 3: Filter Text.
- wizardStep4() : void
- Wizard Step 4: Edit Options.
Properties
$feedFacade
Feed facade.
private
FeedFacade
$feedFacade
$languageFacade
Language facade.
private
LanguageFacade
$languageFacade
$viewPath
View base path.
private
string
$viewPath
$wizardSession
Wizard session manager.
private
FeedWizardSessionManager
$wizardSession
Methods
__construct()
Constructor.
public
__construct(FeedFacade $feedFacade, LanguageFacade $languageFacade[, FeedWizardSessionManager $wizardSession = null ]) : mixed
Parameters
- $feedFacade : FeedFacade
-
Feed facade
- $languageFacade : LanguageFacade
-
Language facade
- $wizardSession : FeedWizardSessionManager = null
-
Wizard session manager
setViewPath()
Set custom view path.
public
setViewPath(string $path) : void
Parameters
- $path : string
-
View path
wizard()
Feed wizard page.
public
wizard(array<string, string> $params) : RedirectResponse|null
Routes based on step parameter:
- step=1: Insert Feed URI
- step=2: Select Article Text
- step=3: Filter Text
- step=4: Edit Options
Parameters
- $params : array<string, string>
-
Route parameters
Return values
RedirectResponse|null —Redirect response or null if rendered
articleHtmlFromExtraction()
Reduce an extraction result to the article HTML the preview shows.
private
articleHtmlFromExtraction(array<string|int, mixed> $extraction) : string
extractTextFromArticle() answers with one entry per feed item —
[0 => ['TxText' => <html>, ...]] — or an error entry when the fetch
failed. The preview asks about a single item and the wizard views echo a
string, so hand them that item's HTML rather than the whole structure:
echoing the array printed "Array" where the element picker belongs, and
raised "Array to string conversion", which is fatal wherever warnings
are. Storing the array in the session was equally lossy — getFeedItemHtml()
only returns strings, so every render re-fetched the article.
Parameters
- $extraction : array<string|int, mixed>
-
Extraction result
Return values
string —Article HTML, an error notice, or '' when neither is there
getStep2FeedHtml()
Get HTML content for step 2 feed preview.
private
getStep2FeedHtml() : string
Return values
string —HTML content
getStep3FeedHtml()
Get HTML content for step 3 feed preview.
private
getStep3FeedHtml() : string
Return values
string —HTML content
getWizardFeed()
Get the wizard feed data as typed array.
private
getWizardFeed() : array<int|string, mixed>
Return values
array<int|string, mixed>initWizardSession()
Initialize wizard session data.
private
initWizardSession() : void
loadCuratedFeeds()
Load curated feeds from the JSON registry.
private
loadCuratedFeeds() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>loadExistingFeedForEdit()
Load existing feed data for editing.
private
loadExistingFeedForEdit(int $feedId) : RedirectResponse|null
Parameters
- $feedId : int
-
Feed ID
Return values
RedirectResponse|null —Redirect on error, null on success
loadNewFeedFromUrl()
Load new feed from URL.
private
loadNewFeedFromUrl(string $rssUrl) : RedirectResponse|null
Parameters
- $rssUrl : string
-
Feed URL
Return values
RedirectResponse|null —Redirect on error, null on success
processStep2SessionParams()
Process step 2 session parameters.
private
processStep2SessionParams() : void
processStep3SessionParams()
Process step 3 session parameters.
private
processStep3SessionParams() : void
updateFeedArticleSource()
Update feed article source.
private
updateFeedArticleSource(string $articleSection, int $feedLen) : void
Parameters
- $articleSection : string
-
New article section
- $feedLen : int
-
Number of feed items
wizardStep1()
Wizard Step 1: Insert Feed URI.
private
wizardStep1() : void
Tags
wizardStep2()
Wizard Step 2: Select Article Text.
private
wizardStep2() : RedirectResponse|null
Return values
RedirectResponse|null —Redirect response or null if rendered
wizardStep3()
Wizard Step 3: Filter Text.
private
wizardStep3() : void
wizardStep4()
Wizard Step 4: Edit Options.
private
wizardStep4() : void